/*
 * PACFAIE Learn front end.
 * Tokens follow the PACFAIE brand guide; colours can be changed in Settings.
 * Everything is scoped to .pacl / .pacl-focus so themes are left alone.
 */

.pacl,
.pacl-focus {
	--pacl-ink: #1A1512;
	--pacl-body: #403831;
	--pacl-muted: #6B6157;
	--pacl-accent: #E87722;
	--pacl-on-accent: #2A1607;
	--pacl-highlight: #D23A2E;
	--pacl-gold: #E0A82E;
	/* Darkened from #A06414: that value was only 4.47:1 against --pacl-bg
	 * (#FBF5EA), just under the 4.5:1 AA threshold for normal text, though it
	 * cleared 4.85:1 against --pacl-paper (#FFFFFF). #985F13 clears 4.5:1
	 * against both (4.86:1 on --pacl-bg, 5.27:1 on --pacl-paper) while staying
	 * the same deep-gold hue. */
	--pacl-gold-deep: #985F13;
	--pacl-bg: #FBF5EA;
	--pacl-bg-2: #F3E8D4;
	--pacl-tint: #FBEEDD;
	--pacl-paper: #FFFFFF;
	--pacl-line: rgba(26, 21, 18, .10);
	--pacl-success: #2E7D46;
	--pacl-font: inherit;
	--pacl-radius-card: 13px;
	--pacl-radius-btn: 9px;
	--pacl-kente: repeating-linear-gradient(90deg, #D23A2E 0 22px, #E87722 22px 44px, #E0A82E 44px 66px, #1A1512 66px 88px);
}

/* Dark mode: same kente hues, ink/background relationship flipped so text stays
 * light-on-dark. --pacl-on-accent is re-picked so it still reads clearly on the
 * (brightened) accent orange; the kente stripe itself is left as-is on purpose,
 * it's a fixed brand mark rather than page chrome. */
@media (prefers-color-scheme: dark) {
	.pacl,
	.pacl-focus {
		--pacl-ink: #F7F1E7;
		--pacl-body: #D9CEC0;
		--pacl-muted: #A69C8F;
		--pacl-accent: #FF8A3D;
		--pacl-on-accent: #1F0E02;
		--pacl-highlight: #FF6B5E;
		--pacl-gold: #F0BE55;
		--pacl-gold-deep: #E8B84A;
		--pacl-bg: #1B1512;
		--pacl-bg-2: #241C17;
		--pacl-tint: #2E2119;
		--pacl-paper: #2A211B;
		--pacl-line: rgba(247, 241, 231, .14);
		--pacl-success: #4CAF6D;
	}
}

/* Explicit overrides for the Appearance control in the account menu
 * (account_bar()): frontend.js sets data-pacl-theme="light"/"dark" on
 * <html> when a learner picks something other than "Auto", and the small
 * bootstrap script PACL_Frontend::theme_bootstrap() prints in <head>
 * re-applies a saved choice on the next visit before the page paints.
 * "Auto" removes the attribute entirely, leaving the @media rules above to
 * follow the device as before this control existed.
 *
 * These need to win even when they disagree with the device's own
 * preference — e.g. "Light" chosen on a device set to dark — which a
 * plain ".pacl,.pacl-focus" selector can't do against the @media rule
 * above; "html[data-pacl-theme] .pacl" has one extra attribute selector's
 * worth of specificity, which is enough. Values must stay identical to
 * their unqualified counterparts (the block above for dark; the top of
 * this file, plus PACL_Frontend::inline_css() for the Settings-configured
 * subset, for light) — keep all three in sync.
 */
html[data-pacl-theme="dark"] .pacl,
html[data-pacl-theme="dark"] .pacl-focus {
	--pacl-ink: #F7F1E7;
	--pacl-body: #D9CEC0;
	--pacl-muted: #A69C8F;
	--pacl-accent: #FF8A3D;
	--pacl-on-accent: #1F0E02;
	--pacl-highlight: #FF6B5E;
	--pacl-gold: #F0BE55;
	--pacl-gold-deep: #E8B84A;
	--pacl-bg: #1B1512;
	--pacl-bg-2: #241C17;
	--pacl-tint: #2E2119;
	--pacl-paper: #2A211B;
	--pacl-line: rgba(247, 241, 231, .14);
	--pacl-success: #4CAF6D;
}
html[data-pacl-theme="light"] .pacl,
html[data-pacl-theme="light"] .pacl-focus {
	/* --pacl-ink/bg/accent/on-accent/highlight/font come from inline_css(),
	 * at this same specificity, so the Settings-configured colours (not
	 * just these defaults) apply when "Light" is explicitly chosen. */
	--pacl-body: #403831;
	--pacl-muted: #6B6157;
	--pacl-gold: #E0A82E;
	--pacl-gold-deep: #985F13;
	--pacl-bg-2: #F3E8D4;
	--pacl-tint: #FBEEDD;
	--pacl-paper: #FFFFFF;
	--pacl-line: rgba(26, 21, 18, .10);
	--pacl-success: #2E7D46;
}

.pacl-focus { --pacl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.pacl { font-family: var(--pacl-font); color: var(--pacl-ink); }
.pacl *, .pacl-focus * { box-sizing: border-box; }

.pacl-kente { display: block; height: 6px; background: var(--pacl-kente); }

.pacl .screen-reader-text,
.pacl-focus .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.pacl-icon {
	width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em;
	fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons ------------------------------------------------------------ */
.pacl-btn {
	display: inline-flex; align-items: center; gap: .5em;
	font: 600 15px/1.2 var(--pacl-font);
	padding: 12px 20px; border-radius: var(--pacl-radius-btn);
	border: 1.5px solid transparent; text-decoration: none !important; cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
.pacl-btn--primary { background: var(--pacl-accent); color: var(--pacl-on-accent) !important; }
.pacl-btn--primary:hover { background: color-mix(in srgb, var(--pacl-accent) 88%, #000); }
.pacl-btn--ghost { background: transparent; border-color: var(--pacl-ink); color: var(--pacl-ink) !important; }
.pacl-btn--ghost:hover { background: var(--pacl-tint); }
.pacl-btn:focus-visible,
.pacl a:focus-visible,
.pacl-focus a:focus-visible,
.pacl button:focus-visible,
.pacl input:focus-visible,
.pacl select:focus-visible,
.pacl-focus summary:focus-visible {
	outline: 3px solid var(--pacl-accent); outline-offset: 2px;
}
.pacl-link-btn {
	background: none; border: 0; padding: 0; font: inherit; color: var(--pacl-gold-deep);
	text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

.pacl-pill {
	display: inline-block; margin: 0; font: 600 12px/1 var(--pacl-font);
	color: var(--pacl-gold-deep); background: var(--pacl-tint);
	padding: 6px 12px; border-radius: 20px;
}
.pacl-muted { color: var(--pacl-muted); }
.pacl-eyebrow {
	margin: 0 0 8px; font: 600 12px/1.3 var(--pacl-font);
	letter-spacing: .09em; text-transform: uppercase; color: var(--pacl-highlight);
}
.pacl-done { display: inline-flex; align-items: center; gap: .4em; margin: 0; color: var(--pacl-success); font-weight: 600; }

/* Notices ------------------------------------------------------------ */
.pacl-notice {
	margin: 0 0 16px; padding: 12px 16px; border-radius: 8px;
	font-size: 15px; line-height: 1.5; border: 1px solid var(--pacl-line); background: var(--pacl-paper);
}
.pacl-notice--success { border-color: rgba(46, 125, 70, .35); background: #F0F7F2; color: #1F5A31; }
.pacl-notice--error { border-color: rgba(210, 58, 46, .35); background: #FDF0EE; color: #8E241B; }
.pacl-notice--info { background: var(--pacl-tint); color: var(--pacl-ink); }

/* Fields ------------------------------------------------------------- */
.pacl-field { display: flex; flex-direction: column; gap: 6px; font: 500 14px/1.3 var(--pacl-font); color: var(--pacl-ink); }
.pacl-field input,
.pacl-field select {
	font: 400 15px/1.3 var(--pacl-font); color: var(--pacl-ink);
	padding: 11px 13px; border: 1px solid var(--pacl-line); border-radius: 8px; background: var(--pacl-paper);
	min-width: 0; width: 100%;
}
.pacl-field input:focus,
.pacl-field select:focus { outline: none; border-color: var(--pacl-accent); box-shadow: 0 0 0 3px rgba(232, 119, 34, .18); }
.pacl-check { display: inline-flex; align-items: center; gap: 8px; font: 500 14px/1.3 var(--pacl-font); }

/* Progress ----------------------------------------------------------- */
.pacl-progress { margin: 12px 0; }
.pacl-progress__track { height: 8px; border-radius: 8px; background: var(--pacl-bg-2); overflow: hidden; }
.pacl-progress__track span { display: block; height: 100%; background: var(--pacl-accent); border-radius: 8px; min-width: 0; }
.pacl-progress__text { margin: 6px 0 0; font-size: 13px; color: var(--pacl-muted); }

/* Top bar / account menu ---------------------------------------------
 * Shown at the top of the plugin's own pages (course, dashboard,
 * catalogue) for signed-in learners. Scoped entirely to .pacl, so it
 * never touches the theme's own header — see PACL_Frontend::account_bar().
 */
.pacl-topbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	margin: 0 0 20px; padding: 10px 0;
}
.pacl-topbar__nav { display: flex; flex-wrap: wrap; gap: 6px; }
.pacl-topbar__nav a {
	display: inline-block; padding: 8px 14px; border-radius: 20px;
	font: 600 14px/1.2 var(--pacl-font); color: var(--pacl-ink); text-decoration: none;
}
.pacl-topbar__nav a:hover, .pacl-topbar__nav a:focus-visible { background: var(--pacl-tint); }
.pacl-topbar__account { position: relative; }
.pacl-topbar__toggle {
	display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
	background: transparent; border: 1px solid var(--pacl-line); border-radius: 24px; cursor: pointer;
	color: var(--pacl-ink);
}
.pacl-topbar__toggle:hover { background: var(--pacl-tint); }
.pacl-topbar__toggle .pacl-avatar, .pacl-topbar__toggle .pacl-initials { width: 32px; height: 32px; font-size: 13px; }
.pacl-topbar__toggle .pacl-icon { width: 16px; height: 16px; color: var(--pacl-muted); }
.pacl-topbar__menu {
	list-style: none; margin: 0; padding: 8px; position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
	min-width: 220px; background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: 12px;
	box-shadow: 0 12px 28px rgba(26, 21, 18, .16);
}
.pacl-topbar__who {
	margin: 0 0 4px; padding: 8px 12px; font-weight: 700;
	border-bottom: 1px solid var(--pacl-line);
}
.pacl-topbar__menu li:not(.pacl-topbar__who) { margin: 0; }
.pacl-topbar__menu a {
	display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px;
	color: var(--pacl-ink); text-decoration: none;
}
.pacl-topbar__menu a:hover, .pacl-topbar__menu a:focus-visible { background: var(--pacl-tint); }
.pacl-topbar__theme {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	margin: 4px 0 0; padding: 8px 12px 4px; border-top: 1px solid var(--pacl-line);
}
.pacl-topbar__theme-label { font-size: 13px; color: var(--pacl-muted); }
/* Same segmented-control look as .pacl-dash-view (the dashboard's grid/list
 * toggle) — kept as its own class since it lives in a different context,
 * but the two should stay visually consistent if either changes. */
.pacl-theme-toggle { display: flex; gap: 4px; border: 1px solid var(--pacl-line); border-radius: 9px; padding: 3px; }
.pacl-theme-toggle__btn {
	display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
	background: transparent; border: 0; border-radius: 6px; color: var(--pacl-muted); cursor: pointer;
}
.pacl-theme-toggle__btn:hover { background: var(--pacl-tint); }
.pacl-theme-toggle__btn.is-active { background: var(--pacl-bg-2); color: var(--pacl-ink); }
.pacl-theme-toggle__btn .pacl-icon { width: 15px; height: 15px; }

/* Course page -------------------------------------------------------- */
.pacl-course-top { display: grid; gap: 20px; margin: 0 0 32px; }
.pacl-facts {
	display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0; padding: 0;
}
.pacl-facts div { margin: 0; }
.pacl-facts dt { font: 600 12px/1.3 var(--pacl-font); letter-spacing: .07em; text-transform: uppercase; color: var(--pacl-muted); margin: 0; }
.pacl-facts dd { margin: 2px 0 0; font: 600 17px/1.3 var(--pacl-font); color: var(--pacl-ink); }

.pacl-enrol {
	background: var(--pacl-bg); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card);
	padding: 22px 24px; scroll-margin-top: 90px;
}
.pacl-enrol__status { margin: 0 0 14px; font-size: 16px; line-height: 1.5; color: var(--pacl-body); }
.pacl-enrol__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.pacl-enrol__form .pacl-enrol__status { flex-basis: 100%; margin: 0; }
.pacl-enrol__form > .pacl-field { flex: 1 1 220px; max-width: 320px; }
.pacl-enrol p:last-child { margin-bottom: 0; }
.pacl-code { flex-basis: 100%; font-size: 14px; }
.pacl-code summary { cursor: pointer; color: var(--pacl-gold-deep); width: max-content; }
.pacl-code .pacl-field { margin-top: 10px; max-width: 320px; }
.pacl-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.pacl-course-bottom { display: grid; gap: 40px; margin: 40px 0 0; }

/* Course banner -------------------------------------------------------
 * Cover image with a scrim for legible text, category pill, title,
 * instructor row and (once actively enrolled) an inline progress bar
 * with a Start/Resume/Review button. See PACL_Frontend::course_banner().
 */
.pacl-course-banner {
	position: relative; margin: 0 0 28px; border-radius: var(--pacl-radius-card); overflow: hidden;
	background-color: var(--pacl-bg-2); background-size: cover; background-position: center;
	color: #fff;
}
.pacl-course-banner--plain { background: var(--pacl-kente); background-size: 200% 100%; }
.pacl-course-banner__scrim {
	padding: 28px 28px 24px;
	background: linear-gradient(180deg, rgba(26,21,18,.15) 0%, rgba(26,21,18,.72) 100%);
}
.pacl-course-banner--plain .pacl-course-banner__scrim { background: rgba(26,21,18,.42); }
.pacl-course-banner__cat {
	background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(2px);
}
.pacl-course-banner__title {
	margin: 12px 0 14px; font: 800 clamp(24px, 3.4vw, 34px)/1.15 var(--pacl-font); letter-spacing: -.02em; color: #fff;
}
.pacl-course-banner__people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 22px; }
.pacl-course-banner__people li { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; }
.pacl-course-banner__people .pacl-avatar, .pacl-course-banner__people .pacl-initials { width: 26px; height: 26px; font-size: 11px; }
.pacl-course-banner__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 18px; }
.pacl-course-banner__foot .pacl-progress { flex: 1 1 220px; max-width: 360px; margin: 0; }
.pacl-course-banner__foot .pacl-progress__track { background: rgba(255,255,255,.28); }
.pacl-course-banner__foot .pacl-progress__text { color: rgba(255,255,255,.85); }
.pacl-course-banner__cta { flex: none; }

/* Course menu sidebar --------------------------------------------------
 * Persistent left-hand outline: collapsible modules, native <details>
 * so it needs no JS beyond the existing [data-pacl-sidebar] mobile
 * collapse in frontend.js. See PACL_Frontend::course_menu().
 */
.pacl-course-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 40px; align-items: start; }
.pacl-course-main { min-width: 0; }
.pacl-coursemenu {
	background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card);
	position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto;
}
.pacl-coursemenu > summary {
	display: none; list-style: none; cursor: pointer; align-items: center; gap: 8px;
	font: 600 15px/1.2 var(--pacl-font); padding: 14px 16px;
}
.pacl-coursemenu > summary::-webkit-details-marker { display: none; }
.pacl-coursemenu__body { padding: 6px 0 10px; }
.pacl-coursemenu__section { border-top: 1px solid var(--pacl-line); }
.pacl-coursemenu__section:first-child { border-top: 0; }
.pacl-coursemenu__section > summary {
	display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
	padding: 12px 16px; font: 700 13px/1.3 var(--pacl-font); color: var(--pacl-ink);
}
.pacl-coursemenu__section > summary::-webkit-details-marker { display: none; }
.pacl-coursemenu__section > summary::before { content: "\2212"; color: var(--pacl-muted); width: 1em; flex: none; }
.pacl-coursemenu__section:not([open]) > summary::before { content: "+"; }
.pacl-coursemenu__section ul { list-style: none; margin: 0; padding: 0 10px 10px; }
.pacl-coursemenu__section p { margin: 0; padding: 0 16px 10px; }
.pacl-coursemenu__section li {
	display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 6px; border-radius: 8px; font-size: 14px;
}
.pacl-coursemenu__section li .pacl-icon { color: var(--pacl-muted); flex: none; width: 16px; height: 16px; }
.pacl-coursemenu__section li.is-done .pacl-icon { color: var(--pacl-success); }
.pacl-coursemenu__section li.is-open .pacl-icon { color: var(--pacl-accent); }
.pacl-coursemenu__section li.is-locked { color: var(--pacl-muted); }
.pacl-coursemenu__section li a { color: var(--pacl-ink); text-decoration: none; }
.pacl-coursemenu__section li a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
	.pacl-course-layout { grid-template-columns: 1fr; gap: 20px; }
	.pacl-coursemenu { position: static; max-height: none; }
	.pacl-coursemenu > summary { display: flex; }
	.pacl-coursemenu[open] > summary { border-bottom: 1px solid var(--pacl-line); }
}

/* Outline ------------------------------------------------------------ */
.pacl-outline__title { margin: 0 0 16px; }
.pacl-outline__module { margin: 0 0 22px; }
.pacl-outline__module h3 {
	margin: 0 0 8px; font: 600 12px/1.3 var(--pacl-font);
	letter-spacing: .09em; text-transform: uppercase; color: var(--pacl-highlight);
}
.pacl-outline ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pacl-line); }
.pacl-outline__item {
	display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; align-items: baseline;
	padding: 12px 4px; border-bottom: 1px solid var(--pacl-line); margin: 0;
}
.pacl-outline__icon { color: var(--pacl-muted); display: inline-flex; }
.pacl-outline__item.is-done .pacl-outline__icon { color: var(--pacl-success); }
.pacl-outline__item.is-open .pacl-outline__icon { color: var(--pacl-accent); }
.pacl-outline__item a { color: var(--pacl-ink); text-decoration: none; font-weight: 500; }
.pacl-outline__item a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pacl-outline__item.is-locked .pacl-outline__name { color: var(--pacl-muted); }
.pacl-outline__item.is-current { background: var(--pacl-tint); border-radius: 8px; }
.pacl-outline__item.is-current a { font-weight: 700; }
.pacl-outline__meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--pacl-muted); }

