/*
 * TechForge Learn front end.
 * Tokens follow the TechForge brand manual; colours can be changed in Settings.
 * Everything is scoped to .tfl / .tfl-focus so themes are left alone.
 *
 * Brand palette:
 *   TechForge Blue  #0F62FE  (primary, 60%)
 *   Deep Navy       #001141  (secondary, 20%)
 *   Accent Blue     #4589FF  (accent, 10%)
 *   Sky Tint        #D0E2FF
 *   Cool Gray       #F2F4F8
 *   Steel Gray      #697077
 *   Carbon Black    #161616
 *   Pure White      #FFFFFF
 *
 * Typography: IBM Plex Sans (self-hosted), IBM Plex Mono for code.
 */

@font-face {
	font-family: 'IBM Plex Sans';
	src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Sans';
	src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2');
	font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Sans';
	src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
	font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Sans';
	src: url('../fonts/IBMPlexSans-Bold.woff2') format('woff2');
	font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Sans';
	src: url('../fonts/IBMPlexSans-Light.woff2') format('woff2');
	font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Mono';
	src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Mono';
	src: url('../fonts/IBMPlexMono-Medium.woff2') format('woff2');
	font-weight: 500; font-style: normal; font-display: swap;
}

.tfl,
.tfl-focus {
	--tfl-ink: #161616;
	--tfl-body: #393939;
	--tfl-muted: #697077;
	--tfl-accent: #0F62FE;
	--tfl-on-accent: #FFFFFF;
	--tfl-highlight: #4589FF;
	--tfl-gold: #0F62FE;
	--tfl-gold-deep: #001141;
	--tfl-bg: #F2F4F8;
	--tfl-bg-2: #E0E5EB;
	--tfl-tint: #D0E2FF;
	--tfl-paper: #FFFFFF;
	--tfl-line: rgba(22, 22, 22, .10);
	--tfl-success: #24A148;
	--tfl-font: 'IBM Plex Sans', 'Inter', 'Arial', 'Helvetica Neue', sans-serif;
	--tfl-font-mono: 'IBM Plex Mono', 'Fira Code', 'Consolas', monospace;
	--tfl-radius-card: 4px;
	--tfl-radius-btn: 4px;
	--tfl-circuit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M10 30h40M30 10v40M10 10h10v10H10zM40 40h10v10H40z' fill='none' stroke='%230F62FE' stroke-width='.5' opacity='.08'/%3E%3C/svg%3E");
	--tfl-kente: linear-gradient(90deg, #0F62FE 0 50%, #001141 50% 100%);
}

/* Dark mode: Deep Navy background, light text, blue accents brightened.
 * Applies only where the page allows it: <html data-tfl-scheme> is set by
 * TFL_Frontend::theme_bootstrap() in lessons and, if the site owner
 * chooses "Everywhere", on every plugin page. */
@media (prefers-color-scheme: dark) {
	html[data-tfl-scheme] .tfl,
	html[data-tfl-scheme] .tfl-focus {
		--tfl-ink: #F2F4F8;
		--tfl-body: #C6C6C6;
		--tfl-muted: #8D8D8D;
		--tfl-accent: #4589FF;
		--tfl-on-accent: #FFFFFF;
		--tfl-highlight: #78A9FF;
		--tfl-gold: #4589FF;
		--tfl-gold-deep: #D0E2FF;
		--tfl-bg: #001141;
		--tfl-bg-2: #001D6C;
		--tfl-tint: #002D9C;
		--tfl-paper: #00184A;
		--tfl-line: rgba(242, 244, 248, .14);
		--tfl-success: #42BE65;
	}
}

/* Explicit overrides for the Appearance control in the account menu
 * (account_bar()): frontend.js sets data-tfl-theme="light"/"dark" on
 * <html> when a learner picks something other than "Auto", and the small
 * bootstrap script TFL_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.
 */
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl,
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-focus {
	--tfl-ink: #F2F4F8;
	--tfl-body: #C6C6C6;
	--tfl-muted: #8D8D8D;
	--tfl-accent: #4589FF;
	--tfl-on-accent: #FFFFFF;
	--tfl-highlight: #78A9FF;
	--tfl-gold: #4589FF;
	--tfl-gold-deep: #D0E2FF;
	--tfl-bg: #001141;
	--tfl-bg-2: #001D6C;
	--tfl-tint: #002D9C;
	--tfl-paper: #00184A;
	--tfl-line: rgba(242, 244, 248, .14);
	--tfl-success: #42BE65;
}
html[data-tfl-theme="light"] .tfl,
html[data-tfl-theme="light"] .tfl-focus {
	--tfl-body: #393939;
	--tfl-muted: #697077;
	--tfl-gold: #0F62FE;
	--tfl-gold-deep: #001141;
	--tfl-bg-2: #E0E5EB;
	--tfl-tint: #D0E2FF;
	--tfl-paper: #FFFFFF;
	--tfl-line: rgba(22, 22, 22, .10);
	--tfl-success: #24A148;
}

.tfl-focus { --tfl-font: 'IBM Plex Sans', 'Inter', 'Arial', 'Helvetica Neue', sans-serif; }
.tfl { font-family: var(--tfl-font); color: var(--tfl-ink); }
.tfl *, .tfl-focus * { box-sizing: border-box; }

/* Brand stripe: TechForge blue gradient bar. */
.tfl-kente { display: block; height: 4px; background: var(--tfl-kente); }

/* Circuit pattern overlay for hero areas and feature cards. */
.tfl-circuit {
	position: relative;
}
.tfl-circuit::before {
	content: '';
	position: absolute; inset: 0;
	background-image: var(--tfl-circuit);
	background-repeat: repeat;
	pointer-events: none;
	z-index: 0;
}

.tfl .screen-reader-text,
.tfl-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;
}

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

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

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

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

/* Progress ----------------------------------------------------------- */
.tfl-progress { margin: 12px 0; }
.tfl-progress__track { height: 8px; border-radius: 8px; background: var(--tfl-bg-2); overflow: hidden; }
.tfl-progress__track span { display: block; height: 100%; background: var(--tfl-accent); border-radius: 8px; min-width: 0; }
.tfl-progress__text { margin: 6px 0 0; font-size: 13px; color: var(--tfl-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 .tfl, so it
 * never touches the theme's own header — see PACL_Frontend::account_bar().
 */
.tfl-topbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	margin: 0 0 20px; padding: 10px 0;
}
.tfl-topbar__nav { display: flex; flex-wrap: wrap; gap: 6px; }
.tfl-topbar__nav a {
	display: inline-block; padding: 8px 14px; border-radius: 20px;
	font: 600 14px/1.2 var(--tfl-font); color: var(--tfl-ink); text-decoration: none;
}
.tfl-topbar__nav a:hover, .tfl-topbar__nav a:focus-visible { background: var(--tfl-tint); }
.tfl-topbar__account { position: relative; }
.tfl-topbar__toggle {
	display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
	background: transparent; border: 1px solid var(--tfl-line); border-radius: 24px; cursor: pointer;
	color: var(--tfl-ink);
}
.tfl-topbar__toggle:hover { background: var(--tfl-tint); }
.tfl-topbar__toggle .tfl-avatar, .tfl-topbar__toggle .tfl-initials { width: 32px; height: 32px; font-size: 13px; }
.tfl-topbar__toggle .tfl-icon { width: 16px; height: 16px; color: var(--tfl-muted); }
.tfl-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(--tfl-paper); border: 1px solid var(--tfl-line); border-radius: 12px;
	box-shadow: 0 12px 28px rgba(26, 21, 18, .16);
}
.tfl-topbar__who {
	margin: 0 0 4px; padding: 8px 12px; font-weight: 700;
	border-bottom: 1px solid var(--tfl-line);
}
.tfl-topbar__menu li:not(.tfl-topbar__who) { margin: 0; }
.tfl-topbar__menu a {
	display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px;
	color: var(--tfl-ink); text-decoration: none;
}
.tfl-topbar__menu a:hover, .tfl-topbar__menu a:focus-visible { background: var(--tfl-tint); }
.tfl-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(--tfl-line);
}
.tfl-topbar__theme-label { font-size: 13px; color: var(--tfl-muted); }
/* Same segmented-control look as .tfl-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. */
.tfl-theme-toggle { display: flex; gap: 4px; border: 1px solid var(--tfl-line); border-radius: 9px; padding: 3px; }
.tfl-theme-toggle__btn {
	display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
	background: transparent; border: 0; border-radius: 6px; color: var(--tfl-muted); cursor: pointer;
}
.tfl-theme-toggle__btn:hover { background: var(--tfl-tint); }
.tfl-theme-toggle__btn.is-active { background: var(--tfl-bg-2); color: var(--tfl-ink); }
.tfl-theme-toggle__btn .tfl-icon { width: 15px; height: 15px; }

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

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

.tfl-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().
 */
.tfl-course-banner {
	position: relative; margin: 0 0 28px; border-radius: var(--tfl-radius-card); overflow: hidden;
	background-color: var(--tfl-bg-2); background-size: cover; background-position: center;
	color: #fff;
}
.tfl-course-banner--plain { background: var(--tfl-kente); background-size: 200% 100%; }
.tfl-course-banner__scrim {
	padding: 28px 28px 24px;
	background: linear-gradient(180deg, rgba(26,21,18,.15) 0%, rgba(26,21,18,.72) 100%);
}
.tfl-course-banner--plain .tfl-course-banner__scrim { background: rgba(26,21,18,.42); }
.tfl-course-banner__cat {
	background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(2px);
}
.tfl-course-banner__title {
	margin: 12px 0 14px; font: 800 clamp(24px, 3.4vw, 34px)/1.15 var(--tfl-font); letter-spacing: -.02em; color: #fff;
}
.tfl-course-banner__people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 22px; }
.tfl-course-banner__people li { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; }
.tfl-course-banner__people .tfl-avatar, .tfl-course-banner__people .tfl-initials { width: 26px; height: 26px; font-size: 11px; }
.tfl-course-banner__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 18px; }
.tfl-course-banner__foot .tfl-progress { flex: 1 1 220px; max-width: 360px; margin: 0; }
.tfl-course-banner__foot .tfl-progress__track { background: rgba(255,255,255,.28); }
.tfl-course-banner__foot .tfl-progress__text { color: rgba(255,255,255,.85); }
.tfl-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-tfl-sidebar] mobile
 * collapse in frontend.js. See PACL_Frontend::course_menu().
 */