/* Instructors -------------------------------------------------------- */
.pacl-instructors h2 { margin: 0 0 16px; }
.pacl-instructors ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.pacl-instructors li { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.pacl-instructors p { margin: 4px 0 0; font-size: 15px; line-height: 1.6; color: var(--pacl-body); }
.pacl-initials {
	flex: none; width: 48px; height: 48px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--pacl-gold); color: #2A1F05; font: 700 16px/1 var(--pacl-font);
}

/* Cards and grids ---------------------------------------------------- */
.pacl-grid {
	display: grid; gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, max(240px, calc((100% - (var(--pacl-cols, 3) - 1) * 20px) / var(--pacl-cols, 3)))), 1fr));
}
.pacl-card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card);
}
.pacl-card__media { display: block; aspect-ratio: 16 / 9; background: var(--pacl-bg-2); overflow: hidden; }
.pacl-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pacl-card__media--plain { display: flex; align-items: flex-end; aspect-ratio: auto; height: 56px; }
.pacl-card__media--plain .pacl-kente { width: 100%; }
.pacl-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.pacl-card__body .pacl-pill { align-self: flex-start; }
.pacl-card__title { margin: 0; font: 700 19px/1.3 var(--pacl-font); letter-spacing: -.01em; }
.pacl-card__title a { color: var(--pacl-ink); text-decoration: none; }
.pacl-card:hover .pacl-card__title a { text-decoration: underline; text-underline-offset: 3px; }
.pacl-card__excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--pacl-body); }
.pacl-card__meta { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--pacl-muted); }
.pacl-card__meta li { margin: 0; }
.pacl-card .pacl-progress { margin: 4px 0 0; }
.pacl.pacl-single-card { max-width: 420px; }