.tfl-course-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 40px; align-items: start; }
.tfl-course-layout--single { grid-template-columns: minmax(0, 1fr); }
.tfl-course-main { min-width: 0; }
.tfl-coursemenu {
	background: var(--tfl-paper); border: 1px solid var(--tfl-line); border-radius: var(--tfl-radius-card);
	position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto;
}
.tfl-coursemenu > summary {
	display: none; list-style: none; cursor: pointer; align-items: center; gap: 8px;
	font: 600 15px/1.2 var(--tfl-font); padding: 14px 16px;
}
.tfl-coursemenu > summary::-webkit-details-marker { display: none; }
.tfl-coursemenu__body { padding: 6px 0 10px; }
.tfl-coursemenu__section { border-top: 1px solid var(--tfl-line); }
.tfl-coursemenu__section:first-child { border-top: 0; }
.tfl-coursemenu__section > summary {
	display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
	padding: 12px 16px; font: 700 13px/1.3 var(--tfl-font); color: var(--tfl-ink);
}
.tfl-coursemenu__section > summary::-webkit-details-marker { display: none; }
.tfl-coursemenu__section > summary::before { content: "\2212"; color: var(--tfl-muted); width: 1em; flex: none; }
.tfl-coursemenu__section:not([open]) > summary::before { content: "+"; }
.tfl-coursemenu__section ul { list-style: none; margin: 0; padding: 0 10px 10px; }
.tfl-coursemenu__section p { margin: 0; padding: 0 16px 10px; }
.tfl-coursemenu__section li {
	display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 6px; border-radius: 8px; font-size: 14px;
}
.tfl-coursemenu__section li .tfl-icon { color: var(--tfl-muted); flex: none; width: 16px; height: 16px; }
.tfl-coursemenu__section li.is-done .tfl-icon { color: var(--tfl-success); }
.tfl-coursemenu__section li.is-open .tfl-icon { color: var(--tfl-accent); }
.tfl-coursemenu__section li.is-locked { color: var(--tfl-muted); }
.tfl-coursemenu__section li a { color: var(--tfl-ink); text-decoration: none; }
.tfl-coursemenu__section li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tfl-coursemenu__micon { display: inline-flex; flex: none; color: var(--tfl-muted); }
.tfl-coursemenu__micon .tfl-icon { width: 14px; height: 14px; }
.tfl-coursemenu__section.is-done .tfl-coursemenu__micon { color: var(--tfl-success); }
.tfl-coursemenu__mtitle { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tfl-coursemenu__mnote { font: 500 12px/1.3 var(--tfl-font); color: var(--tfl-muted); }
@media (max-width: 900px) {
	.tfl-course-layout { grid-template-columns: 1fr; gap: 20px; }
	.tfl-coursemenu { position: static; max-height: none; }
	.tfl-coursemenu > summary { display: flex; }
	.tfl-coursemenu[open] > summary { border-bottom: 1px solid var(--tfl-line); }
}

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

/* Session speakers --------------------------------------------------- */
.tfl-coursemenu__mpeople { font: 400 12px/1.35 var(--tfl-font); color: var(--tfl-muted); }
.tfl-speakers-line { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px; font-size: 13px; color: var(--tfl-muted); }
.tfl-speakers-line__faces { display: inline-flex; flex: none; }
.tfl-speakers-line__faces > * + * { margin-inline-start: -6px; }
.tfl-speakers-line .tfl-avatar, .tfl-speakers-line .tfl-initials { width: 22px; height: 22px; font-size: 9px; border: 2px solid var(--tfl-paper); box-sizing: content-box; }
.tfl-speakers-inline { margin: 4px 0 18px; }
.tfl-speakers-inline__label { margin: 0 0 6px; font: 600 12px/1.3 var(--tfl-font); letter-spacing: .09em; text-transform: uppercase; color: var(--tfl-muted); }
.tfl-speakers-inline ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.tfl-speakers-inline li { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; line-height: 1.35; }
.tfl-speakers-inline .tfl-initials { font-size: 12px; }
.tfl-speakers h2 { margin: 0 0 16px; }
.tfl-speakers__module { padding: 14px 0; border-top: 1px solid var(--tfl-line); }
.tfl-speakers__module h3 { margin: 0 0 10px; font-size: 16px; }
.tfl-speakers__module p { margin: 0; }
.tfl-speakers ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px 20px; }
.tfl-speakers li { display: flex; gap: 12px; align-items: center; margin: 0; line-height: 1.4; }
.tfl-speakers .tfl-avatar { border-radius: 50%; object-fit: cover; flex: none; }
.tfl-speakers-line .tfl-avatar, .tfl-speakers-inline .tfl-avatar { border-radius: 50%; object-fit: cover; flex: none; }

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

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

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

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