/* Catalogue ---------------------------------------------------------- */
.pacl-filters {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
	padding: 18px 20px; margin: 0 0 20px;
	background: var(--pacl-bg); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card);
}
.pacl-filters .pacl-field { flex: 1 1 180px; }
.pacl-filters .pacl-check { padding-bottom: 12px; }
.pacl-count { margin: 0 0 14px; font-size: 14px; }
.pacl-empty { padding: 32px 24px; text-align: center; background: var(--pacl-bg); border-radius: var(--pacl-radius-card); }
.pacl-empty p { margin: 0 0 14px; }
.pacl-empty p:last-child { margin: 0; }
.pacl-pages { display: flex; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pacl-pages a, .pacl-pages span {
	min-width: 40px; padding: 9px 12px; text-align: center; border-radius: 8px;
	border: 1px solid var(--pacl-line); text-decoration: none; color: var(--pacl-ink);
}
.pacl-pages span[aria-current] { background: var(--pacl-ink); color: var(--pacl-bg); border-color: var(--pacl-ink); }

/* Dashboard ---------------------------------------------------------- */
.pacl-dash-section { margin: 0 0 32px; }
.pacl-dash-section h2 { margin: 0 0 12px; }
.pacl-dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pacl-dash-item {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	margin: 0; padding: 18px 20px; background: var(--pacl-paper);
	border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card);
}
.pacl-dash-item__text { flex: 1 1 260px; min-width: 0; }
.pacl-dash-item h3 { margin: 0; font: 700 18px/1.3 var(--pacl-font); }
.pacl-dash-item h3 a { color: var(--pacl-ink); text-decoration: none; }
.pacl-dash-item p { margin: 4px 0 0; font-size: 14px; }
.pacl-dash-item .pacl-progress { margin: 10px 0 0; max-width: 420px; }

.pacl-dash-head { margin: 0 0 20px; }
.pacl-dash-head h1 { margin: 0; font: 800 clamp(24px, 3.2vw, 32px)/1.2 var(--pacl-font); letter-spacing: -.02em; }

/* Toolbar: tabs, search, sort and the grid/list toggle. Everything below
 * is rendered once, server-side, in full; frontend.js only shows, hides
 * and reorders the cards already in the markup — no reload, no extra
 * requests, and it degrades to "every course, in one order" with JS off. */
/* Every control here needs frontend.js to do anything (the tab buttons
 * aren't links, the search field has no name to submit) — hidden without
 * JS, same as .pacl-js-only elsewhere, so learners get a plain, complete
 * card grid instead of dead controls. */
.pacl-dash-toolbar { display: none; }
.pacl-js .pacl-dash-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
	margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--pacl-line);
}
.pacl-dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.pacl-dash-tab {
	font: 600 14px/1.2 var(--pacl-font); color: var(--pacl-muted); background: transparent;
	border: 1px solid transparent; border-radius: 20px; padding: 8px 14px; cursor: pointer;
}
.pacl-dash-tab:hover { background: var(--pacl-tint); }
.pacl-dash-tab.is-active { color: var(--pacl-ink); background: var(--pacl-bg-2); border-color: var(--pacl-line); }
.pacl-dash-tab__count { color: var(--pacl-muted); }
.pacl-dash-tab.is-active .pacl-dash-tab__count { color: inherit; }
.pacl-dash-search { flex: 0 1 220px; }
.pacl-dash-search input { padding: 9px 13px; }
.pacl-dash-sort select { padding: 9px 30px 9px 13px; }
.pacl-dash-view { display: flex; gap: 4px; border: 1px solid var(--pacl-line); border-radius: 9px; padding: 3px; }
.pacl-dash-view__btn {
	display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
	background: transparent; border: 0; border-radius: 6px; color: var(--pacl-muted); cursor: pointer;
}
.pacl-dash-view__btn:hover { background: var(--pacl-tint); }
.pacl-dash-view__btn.is-active { background: var(--pacl-bg-2); color: var(--pacl-ink); }

/* Card grid: reuses .pacl-card/.pacl-grid's look with a category badge
 * overlay, an activities-completed line, and a pinned action button. */
.pacl-dash-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pacl-dash-card { position: relative; }
.pacl-dash-card[hidden] { display: none; }
.pacl-dash-card__badge {
	position: absolute; top: 14px; left: 14px; z-index: 1;
	font: 700 11px/1 var(--pacl-font); letter-spacing: .04em; text-transform: uppercase;
	padding: 6px 10px; border-radius: 6px; background: var(--pacl-ink); color: var(--pacl-bg);
}
.pacl-dash-card__count { margin: 0; font-size: 13px; color: var(--pacl-muted); }
.pacl-dash-card .pacl-progress { margin: 2px 0 0; }
.pacl-dash-card__btn { margin-top: auto; align-self: flex-start; }

/* List view: same markup, restyled as rows (mirrors .pacl-dash-item). */
.pacl-dash-grid.is-list { grid-template-columns: 1fr; gap: 10px; }
.pacl-dash-grid.is-list .pacl-dash-card { flex-direction: row; align-items: center; }
.pacl-dash-grid.is-list .pacl-card__media { flex: none; width: 120px; aspect-ratio: 16 / 9; }
.pacl-dash-grid.is-list .pacl-dash-card__badge { display: none; }
.pacl-dash-grid.is-list .pacl-card__body { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 14px 18px; }
.pacl-dash-grid.is-list .pacl-card__title { flex: 1 1 200px; }
.pacl-dash-grid.is-list .pacl-dash-card__count { display: none; }
.pacl-dash-grid.is-list .pacl-progress { flex: 1 1 180px; max-width: 240px; margin: 0; }
.pacl-dash-grid.is-list .pacl-dash-card__btn { margin: 0; }
@media (max-width: 640px) {
	.pacl-dash-grid.is-list .pacl-card__media { display: none; }
	.pacl-dash-grid.is-list .pacl-card__body { flex-direction: column; align-items: flex-start; }
}
.pacl-dash-nomatch[hidden] { display: none; }

/* Lessons (shared) --------------------------------------------------- */
.pacl-breadcrumb { margin: 0 0 8px; font-size: 14px; color: var(--pacl-muted); }
.pacl-breadcrumb a { color: var(--pacl-gold-deep); }
.pacl-lesson-duration { display: inline-flex; align-items: center; gap: .4em; margin: 0 0 20px; font-size: 14px; color: var(--pacl-muted); }
.pacl-locked {
	display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px;
	background: var(--pacl-bg); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card);
}
.pacl-locked .pacl-icon { width: 24px; height: 24px; color: var(--pacl-gold-deep); }
.pacl-locked p { margin: 0; font-size: 16px; line-height: 1.6; }
.pacl-locked a { color: var(--pacl-gold-deep); }