.tfl-dash-head { margin: 0 0 20px; }
.tfl-dash-head h1 { margin: 0; font: 800 clamp(24px, 3.2vw, 32px)/1.2 var(--tfl-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 .tfl-js-only elsewhere, so learners get a plain, complete
 * card grid instead of dead controls. */
.tfl-dash-toolbar { display: none; }
.tfl-js .tfl-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(--tfl-line);
}
.tfl-dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.tfl-dash-tab {
	font: 600 14px/1.2 var(--tfl-font); color: var(--tfl-muted); background: transparent;
	border: 1px solid transparent; border-radius: 20px; padding: 8px 14px; cursor: pointer;
}
.tfl-dash-tab:hover { background: var(--tfl-tint); }
.tfl-dash-tab.is-active { color: var(--tfl-ink); background: var(--tfl-bg-2); border-color: var(--tfl-line); }
.tfl-dash-tab__count { color: var(--tfl-muted); }
.tfl-dash-tab.is-active .tfl-dash-tab__count { color: inherit; }
.tfl-dash-search { flex: 0 1 220px; }
.tfl-dash-search input { padding: 9px 13px; }
.tfl-dash-sort select { padding: 9px 30px 9px 13px; }
.tfl-dash-view { display: flex; gap: 4px; border: 1px solid var(--tfl-line); border-radius: 9px; padding: 3px; }
.tfl-dash-view__btn {
	display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
	background: transparent; border: 0; border-radius: 6px; color: var(--tfl-muted); cursor: pointer;
}
.tfl-dash-view__btn:hover { background: var(--tfl-tint); }
.tfl-dash-view__btn.is-active { background: var(--tfl-bg-2); color: var(--tfl-ink); }

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

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

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

.tfl-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(--tfl-line);
}
.tfl-lesson-footer__main { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.tfl-lesson-footer__main form { margin: 0; }
.tfl-lesson-footer__next { justify-self: end; }
.tfl-print-hint { margin: 20px 0 0; font-size: 14px; text-align: center; }
.tfl-js-only { display: none; }
.tfl-js .tfl-js-only { display: block; }

/* Videos ------------------------------------------------------------- */
.tfl-video {
	/* Intentionally not var(--tfl-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: #161616; color: #F2F4F8; border-radius: var(--tfl-radius-card); overflow: hidden;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center;
}
.tfl-video__play {
	display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
	font: 600 16px/1 var(--tfl-font); padding: 14px 22px; border-radius: var(--tfl-radius-btn);
	background: var(--tfl-gold); color: #FFFFFF; border: 0;
}
.tfl-video__play .tfl-icon { fill: currentColor; }
.tfl-video__play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.tfl-video__title { margin: 0; font-weight: 600; font-size: 15px; }
.tfl-video__note { margin: 0; font-size: 13px; color: #A99E8E; }
.tfl-video__note a { color: #F2F4F8; }
.tfl-video.is-playing { padding: 0; display: block; }
.tfl-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* In a block-editor embed on a theme with responsive embeds, WordPress reserves
 * the 16:9 space with an empty ::before and expects the video to sit on top of
 * it. Fill that space instead of adding a second 16:9 box below it. */
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper { position: relative; }
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper > .tfl-video { position: absolute; inset: 0; aspect-ratio: auto; margin: 0; }

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

.tfl-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;
}
/* --tfl-bar-h is set by frontend.js from the real rendered height of
 * .tfl-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. */
.tfl-focus__sidebar { align-self: start; position: sticky; top: calc(var(--tfl-bar-h, 60px) + 40px); max-height: calc(100vh - var(--tfl-bar-h, 60px) - 60px); overflow: auto; }
.admin-bar .tfl-focus__sidebar { top: calc(var(--tfl-bar-h, 60px) + 72px); }
.tfl-focus__sidebar > summary {
	display: none; list-style: none; cursor: pointer; align-items: center; gap: 8px;
	font: 600 15px/1.2 var(--tfl-font); padding: 12px 14px;
	background: var(--tfl-paper); border: 1px solid var(--tfl-line); border-radius: 9px;
}
.tfl-focus__sidebar > summary::-webkit-details-marker { display: none; }
.tfl-focus__sidebar .tfl-outline__item { padding: 10px 6px; font-size: 14px; }
.tfl-focus__main { min-width: 0; }
.tfl-lesson { max-width: 720px; }
.tfl-lesson__title { margin: 0 0 10px; font: 800 clamp(28px, 4.6vw, 42px)/1.1 var(--tfl-font); letter-spacing: -.025em; color: var(--tfl-ink); }
.tfl-focus .tfl-lesson-body { font-size: 17px; line-height: 1.75; color: var(--tfl-body); }
.tfl-focus .tfl-lesson-body > * { margin-top: 0; margin-bottom: 1.1em; }
.tfl-focus .tfl-lesson-body h2 { font: 700 26px/1.25 var(--tfl-font); letter-spacing: -.01em; color: var(--tfl-ink); margin: 1.6em 0 .5em; }
.tfl-focus .tfl-lesson-body h3 { font: 600 20px/1.3 var(--tfl-font); color: var(--tfl-ink); margin: 1.4em 0 .4em; }
.tfl-focus .tfl-lesson-body a { color: var(--tfl-gold-deep); text-underline-offset: 3px; }
.tfl-focus .tfl-lesson-body img { max-width: 100%; height: auto; border-radius: 10px; }
.tfl-focus .tfl-lesson-body figure { margin-left: 0; margin-right: 0; }
.tfl-focus .tfl-lesson-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--tfl-gold); color: var(--tfl-ink); }
.tfl-focus .tfl-lesson-body pre, .tfl-focus .tfl-lesson-body code { font-size: .9em; background: var(--tfl-paper); border: 1px solid var(--tfl-line); border-radius: 6px; }
.tfl-focus .tfl-lesson-body pre { padding: 14px; overflow: auto; }
.tfl-focus .tfl-lesson-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.tfl-focus .tfl-lesson-body th, .tfl-focus .tfl-lesson-body td { border: 1px solid var(--tfl-line); padding: 8px 10px; text-align: left; }
.tfl-focus .tfl-lesson-body .wp-block-embed__wrapper { position: relative; }

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

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

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