.pacl-lesson-footer {
	display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
	margin: 40px 0 0; padding: 24px 0 0; border-top: 1px solid var(--pacl-line);
}
.pacl-lesson-footer__main { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pacl-lesson-footer__main form { margin: 0; }
.pacl-lesson-footer__next { justify-self: end; }
.pacl-print-hint { margin: 20px 0 0; font-size: 14px; text-align: center; }
.pacl-js-only { display: none; }
.pacl-js .pacl-js-only { display: block; }

/* Videos ------------------------------------------------------------- */
.pacl-video {
	/* Intentionally not var(--pacl-ink): this is a fixed "video screen" backdrop,
	 * not page chrome, so it stays dark in both light and dark mode. */
	position: relative; aspect-ratio: 16 / 9; margin: 0 0 24px;
	background: #1A1512; color: #EFE6D2; border-radius: var(--pacl-radius-card); overflow: hidden;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center;
}
.pacl-video__play {
	display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
	font: 600 16px/1 var(--pacl-font); padding: 14px 22px; border-radius: var(--pacl-radius-btn);
	background: var(--pacl-gold); color: #2A1F05; border: 0;
}
.pacl-video__play .pacl-icon { fill: currentColor; }
.pacl-video__play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pacl-video__title { margin: 0; font-weight: 600; font-size: 15px; }
.pacl-video__note { margin: 0; font-size: 13px; color: #A99E8E; }
.pacl-video__note a { color: #EFE6D2; }
.pacl-video.is-playing { padding: 0; display: block; }
.pacl-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Focus mode --------------------------------------------------------- */
body.pacl-focus-body { margin: 0; background: var(--pacl-bg, #FBF5EA); }
.pacl-focus {
	min-height: 100vh; background: var(--pacl-bg); color: var(--pacl-ink);
	font-family: var(--pacl-font);
	-webkit-font-smoothing: antialiased;
}
.pacl-skip {
	position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
	background: var(--pacl-ink); color: var(--pacl-bg); border-radius: 8px;
}
.pacl-skip:focus { top: 12px; }
.pacl-focus__bar { position: sticky; top: 0; z-index: 50; background: var(--pacl-paper); }
.admin-bar .pacl-focus__bar { top: 32px; }
@media (max-width: 782px) { .admin-bar .pacl-focus__bar { top: 0; position: relative; } }
.pacl-focus__bar-inner {
	display: flex; align-items: center; justify-content: space-between; gap: 20px;
	max-width: 1200px; margin: 0 auto; padding: 12px 24px; min-height: 60px;
}
.pacl-focus__course {
	display: inline-flex; align-items: center; gap: 10px; min-width: 0;
	font: 700 16px/1.3 var(--pacl-font); color: var(--pacl-ink); text-decoration: none;
}
.pacl-focus__course span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pacl-focus__course:hover span { text-decoration: underline; text-underline-offset: 3px; }
.pacl-focus__progress { flex: 0 1 280px; }
.pacl-focus__progress .pacl-progress { margin: 0; }
.pacl-focus__progress .pacl-progress__text { text-align: right; }

.pacl-focus__layout {
	display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 48px;
	max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px;
}
/* --pacl-bar-h is set by frontend.js from the real rendered height of
 * .pacl-focus__bar (it can grow at high text zoom or with long translated
 * headings), so these sticky offsets always sit just below it instead of
 * assuming the bar's default ~60px height. The fallback values match the
 * previous hardcoded pixel numbers for no-JS. */
.pacl-focus__sidebar { align-self: start; position: sticky; top: calc(var(--pacl-bar-h, 60px) + 40px); max-height: calc(100vh - var(--pacl-bar-h, 60px) - 60px); overflow: auto; }
.admin-bar .pacl-focus__sidebar { top: calc(var(--pacl-bar-h, 60px) + 72px); }
.pacl-focus__sidebar > summary {
	display: none; list-style: none; cursor: pointer; align-items: center; gap: 8px;
	font: 600 15px/1.2 var(--pacl-font); padding: 12px 14px;
	background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: 9px;
}
.pacl-focus__sidebar > summary::-webkit-details-marker { display: none; }
.pacl-focus__sidebar .pacl-outline__item { padding: 10px 6px; font-size: 14px; }
.pacl-focus__main { min-width: 0; }
.pacl-lesson { max-width: 720px; }
.pacl-lesson__title { margin: 0 0 10px; font: 800 clamp(28px, 4.6vw, 42px)/1.1 var(--pacl-font); letter-spacing: -.025em; color: var(--pacl-ink); }
.pacl-focus .pacl-lesson-body { font-size: 17px; line-height: 1.75; color: var(--pacl-body); }
.pacl-focus .pacl-lesson-body > * { margin-top: 0; margin-bottom: 1.1em; }
.pacl-focus .pacl-lesson-body h2 { font: 700 26px/1.25 var(--pacl-font); letter-spacing: -.01em; color: var(--pacl-ink); margin: 1.6em 0 .5em; }
.pacl-focus .pacl-lesson-body h3 { font: 600 20px/1.3 var(--pacl-font); color: var(--pacl-ink); margin: 1.4em 0 .4em; }
.pacl-focus .pacl-lesson-body a { color: var(--pacl-gold-deep); text-underline-offset: 3px; }
.pacl-focus .pacl-lesson-body img { max-width: 100%; height: auto; border-radius: 10px; }
.pacl-focus .pacl-lesson-body figure { margin-left: 0; margin-right: 0; }
.pacl-focus .pacl-lesson-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--pacl-gold); color: var(--pacl-ink); }
.pacl-focus .pacl-lesson-body pre, .pacl-focus .pacl-lesson-body code { font-size: .9em; background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: 6px; }
.pacl-focus .pacl-lesson-body pre { padding: 14px; overflow: auto; }
.pacl-focus .pacl-lesson-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.pacl-focus .pacl-lesson-body th, .pacl-focus .pacl-lesson-body td { border: 1px solid var(--pacl-line); padding: 8px 10px; text-align: left; }
.pacl-focus .pacl-lesson-body .wp-block-embed__wrapper { position: relative; }

@media (max-width: 900px) {
	.pacl-focus__layout { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
	.pacl-focus__sidebar { position: static; max-height: none; }
	.pacl-focus__sidebar > summary { display: flex; }
	.pacl-focus__sidebar[open] > summary { margin-bottom: 12px; }
	.pacl-focus__progress { flex-basis: 160px; }
	.pacl-lesson-footer { grid-template-columns: 1fr 1fr; }
	.pacl-lesson-footer__main { grid-column: 1 / -1; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.pacl-btn { transition: none; }
}

/* Print / save as PDF ------------------------------------------------ */
@media print {
	.pacl-focus__bar, .pacl-focus__sidebar, .pacl-lesson-footer, .pacl-print-hint, .pacl-skip, #wpadminbar { display: none !important; }
	.pacl-focus, body.pacl-focus-body { background: #fff !important; }
	.pacl-focus__layout { display: block; padding: 0; max-width: none; }
	.pacl-lesson { max-width: none; }
	.pacl-focus .pacl-lesson-body { font-size: 12pt; color: #000; }
	.pacl-video { aspect-ratio: auto; background: none; color: #000; border: 1px solid #999; padding: 12px; }
	.pacl-video__play { display: none; }
	.pacl-video__note, .pacl-video__note a { color: #000; }
	.pacl-video__note a::after { content: " (" attr(href) ")"; }
}

/* ===================================================================
 * Phase 2: quizzes, assignments, capstones
 * =================================================================== */
.pacl-small { font-size: 13px; }
.pacl-pill--ok { background: #EAF4ED; color: #1F5A31; }
.pacl-pill--no { background: #FDF0EE; color: #8E241B; }
.pacl-pill--quiz, .pacl-pill--assignment, .pacl-pill--capstone { background: var(--pacl-bg-2); color: var(--pacl-ink); }

.pacl-quiz, .pacl-work { margin: 32px 0 0; padding: 24px 0 0; border-top: 1px solid var(--pacl-line); display: grid; gap: 18px; }
.pacl-quiz > *, .pacl-work > * { margin-top: 0; margin-bottom: 0; }
.pacl-attempts summary, .pacl-sub > summary, .pacl-hint summary { cursor: pointer; }
.pacl-attempts ol { margin: 8px 0 0 1.2em; padding: 0; }

.pacl-question {
	margin: 0 0 18px; padding: 20px 22px; border: 1px solid var(--pacl-line);
	border-radius: var(--pacl-radius-card); background: var(--pacl-paper); min-width: 0;
}
.pacl-question__num { margin: 0 0 8px; padding: 0; font: 600 13px/1.3 var(--pacl-font); letter-spacing: .04em; color: var(--pacl-highlight); }
.pacl-question__prompt { margin: 0 0 14px; font-size: 17px; line-height: 1.6; color: var(--pacl-ink); }
.pacl-question__prompt p { margin: 0 0 .6em; }
.pacl-question--right { border-left: 4px solid var(--pacl-success); }
.pacl-question--wrong { border-left: 4px solid var(--pacl-highlight); }
.pacl-question--part { border-left: 4px solid var(--pacl-gold); }
.pacl-question--pending { border-left: 4px solid var(--pacl-muted); }
.pacl-verdict { color: var(--pacl-muted); font-weight: 500; letter-spacing: 0; }
.pacl-choices { display: grid; gap: 8px; }
.pacl-choices--inline { display: flex; flex-wrap: wrap; gap: 8px; }
.pacl-choice {
	display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; cursor: pointer;
	border: 1px solid var(--pacl-line); border-radius: 9px; background: var(--pacl-bg); line-height: 1.45;
}
.pacl-choice input { margin-top: 3px; accent-color: var(--pacl-accent); flex: none; }
.pacl-choice:has(input:checked) { border-color: var(--pacl-accent); background: var(--pacl-tint); }
.pacl-choice:has(input:disabled) { cursor: default; }
.pacl-input, .pacl-textarea, .pacl-match select, .pacl-order select {
	font: 400 16px/1.4 var(--pacl-font); color: var(--pacl-ink); background: var(--pacl-paper);
	padding: 10px 12px; border: 1px solid var(--pacl-line); border-radius: 8px; max-width: 100%;
}
.pacl-textarea { width: 100%; display: block; }
.pacl-input:focus, .pacl-textarea:focus, .pacl-match select:focus, .pacl-order select:focus { outline: none; border-color: var(--pacl-accent); box-shadow: 0 0 0 3px rgba(232, 119, 34, .18); }
.pacl-blank { width: 11em; padding: 4px 8px; margin: 0 2px; }
.pacl-fill { line-height: 2.3; margin: 0; }
.pacl-match { display: grid; gap: 10px; }
.pacl-match__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; }
.pacl-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pacl-order__row { display: flex; gap: 12px; align-items: center; margin: 0; }
.pacl-hint { margin-top: 12px; font-size: 14px; color: var(--pacl-gold-deep); }
.pacl-hint p { margin: 6px 0 0; color: var(--pacl-body); }
.pacl-answer, .pacl-explain { margin: 12px 0 0; font-size: 15px; line-height: 1.55; }
.pacl-explain { color: var(--pacl-body); padding: 10px 14px; background: var(--pacl-bg); border-radius: 8px; }
/* Same --pacl-bar-h technique as .pacl-focus__sidebar above: sits just below
 * the actual rendered height of .pacl-focus__bar rather than an assumed one. */
.pacl-timer {
	position: sticky; top: calc(var(--pacl-bar-h, 60px) + 12px); z-index: 5; display: inline-flex; align-items: center; gap: 8px;
	margin: 0 0 16px; padding: 10px 14px; border-radius: 9px; background: var(--pacl-ink); color: var(--pacl-bg); font-size: 15px;
}
.admin-bar .pacl-timer { top: calc(var(--pacl-bar-h, 60px) + 44px); }
.pacl-timer.is-low { background: var(--pacl-highlight); }
.pacl-quiz__submit { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pacl-result { padding: 20px 22px; background: var(--pacl-bg); border-radius: var(--pacl-radius-card); border: 1px solid var(--pacl-line); }
.pacl-result__score { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; }
.pacl-result__score strong { font: 800 34px/1 var(--pacl-font); letter-spacing: -.02em; }

.pacl-sub { border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card); background: var(--pacl-paper); }
.pacl-sub > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px; font-weight: 600; list-style: none; }
.pacl-sub > summary::-webkit-details-marker { display: none; }
.pacl-sub > summary::before { content: "+"; width: 1em; color: var(--pacl-muted); }
.pacl-sub[open] > summary::before { content: "−"; }
.pacl-sub__body { padding: 0 18px 18px; }
.pacl-sub__title { margin: 0 0 8px; font: 700 18px/1.3 var(--pacl-font); }
.pacl-sub__text { font-size: 15px; line-height: 1.65; color: var(--pacl-body); }
.pacl-files { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.pacl-files a { color: var(--pacl-gold-deep); }
.pacl-files audio, .pacl-files video { max-width: 100%; margin-bottom: 4px; }
.pacl-ai { margin-top: 12px; padding: 10px 14px; font-size: 14px; background: var(--pacl-bg); border-radius: 8px; }
.pacl-feedback { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--pacl-line); }
.pacl-feedback h4 { margin: 0 0 8px; }
.pacl-feedback__item { margin: 0 0 14px; }
.pacl-feedback__who { margin: 0 0 6px; font: 600 12px/1.3 var(--pacl-font); letter-spacing: .07em; text-transform: uppercase; color: var(--pacl-muted); }
.pacl-feedback__text { font-size: 15px; line-height: 1.6; }
.pacl-rubric-result { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 10px; }
.pacl-rubric-result th, .pacl-rubric-result td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--pacl-line); }
.pacl-num { text-align: right !important; white-space: nowrap; }

.pacl-form { display: grid; gap: 16px; padding: 20px 22px; background: var(--pacl-bg); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card); }
.pacl-form > p { margin: 0; }
.pacl-form__lead { font-weight: 700; }
.pacl-form .pacl-field input[type="file"] { padding: 8px; background: var(--pacl-paper); }
.pacl-ai-form { margin: 0; padding: 14px 16px; border: 1px solid var(--pacl-line); border-radius: 10px; background: var(--pacl-paper); display: grid; gap: 10px; min-width: 0; }
.pacl-ai-form legend { font-weight: 700; padding: 0 4px; }
.pacl-ai-form p { margin: 0; }
.pacl-ai-form__more { display: grid; gap: 10px; }

.pacl-rubric { display: grid; gap: 14px; }
.pacl-rubric__row { margin: 0; padding: 0; border: 0; min-width: 0; }
.pacl-rubric__row legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.pacl-rubric__levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pacl-rubric__level { position: relative; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--pacl-line, #dcdcde); border-radius: 9px; cursor: pointer; background: var(--pacl-paper, #fff); }
.pacl-rubric__level input { position: absolute; opacity: 0; }
.pacl-rubric__level:has(input:checked) { border-color: var(--pacl-accent, #E87722); background: var(--pacl-tint, #FBEEDD); box-shadow: inset 0 0 0 1px var(--pacl-accent, #E87722); }
.pacl-rubric__level:has(input:focus-visible) { outline: 3px solid var(--pacl-accent, #E87722); outline-offset: 2px; }
.pacl-rubric__pts { font-weight: 800; font-size: 18px; }
.pacl-rubric__label { font-weight: 600; font-size: 14px; }
.pacl-rubric__desc { font-size: 13px; color: var(--pacl-muted, #6B6157); line-height: 1.4; }
.pacl-rubric__total { margin: 0; font-size: 15px; }

/* Capstone tracker */
.pacl-tracker { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; counter-reset: none; }
.pacl-tracker li { flex: 1 1 110px; position: relative; margin: 0; padding: 30px 6px 0; text-align: center; font-size: 13px; line-height: 1.3; color: var(--pacl-muted); }
.pacl-tracker li::before { content: ""; position: absolute; top: 11px; left: 0; right: 0; height: 2px; background: var(--pacl-line); }
.pacl-tracker li:first-child::before { left: 50%; }
.pacl-tracker li:last-child::before { right: 50%; }
.pacl-tracker__dot {
	position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%;
	background: var(--pacl-paper); border: 2px solid var(--pacl-line); display: flex; align-items: center; justify-content: center; z-index: 1;
}
.pacl-tracker__dot .pacl-icon { width: 14px; height: 14px; stroke-width: 2.6; }
.pacl-tracker li.is-done { color: var(--pacl-ink); }
.pacl-tracker li.is-done .pacl-tracker__dot { background: var(--pacl-success); border-color: var(--pacl-success); color: #fff; }
.pacl-tracker li.is-current { color: var(--pacl-ink); font-weight: 700; }
.pacl-tracker li.is-current .pacl-tracker__dot { border-color: var(--pacl-accent); box-shadow: 0 0 0 4px var(--pacl-tint); }
.pacl-tracker li.is-waiting .pacl-tracker__dot { border-color: var(--pacl-gold); background: var(--pacl-tint); }
.pacl-supervisor { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.pacl-stage { display: grid; gap: 12px; padding: 20px 0 0; border-top: 1px solid var(--pacl-line); }
.pacl-stage > * { margin: 0; }
.pacl-stage__title { font: 700 20px/1.3 var(--pacl-font); margin: 0; }
.pacl-stage--locked .pacl-stage__title { color: var(--pacl-muted); }
.pacl-peer { display: grid; gap: 10px; padding: 16px 18px; background: var(--pacl-bg); border-radius: var(--pacl-radius-card); }
.pacl-peer h4, .pacl-peer h5 { margin: 0; }
.pacl-showcase__card .pacl-card__body { padding-top: 20px; }

@media (max-width: 600px) {
	.pacl-match__row { grid-template-columns: 1fr; gap: 4px; }
	.pacl-tracker li { flex-basis: 33%; margin-bottom: 12px; }
	.pacl-tracker li::before { display: none; }
}
@media print {
	.pacl-quiz__start, .pacl-form, .pacl-timer { display: none !important; }
}
.pacl-focus .pacl-lesson-body .pacl-rubric-result { display: table; }
.pacl-focus .pacl-lesson-body .pacl-rubric-result th, .pacl-focus .pacl-lesson-body .pacl-rubric-result td { border: 0; border-bottom: 1px solid var(--pacl-line); }

/* ===================================================================
 * Phase 3: credentials, live sessions, programmes, transcript
 * =================================================================== */
.pacl-cred { max-width: 1000px; margin: 0 auto; padding: 36px 24px 80px; display: grid; gap: 28px; }
.pacl-verify { display: flex; gap: 16px; align-items: flex-start; padding: 18px 22px; border-radius: var(--pacl-radius-card); border: 1px solid; }
.pacl-verify p { margin: 0; line-height: 1.5; }
.pacl-verify__state { font: 800 20px/1.2 var(--pacl-font); margin-bottom: 4px !important; }
.pacl-verify__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.pacl-verify__icon .pacl-icon { width: 22px; height: 22px; stroke-width: 2.6; }
.pacl-verify--valid { background: #F0F7F2; border-color: rgba(46,125,70,.35); color: #1F5A31; }
.pacl-verify--valid .pacl-verify__icon { background: var(--pacl-success); }
.pacl-verify--revoked, .pacl-verify--altered { background: #FDF0EE; border-color: rgba(210,58,46,.35); color: #8E241B; }
.pacl-verify--revoked .pacl-verify__icon, .pacl-verify--altered .pacl-verify__icon { background: var(--pacl-highlight); }
.pacl-cred__grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }
.pacl-cred__facts { display: grid; gap: 0; margin: 20px 0; border-top: 1px solid var(--pacl-line); }
.pacl-cred__facts div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--pacl-line); margin: 0; }
.pacl-cred__facts dt { color: var(--pacl-muted); font-size: 14px; margin: 0; }
.pacl-cred__facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pacl-cred__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.pacl-cred__side { display: grid; gap: 12px; justify-items: center; text-align: center; }
.pacl-cred__badge { width: 220px; height: 220px; }
.pacl-qr { width: 150px; height: 150px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--pacl-line); }
.pacl-qr svg { width: 100%; height: 100%; display: block; }
.pacl-code-inline { word-break: break-all; font-size: 13px; }
.pacl-cred__foot { margin: 0; }
@media (max-width: 760px) { .pacl-cred__grid { grid-template-columns: 1fr; } .pacl-cred__facts div { grid-template-columns: 1fr; gap: 2px; } }

/* Printable certificate (A4 landscape) */
.pacl-print-body { margin: 0; background: #e9e4da; font-family: var(--pacl-font, sans-serif); }
.pacl-printbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 16px; }
/*
 * .pacl-certificate is a fixed A4-landscape box (297mm) that will not fit a phone
 * viewport. frontend.js wraps it in .pacl-cert-wrap and computes --cert-scale from
 * the wrapper's actual width, so it shrinks to fit any screen with no clipping and
 * no leftover blank space. The .pacl-cert-wrap .pacl-certificate rule below always
 * wins over the max-width breakpoints further down (higher selector specificity),
 * so those breakpoints only matter when JavaScript is unavailable.
 */
.pacl-cert-wrap { width: 100%; max-width: 297mm; margin: 0 auto 32px; overflow: hidden; }
.pacl-certificate { width: 297mm; height: 210mm; margin: 0 auto 32px; background: var(--pacl-bg); display: flex; flex-direction: column; box-shadow: 0 6px 30px rgba(26,21,18,.18); overflow: hidden; }
.pacl-cert-wrap .pacl-certificate { margin: 0 auto; transform: scale(var(--cert-scale, 1)); transform-origin: top center; }
.pacl-certificate .pacl-kente { height: 10px; flex: none; }
.pacl-certificate__inner { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16mm 22mm 12mm; margin: 7mm; border: 1.5px solid rgba(160,100,20,.45); }
.pacl-certificate__logo { max-height: 22mm; max-width: 70mm; }
.pacl-certificate__issuer { font: 800 20px/1 var(--pacl-font); margin: 0; letter-spacing: .06em; text-transform: uppercase; }
.pacl-certificate .pacl-eyebrow { margin-top: 9mm; font-size: 14px; letter-spacing: .2em; }
.pacl-certificate__lead { margin: 4mm 0 0; color: var(--pacl-body); font-size: 16px; }
.pacl-certificate__name { margin: 3mm 0 0; font: 800 46px/1.1 var(--pacl-font); letter-spacing: -.02em; color: var(--pacl-ink); }
.pacl-certificate__title { margin: 3mm 0 0; font: 700 26px/1.25 var(--pacl-font); color: var(--pacl-ink); max-width: 210mm; }
.pacl-certificate__outcome, .pacl-certificate__cohort { margin: 3mm 0 0; font-size: 15px; color: var(--pacl-gold-deep); font-weight: 600; }
.pacl-certificate__foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12mm; align-items: end; text-align: left; }
.pacl-certificate__foot p { margin: 0; font-size: 12px; line-height: 1.4; }
.pacl-certificate__signame { font-size: 16px !important; font-weight: 700; padding-top: 3mm; border-top: 1px solid var(--pacl-ink); min-width: 55mm; }
.pacl-certificate__verify { display: flex; gap: 4mm; align-items: center; }
.pacl-certificate__verify .pacl-qr { width: 26mm; height: 26mm; padding: 1mm; }
@media print {
	.pacl-print-body { background: #fff; }
	.pacl-printbar { display: none !important; }
	.pacl-certificate { margin: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	/* Printing must always be full-size and unscaled, regardless of the on-screen
	 * fit-to-container scaling above (which sets inline styles via frontend.js). */
	.pacl-cert-wrap { width: auto !important; max-width: none !important; height: auto !important; overflow: visible !important; margin: 0 !important; }
	.pacl-cert-wrap .pacl-certificate { transform: none !important; }
}
/* No-JS fallback only: .pacl-cert-wrap .pacl-certificate above (added by frontend.js)
 * is more specific and wins whenever JavaScript has run, so these fixed breakpoints
 * are just a floor for JS-disabled visits. */
@media screen and (max-width: 1150px) { .pacl-certificate { transform: scale(.6); transform-origin: top center; margin-bottom: -80mm; } }
@media screen and (max-width: 480px) { .pacl-certificate { transform: scale(.32); transform-origin: top center; margin-bottom: -143mm; } }

/* Sessions */
.pacl-sessions h2 { margin: 0 0 12px; }
.pacl-session-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.pacl-session { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; margin: 0; padding: 16px 18px; background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card); }
.pacl-session.is-live { border-color: var(--pacl-accent); box-shadow: inset 4px 0 0 var(--pacl-accent); }
.pacl-session.is-past { background: var(--pacl-bg); }
.pacl-session__when { display: grid; gap: 2px; align-content: start; }
.pacl-session__when time { font-weight: 700; }
.pacl-session__title { margin: 0 0 6px; font-weight: 700; font-size: 17px; }
.pacl-session__notes { font-size: 14px; color: var(--pacl-body); }
.pacl-session__notes p { margin: 0 0 6px; }
.pacl-session .pacl-actions { align-items: center; margin-top: 8px; }
.pacl-pill--live { background: var(--pacl-accent); color: var(--pacl-on-accent); }
.pacl-checkin { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.pacl-checkin .pacl-field { flex: 0 1 220px; }
@media (max-width: 600px) { .pacl-session { grid-template-columns: 1fr; gap: 6px; } }

.pacl-credinfo h2 { margin: 0 0 8px; }
.pacl-credinfo p { margin: 0 0 8px; }
.pacl-reqs { margin: 6px 0 0 1.2em; color: var(--pacl-body); }

/* Programmes */
.pacl-path { display: grid; gap: 18px; margin-top: 24px; }
.pacl-path__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pacl-path__item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; margin: 0; align-items: start; }
.pacl-path__num { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--pacl-bg-2); color: var(--pacl-ink); }
.pacl-path__item.is-done .pacl-path__num { background: var(--pacl-success); color: #fff; }
.pacl-path__item.is-progress .pacl-path__num { background: var(--pacl-accent); color: var(--pacl-on-accent); }
.pacl-path__item .pacl-card { flex-direction: row; }
.pacl-path__item .pacl-card__media { width: 30%; aspect-ratio: auto; min-height: 100%; }
.pacl-path__item .pacl-card__media--plain { height: auto; }
.pacl-path__item p { margin: 6px 0 0; }

/* Transcript */
.pacl-transcript { display: grid; gap: 8px; }
.pacl-transcript__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--pacl-line); margin-bottom: 16px; }
.pacl-transcript__head p { margin: 0; }
.pacl-transcript__name { font: 800 30px/1.15 var(--pacl-font); letter-spacing: -.02em; }
.pacl-cred-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pacl-cred-item { display: flex; gap: 14px; align-items: center; margin: 0; padding: 14px 16px; background: var(--pacl-paper); border: 1px solid var(--pacl-line); border-radius: var(--pacl-radius-card); }
.pacl-cred-item.is-revoked { opacity: .6; }
.pacl-cred-item img { flex: none; }
.pacl-cred-item__icon { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--pacl-tint); color: var(--pacl-gold-deep); display: flex; align-items: center; justify-content: center; }
.pacl-cred-item__title { margin: 0; font-weight: 700; }
.pacl-cred-item__title a { color: var(--pacl-ink); text-decoration: none; }
.pacl-cred-item p { margin: 0; }
.pacl-transcript__course { padding: 14px 0; border-bottom: 1px solid var(--pacl-line); }
.pacl-transcript__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.pacl-transcript__row h3 { margin: 0; font: 700 17px/1.3 var(--pacl-font); }
.pacl-transcript__row h3 a { color: var(--pacl-ink); text-decoration: none; }
.pacl-transcript__row p { margin: 0; }
.pacl-dash-foot { margin: 8px 0 0; }
@media print { .pacl-noprint, .pacl-transcript [data-pacl-print] { display: none !important; } }

/* ===================================================================
 * Phase 4: applications, surveys, announcements, profiles
 * =================================================================== */
.pacl-application { flex-basis: 100%; display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--pacl-line); border-radius: 10px; background: var(--pacl-paper); min-width: 0; }
.pacl-application legend { font-weight: 700; padding: 0 4px; }
.pacl-application .pacl-textarea, .pacl-application select { width: 100%; }
.pacl-enrol__form .pacl-application .pacl-field { max-width: none; }

.pacl-feedback-form h2 { margin: 0 0 6px; }
.pacl-scale { margin: 0; padding: 0; border: 0; min-width: 0; }
.pacl-scale legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.pacl-scale__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pacl-scale__opt { position: relative; }
.pacl-scale__opt input { position: absolute; opacity: 0; }
.pacl-scale__opt span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--pacl-line); border-radius: 9px; background: var(--pacl-paper); cursor: pointer; font-weight: 600; }
.pacl-scale__opt input:checked + span { background: var(--pacl-accent); border-color: var(--pacl-accent); color: var(--pacl-on-accent); }
.pacl-scale__opt input:focus-visible + span { outline: 3px solid var(--pacl-accent); outline-offset: 2px; }
.pacl-scale__ends { display: flex; justify-content: space-between; max-width: 520px; margin: 4px 0 0; }

.pacl-announcements ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pacl-announcements h2 { margin: 0 0 12px; }
.pacl-announcement { margin: 0; padding: 16px 18px; background: var(--pacl-tint); border-radius: var(--pacl-radius-card); border-left: 4px solid var(--pacl-gold); }
.pacl-announcement__meta { margin: 0 0 4px; }
.pacl-announcement__title { margin: 0 0 6px; font: 700 17px/1.3 var(--pacl-font); }
.pacl-announcement__text { font-size: 15px; line-height: 1.6; color: var(--pacl-body); }
.pacl-announcement__text p { margin: 0 0 8px; }

.pacl-avatar { border-radius: 50%; object-fit: cover; flex: none; }
.pacl-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; }
.pacl-person { margin: 0; display: grid; justify-items: center; text-align: center; gap: 6px; }
.pacl-person a { display: grid; justify-items: center; gap: 10px; color: var(--pacl-ink); text-decoration: none; font-weight: 700; }
.pacl-person .pacl-initials { font-size: 22px; }
.pacl-profile { display: grid; gap: 20px; }
.pacl-profile__head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.pacl-profile__head p { margin: 0 0 4px; }
.pacl-profile__head .pacl-initials { font-size: 36px; }
.pacl-profile__headline { font: 700 20px/1.3 var(--pacl-font); }
.pacl-profile__bio { font-size: 16px; line-height: 1.7; color: var(--pacl-body); }
.pacl-instructors a { color: var(--pacl-ink); }

/* Payments */
.pacl-pay { display: grid; gap: 14px; }
.pacl-pay > * { margin: 0; }
.pacl-pay__prices { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pacl-pay__prices legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.pacl-pay__prices .pacl-choice { font-size: 17px; }
.pacl-pay__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.pacl-pay .pacl-field { max-width: 320px; }
.pacl-receipt { width: 190mm; max-width: 100%; margin: 0 auto 32px; background: var(--pacl-paper); box-shadow: 0 6px 30px rgba(26,21,18,.12); }
.pacl-receipt .pacl-kente { height: 8px; }
.pacl-receipt__inner { padding: 14mm 16mm; }
.pacl-receipt__head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 10mm; }
.pacl-receipt__head p { margin: 0 0 4px; }
.pacl-receipt__logo { max-height: 18mm; max-width: 60mm; margin-bottom: 6px; }
.pacl-receipt__biz { font: 800 18px/1.2 var(--pacl-font); }
.pacl-receipt__meta { text-align: right; }
.pacl-receipt__table { margin: 8mm 0; font-size: 15px; }
.pacl-receipt__table thead th { border-bottom: 2px solid var(--pacl-ink); }
@media print { .pacl-receipt { box-shadow: none; width: auto; } }

/* ===================================================================
 * Dark mode: interactive on-screen status colours only. The
 * certificate and receipt above are printable/downloadable documents,
 * so they intentionally stay light/white in every mode (and @media
 * print above is untouched).
 * =================================================================== */
@media (prefers-color-scheme: dark) {
	.pacl-notice--success { border-color: rgba(76, 175, 109, .4); background: #16301F; color: #8FDBA8; }
	.pacl-notice--error { border-color: rgba(255, 107, 94, .4); background: #341714; color: #FFB4A8; }
	.pacl-pill--ok { background: #16301F; color: #8FDBA8; }
	.pacl-pill--no { background: #341714; color: #FFB4A8; }
	.pacl-verify--valid { background: #16301F; border-color: rgba(76, 175, 109, .4); color: #8FDBA8; }
	.pacl-verify--revoked, .pacl-verify--altered { background: #341714; border-color: rgba(255, 107, 94, .4); color: #FFB4A8; }
}
/* Same explicit-override reasoning as further up this file: needs to win
 * even against a device set the other way. Keep in sync with the @media
 * block above (dark) and the plain rules near the top of the file (light,
 * around .pacl-notice--success and friends). */
html[data-pacl-theme="dark"] .pacl-notice--success { border-color: rgba(76, 175, 109, .4); background: #16301F; color: #8FDBA8; }
html[data-pacl-theme="dark"] .pacl-notice--error { border-color: rgba(255, 107, 94, .4); background: #341714; color: #FFB4A8; }
html[data-pacl-theme="dark"] .pacl-pill--ok { background: #16301F; color: #8FDBA8; }
html[data-pacl-theme="dark"] .pacl-pill--no { background: #341714; color: #FFB4A8; }
html[data-pacl-theme="dark"] .pacl-verify--valid { background: #16301F; border-color: rgba(76, 175, 109, .4); color: #8FDBA8; }
html[data-pacl-theme="dark"] .pacl-verify--revoked, html[data-pacl-theme="dark"] .pacl-verify--altered { background: #341714; border-color: rgba(255, 107, 94, .4); color: #FFB4A8; }
html[data-pacl-theme="light"] .pacl-notice--success { border-color: rgba(46, 125, 70, .35); background: #F0F7F2; color: #1F5A31; }
html[data-pacl-theme="light"] .pacl-notice--error { border-color: rgba(210, 58, 46, .35); background: #FDF0EE; color: #8E241B; }
html[data-pacl-theme="light"] .pacl-pill--ok { background: #EAF4ED; color: #1F5A31; }
html[data-pacl-theme="light"] .pacl-pill--no { background: #FDF0EE; color: #8E241B; }
html[data-pacl-theme="light"] .pacl-verify--valid { background: #F0F7F2; border-color: rgba(46,125,70,.35); color: #1F5A31; }
html[data-pacl-theme="light"] .pacl-verify--revoked, html[data-pacl-theme="light"] .pacl-verify--altered { background: #FDF0EE; border-color: rgba(210,58,46,.35); color: #8E241B; }