/* Watermark and "please don't share" note: only on saved or printed lessons.
 * Drawn as faint text, not a background image, so it prints even when the
 * browser's "background graphics" option is off. A fixed element repeats on
 * every printed page. */
.tfl-watermark, .tfl-print-notice { display: none; }
@media print {
	/* Interactive practice doesn't work on paper: leave it out of saved lessons. */
	.tfl-practice, .tfl-play { display: none !important; }
	.tfl-watermark {
		display: block !important; position: fixed; inset: 0; z-index: 2147483000;
		overflow: hidden; pointer-events: none;
	}
	.tfl-watermark__inner {
		position: absolute; top: 50%; left: 50%; width: 220%;
		display: flex; flex-direction: column; align-items: center; gap: 70px;
		transform: translate(-50%, -50%) rotate(-30deg);
	}
	.tfl-watermark__line {
		display: block; white-space: pre; font: 700 20pt/1 'IBM Plex Sans', Arial, sans-serif;
		letter-spacing: .06em; color: rgba(0, 0, 0, .075);
		-webkit-print-color-adjust: exact; print-color-adjust: exact;
	}
	.tfl-print-notice {
		display: block !important; margin: 28px 0 0; padding-top: 10px;
		border-top: 1px solid #999; font-size: 9pt; line-height: 1.4; color: #333;
		break-inside: avoid;
	}
}

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

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

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

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

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

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

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

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

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

/* Printable certificate (A4 landscape) */
.tfl-print-body { margin: 0; background: #e9e4da; font-family: var(--tfl-font, sans-serif); }
.tfl-printbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 16px; }
/*
 * .tfl-certificate is a fixed A4-landscape box (297mm) that will not fit a phone
 * viewport. frontend.js wraps it in .tfl-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 .tfl-cert-wrap .tfl-certificate rule below always
 * wins over the max-width breakpoints further down (higher selector specificity),
 * so those breakpoints only matter when JavaScript is unavailable.
 */
.tfl-cert-wrap { width: 100%; max-width: 297mm; margin: 0 auto 32px; overflow: hidden; }
.tfl-certificate { width: 297mm; height: 210mm; margin: 0 auto 32px; background: var(--tfl-bg); display: flex; flex-direction: column; box-shadow: 0 6px 30px rgba(26,21,18,.18); overflow: hidden; }
.tfl-cert-wrap .tfl-certificate { margin: 0 auto; transform: scale(var(--cert-scale, 1)); transform-origin: top center; }
.tfl-certificate .tfl-kente { height: 10px; flex: none; }
.tfl-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); }
.tfl-certificate__logo { max-height: 22mm; max-width: 70mm; }
.tfl-certificate__issuer { font: 800 20px/1 var(--tfl-font); margin: 0; letter-spacing: .06em; text-transform: uppercase; }
.tfl-certificate .tfl-eyebrow { margin-top: 9mm; font-size: 14px; letter-spacing: .2em; }
.tfl-certificate__lead { margin: 4mm 0 0; color: var(--tfl-body); font-size: 16px; }
.tfl-certificate__name { margin: 3mm 0 0; font: 800 46px/1.1 var(--tfl-font); letter-spacing: -.02em; color: var(--tfl-ink); }
.tfl-certificate__title { margin: 3mm 0 0; font: 700 26px/1.25 var(--tfl-font); color: var(--tfl-ink); max-width: 210mm; }
.tfl-certificate__outcome, .tfl-certificate__cohort { margin: 3mm 0 0; font-size: 15px; color: var(--tfl-gold-deep); font-weight: 600; }
.tfl-certificate__award { margin: 3mm 0 0; font: 800 20px/1.2 var(--tfl-font); letter-spacing: .02em; color: var(--tfl-highlight); }
.tfl-certificate__desc { margin: 6mm auto 0; max-width: 170mm; font-size: 14px; line-height: 1.55; color: var(--tfl-body); }
.tfl-certificate__foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12mm; align-items: end; text-align: left; }
.tfl-certificate__foot p { margin: 0; font-size: 12px; line-height: 1.4; }
.tfl-certificate__signame { font-size: 16px !important; font-weight: 700; padding-top: 3mm; border-top: 1px solid var(--tfl-ink); min-width: 55mm; }
.tfl-certificate__verify { display: flex; gap: 4mm; align-items: center; }
.tfl-certificate__verify .tfl-qr { width: 26mm; height: 26mm; padding: 1mm; }
@media print {
	.tfl-print-body { background: #fff; }
	.tfl-printbar { display: none !important; }
	.tfl-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). */
	.tfl-cert-wrap { width: auto !important; max-width: none !important; height: auto !important; overflow: visible !important; margin: 0 !important; }
	.tfl-cert-wrap .tfl-certificate { transform: none !important; }
}
/* No-JS fallback only: .tfl-cert-wrap .tfl-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) { .tfl-certificate { transform: scale(.6); transform-origin: top center; margin-bottom: -80mm; } }
@media screen and (max-width: 480px) { .tfl-certificate { transform: scale(.32); transform-origin: top center; margin-bottom: -143mm; } }

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

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

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

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

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

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

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

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

/* Payments */
.tfl-pay { display: grid; gap: 14px; }
.tfl-pay > * { margin: 0; }
.tfl-pay__prices { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.tfl-pay__prices legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.tfl-pay__prices .tfl-choice { font-size: 17px; }
.tfl-pay__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.tfl-pay .tfl-field { max-width: 320px; }
.tfl-receipt { width: 190mm; max-width: 100%; margin: 0 auto 32px; background: var(--tfl-paper); box-shadow: 0 6px 30px rgba(26,21,18,.12); }
.tfl-receipt .tfl-kente { height: 8px; }
.tfl-receipt__inner { padding: 14mm 16mm; }
.tfl-receipt__head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 10mm; }
.tfl-receipt__head p { margin: 0 0 4px; }
.tfl-receipt__logo { max-height: 18mm; max-width: 60mm; margin-bottom: 6px; }
.tfl-receipt__biz { font: 800 18px/1.2 var(--tfl-font); }
.tfl-receipt__meta { text-align: right; }
.tfl-receipt__table { margin: 8mm 0; font-size: 15px; }
.tfl-receipt__table thead th { border-bottom: 2px solid var(--tfl-ink); }
@media print { .tfl-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) {
	html[data-tfl-scheme] .tfl-notice--success { border-color: rgba(76, 175, 109, .4); background: #16301F; color: #8FDBA8; }
	html[data-tfl-scheme] .tfl-notice--error { border-color: rgba(255, 107, 94, .4); background: #341714; color: #FFB4A8; }
	html[data-tfl-scheme] .tfl-pill--ok { background: #16301F; color: #8FDBA8; }
	html[data-tfl-scheme] .tfl-pill--no { background: #341714; color: #FFB4A8; }
	html[data-tfl-scheme] .tfl-verify--valid { background: #16301F; border-color: rgba(76, 175, 109, .4); color: #8FDBA8; }
	html[data-tfl-scheme] .tfl-verify--revoked, html[data-tfl-scheme] .tfl-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 .tfl-notice--success and friends). */
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-notice--success { border-color: rgba(76, 175, 109, .4); background: #16301F; color: #8FDBA8; }
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-notice--error { border-color: rgba(255, 107, 94, .4); background: #341714; color: #FFB4A8; }
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-pill--ok { background: #16301F; color: #8FDBA8; }
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-pill--no { background: #341714; color: #FFB4A8; }
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-verify--valid { background: #16301F; border-color: rgba(76, 175, 109, .4); color: #8FDBA8; }
html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-verify--revoked, html[data-tfl-scheme][data-tfl-theme="dark"] .tfl-verify--altered { background: #341714; border-color: rgba(255, 107, 94, .4); color: #FFB4A8; }
html[data-tfl-theme="light"] .tfl-notice--success { border-color: rgba(46, 125, 70, .35); background: #F0F7F2; color: #1F5A31; }
html[data-tfl-theme="light"] .tfl-notice--error { border-color: rgba(210, 58, 46, .35); background: #FDF0EE; color: #8E241B; }
html[data-tfl-theme="light"] .tfl-pill--ok { background: #EAF4ED; color: #1F5A31; }
html[data-tfl-theme="light"] .tfl-pill--no { background: #FDF0EE; color: #8E241B; }
html[data-tfl-theme="light"] .tfl-verify--valid { background: #F0F7F2; border-color: rgba(46,125,70,.35); color: #1F5A31; }
html[data-tfl-theme="light"] .tfl-verify--revoked, html[data-tfl-theme="light"] .tfl-verify--altered { background: #FDF0EE; border-color: rgba(210,58,46,.35); color: #8E241B; }

/* Discussions under lessons */
.tfl-discussion { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--tfl-line); }
.tfl-discussion h2 { font-size: 20px; margin: 0 0 14px; }
.tfl-discussion__list, .tfl-discussion__list .children { list-style: none; margin: 0; padding: 0; }
.tfl-discussion__list .children { margin-inline-start: 28px; padding-inline-start: 14px; border-inline-start: 2px solid var(--tfl-line); }
.tfl-discussion__item article { padding: 12px 0; }
.tfl-discussion__item.is-staff > article { background: var(--tfl-tint); border-radius: 10px; padding: 12px 14px; }
.tfl-discussion__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tfl-discussion__meta .tfl-initials { font-size: 12px; }
.tfl-discussion__text { margin: 6px 0 0; line-height: 1.6; }
.tfl-discussion__text p { margin: 0 0 8px; }
.tfl-discussion__reply { margin: 0; font-size: 14px; }
.tfl-discussion .comment-respond { margin-top: 18px; }
.tfl-discussion .comment-reply-title { font-size: 16px; margin: 0 0 8px; }
.tfl-discussion .comment-form textarea { width: 100%; }

/* SCORM player */
.tfl-scorm { margin: 24px 0; border: 1px solid var(--tfl-line); border-radius: var(--tfl-radius-card); overflow: hidden; background: var(--tfl-paper); }
.tfl-scorm__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--tfl-line); }
.tfl-scorm__frame { display: block; width: 100%; height: min(78vh, 760px); border: 0; background: #fff; }
.tfl-scorm:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.tfl-scorm:fullscreen .tfl-scorm__frame { flex: 1; height: auto; }

/* Certificate: TechForge brand design. IBM Plex Sans throughout,
 * Deep Navy accent stripe, hairline frame on cream. */
.tfl-certificate--brand { font-family: var(--tfl-font-brand, 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); background: #F2F4F8; }
.tfl-certificate--brand .tfl-kente { height: 6px; }
.tfl-certificate--brand .tfl-certificate__inner { margin: 8mm; border: 1px solid rgba(26,21,18,.10); padding: 13mm 24mm 11mm; }
.tfl-certificate--brand .tfl-certificate__logo { max-height: 20mm; max-width: 80mm; }
.tfl-certificate--brand .tfl-certificate__issuer { font: 800 18px/1.2 inherit; letter-spacing: -.01em; text-transform: none; color: #161616; }
.tfl-certificate--brand .tfl-certificate__kind {
	margin: auto 0 0; padding-top: 6mm; color: #4589FF; font-weight: 600; font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
}
.tfl-certificate--brand .tfl-certificate__lead { margin-top: 5mm; font-size: 15px; color: #393939; }
.tfl-certificate--brand .tfl-certificate__name {
	margin-top: 2mm; padding: 0 6mm 2.5mm; display: inline-block; font-weight: 800; font-size: 48px; letter-spacing: -.025em;
	color: #161616; border-bottom: 2px solid #0F62FE;
}
.tfl-certificate--brand .tfl-certificate__title { font-weight: 700; font-size: 25px; letter-spacing: -.015em; color: #161616; }
.tfl-certificate--brand .tfl-certificate__desc { max-width: 165mm; color: #393939; line-height: 1.6; }
.tfl-certificate--brand .tfl-certificate__foot { margin-top: auto; padding-top: 8mm; grid-template-columns: 1.5fr auto 1fr auto; gap: 11mm; align-items: end; }
.tfl-certificate--brand .tfl-certificate__seal { width: 27mm; height: 27mm; align-self: center; }
.tfl-certificate--brand .tfl-certificate__sig .tfl-muted, .tfl-certificate--brand .tfl-certificate__date .tfl-muted { font-size: 11px; color: #697077; }
.tfl-certificate__sigimg { display: block; max-height: 15mm; max-width: 58mm; margin: 0 0 -1mm; object-fit: contain; object-position: left bottom; }
.tfl-certificate--brand .tfl-certificate__verify .tfl-qr { width: 22mm; height: 22mm; }
.tfl-certificate--brand .tfl-certificate__verify p { font-size: 11px; }
.tfl-certificate__id { white-space: nowrap; }
.tfl-certificate--brand .tfl-certificate__date .tfl-certificate__signame { border-top: 0; }
/* Two signatures: the signatures flank the seal; date and verification sit below. */
.tfl-certificate--brand .tfl-certificate__foot--two { display: flex; flex-direction: column; gap: 4mm; padding-top: 6mm; }
.tfl-certificate__signers { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14mm; align-items: end; width: 100%; padding: 0 6mm; box-sizing: border-box; }
.tfl-certificate__signers .tfl-certificate__sig { text-align: center; }
.tfl-certificate__signers .tfl-certificate__sigimg { margin-inline: auto; object-position: center bottom; }
.tfl-certificate--brand .tfl-certificate__signers .tfl-certificate__seal { width: 25mm; height: 25mm; }
.tfl-certificate__meta { display: flex; justify-content: space-between; align-items: center; width: 100%; padding-top: 3mm; border-top: 1px solid rgba(26,21,18,.10); text-align: left; }
.tfl-certificate__meta .tfl-certificate__signame { font-size: 14px !important; padding-top: 0; }
.tfl-certificate--brand .tfl-certificate__meta .tfl-certificate__verify .tfl-qr { width: 18mm; height: 18mm; }

/* ── Auth forms (login / register / forgot / reset password) ── */
.tfl-auth-box {
	max-width: 440px;
	margin: 48px auto;
	padding: 36px 32px 32px;
	background: var(--tfl-paper);
	border: 1px solid var(--tfl-line);
	border-radius: var(--tfl-radius-card);
	box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.04);
	text-align: center;
}
.tfl-auth-logo { margin: 0 0 18px; }
.tfl-auth-logo svg { display: inline-block; }
.tfl-auth-box h3 {
	margin: 0 0 6px;
	font: 700 22px/1.3 var(--tfl-font);
	color: var(--tfl-ink);
}
.tfl-auth-subtitle {
	margin: 0 0 4px;
	font: 400 14px/1.5 var(--tfl-font);
	color: var(--tfl-muted);
}
.tfl-auth-box > p {
	margin: 0 0 14px;
	font: 400 14px/1.5 var(--tfl-font);
	color: var(--tfl-muted);
}
.tfl-auth-form {
	display: grid;
	gap: 16px;
	text-align: left;
	margin-top: 22px;
}
.tfl-auth-form .tfl-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.tfl-auth-form .tfl-field > label {
	display: block;
	font: 600 13px/1.3 var(--tfl-font);
	color: var(--tfl-ink);
}
.tfl-auth-form .tfl-field input[type="text"],
.tfl-auth-form .tfl-field input[type="password"],
.tfl-auth-form .tfl-field input[type="email"] {
	width: 100%;
	padding: 11px 14px;
	font: 400 15px/1.4 var(--tfl-font);
	color: var(--tfl-ink);
	background: var(--tfl-bg);
	border: 1px solid var(--tfl-line);
	border-radius: var(--tfl-radius);
	box-sizing: border-box;
	transition: border-color .15s, box-shadow .15s;
}
.tfl-auth-form .tfl-field input:focus {
	outline: none;
	border-color: var(--tfl-accent);
	box-shadow: 0 0 0 3px rgba(15, 98, 254, .18);
}
.tfl-field-hint {
	font: 400 12px/1.3 var(--tfl-font);
	color: var(--tfl-muted);
}
.tfl-field--check { flex-direction: row !important; align-items: center; gap: 0 !important; }
.tfl-field--check label { font-weight: 400 !important; font-size: 14px !important; cursor: pointer; }
.tfl-field--check input[type="checkbox"] {
	width: 16px; height: 16px;
	margin: 0 8px 0 0;
	accent-color: var(--tfl-accent);
	vertical-align: middle;
	cursor: pointer;
}
.tfl-auth-submit {
	width: 100%;
	padding: 12px 20px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: .01em;
	border-radius: var(--tfl-radius) !important;
	transition: opacity .15s;
}
.tfl-auth-submit:hover { opacity: .92; }
.tfl-auth-error {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 4px;
	padding: 12px 14px;
	font: 400 13px/1.5 var(--tfl-font);
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--tfl-radius);
	text-align: left;
}
.tfl-auth-success {
	margin: 0 0 14px;
	padding: 12px 14px;
	font: 400 14px/1.5 var(--tfl-font);
	color: #15803d;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: var(--tfl-radius);
	text-align: left;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-tfl-theme="light"]) .tfl-auth-box {
		box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 6px 16px rgba(0,0,0,.15);
	}
	:root:not([data-tfl-theme="light"]) .tfl-auth-error {
		color: #fca5a5;
		background: rgba(153, 27, 27, .2);
		border-color: rgba(248, 113, 113, .3);
	}
	:root:not([data-tfl-theme="light"]) .tfl-auth-success {
		color: #86efac;
		background: rgba(21, 128, 61, .15);
		border-color: rgba(134, 239, 172, .3);
	}
}
:root[data-tfl-theme="dark"] .tfl-auth-box {
	box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 6px 16px rgba(0,0,0,.15);
}
:root[data-tfl-theme="dark"] .tfl-auth-error {
	color: #fca5a5;
	background: rgba(153, 27, 27, .2);
	border-color: rgba(248, 113, 113, .3);
}
:root[data-tfl-theme="dark"] .tfl-auth-success {
	color: #86efac;
	background: rgba(21, 128, 61, .15);
	border-color: rgba(134, 239, 172, .3);
}
.tfl-auth-alt {
	margin: 14px 0 0;
	font: 400 13px/1.4 var(--tfl-font);
	color: var(--tfl-muted);
}
.tfl-auth-alt a {
	color: var(--tfl-accent);
	text-decoration: none;
	font-weight: 600;
}
.tfl-auth-alt a:hover {
	text-decoration: underline;
}
@media (max-width: 480px) {
	.tfl-auth-box { margin: 24px 16px; padding: 28px 20px 24px; }
}
