
/* Course Image Thumbnail */
#main .article-post-thumbnail{
	margin-left:0px;
	margin-right:0px;
}

/*	---------------------
	 COURSE LESSON TABLE
	---------------------
*/

/* Top row of Table */
.pmspace-lesson-table tr:first-child{ border-top:6px solid #FFB416; padding:6px; }
/* Bottom row of Table */
.pmspace-lesson-table tr:last-child{ border-bottom:6px solid #FFB416; margin-bottom:6px; }

/* Module title */
.pmspace-lesson-table tr .pm-module-name{ color:var(--global-palette3); font-size:18px; }
/* Module header */
.pm-module-header{ background-color:#EDF2F7; }
/* Module paragraph */
.pmspace-lesson-table tr p{ font-size:14px; margin-top:0px; }

/* Lesson name */
.pmspace-lesson-table tr .pm-lesson-name{ font-weight:600; }
/* Lesson name link */
.pmspace-lesson-table tr a{ text-decoration:none; }	/* remove underline */
/* Lesson description */
.pmspace-lesson-table tr .pm-lesson-desc{ font-size:14px !important; line-height:1.4em; }

/* remove redundant bullet from lesson list */
.pm-course-lessons { list-style: none; padding-left: 12; }

/* Divider Bar, end of main table */
#main .wp-block-kadence-spacer:nth-child(6) .kt-divider{ margin-top:-20px; }

/*	-----------------
	 LESSON SIDE BAR
	-----------------
*/
/* colour progress icons */
.pm-lesson-status-0 { color: #E74C3C; } /* Red */
.pm-lesson-status-1 { color: #FFB416; } /* Amber/Orange */
.pm-lesson-status-2 { color: #27AE60; } /* Green */

/* Lesson status row: label + value displayed inline */
.pms-sidebar-lesson-status-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	margin: 0;
}
.pms-sidebar-status-label {
	margin: 0;
	white-space: nowrap;
	font-weight: 400;
}
.pms-sidebar-lesson-status-row #pm-course-enrol-block {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
}
.pms-sidebar-lesson-status-row h5 {
	margin: 0;
}

/* Spacer between status row and course progress heading */
.pms-sidebar-spacer {
	height: 16px;
}

/* Course Lessons Block */
#pm-course-lessons-block {
	background-color: rgba(237,242,247,0.4);
}

/* Lesson item */
#secondary .pm-module-group .pm-lesson-item a{
	text-decoration:none;
}

/* Lessons Module Group */
#secondary .pm-module-group ul{
	margin-top:6px;
	margin-bottom:8px;
}

/* Lesson item icon */
.pm-lesson-item:hover{
	color:var(--global-palette2);
}
/* Lesson item link (hover) */
#secondary .pm-lesson-item a:hover{
	font-weight:600;
	color:var(--global-palette2);
}

/* Module name sidebar*/
#secondary .pm-module-group .pm-module-name{
	color:var(--global-palette3);
	margin-left:10px;
}
/* Lesson legend */
.pm-lesson-legend{
	margin-top:8px;
	margin-bottom:10px;
	padding-left:3px;
	padding-right:3px;
}

/* Below Legend Bar */
.kb-row-layout-id12152_2cf2a8-0e .wp-block-kadence-column .kt-inside-inner-col{
	border-bottom-color:#2d5b85;
	border-bottom-width:10px;
}
/* Bottom row of Table */
#pm-course-lessons-block {
	border-bottom:6px solid var(--global-palette3);
}

/* Progress bar */
.kt-post-grid-wrap .kt-post-masonry-item .pm-progress-bar{ margin-top:-35px; }

/* Progress bar space above and inset, in Dashboard Table */
.pmspace-course-table tr .pm-progress-bar{ margin-top:2px !important; margin-left:12px; }


/* add spinner when lesson page updating */
@keyframes spin {
    0% { transform:rotate(0deg);}
    100% { transform:rotate(360deg);}
}
.pm-spinner .dashicons-update { animation: spin 1s linear infinite; }

/* Dashboard Table style */
/* Th */
.kt-create-accordion tr th:nth-child(2){
	text-align:center;
}

/* Table Data */
.pmspace-course-table tr td{
	border-top-style:solid;
	border-top-color:#ebf4fc;
}

/* Table Data */
.pmspace-course-table tbody tr td{
	border-top-width:6px !important;
}

/* Link */
.pmspace-course-table tr a{
	font-weight:600;
}

/* Course desc */
.pmspace-course-table tr .pm-course-desc{
	font-size:14px !important;
}

/* UPE profile editor buttons — migrate to pms-btn-* when UPE PHP is updated */
.upe-btn-update,
.upe-btn-cancel {
	font-size: 14px;
	margin: auto;
	padding: 8px 12px;
	color: var(--global-palette9);
	background-color: var(--global-palette1);
	border: none; border-radius: 4px;
	box-shadow: 1px 1px 2px 0 rgba(0,0,0,0.3);
}
.upe-btn-update:hover,
.upe-btn-cancel:hover {
	color: var(--global-palette3);
	background-color: var(--global-palette2);
	box-shadow: none;
}

/* drop-down select's height */
#upe-new-email {
	font-size:16px;
	padding:0.4em;
}

/* Only target lesson Titles in pm_lesson post-type */
.pm_lesson .lesson-title-overlap {
    margin-top: -240px !important;
    margin-bottom: 80px !important;
}

/*	------------------
	 Course Grid card
	------------------
*/
.pmspace-course-grid {
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.pmspace-course-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.08);
	transition: box-shadow 0.04s ease;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%; /* Ensures card fills grid area */
	/* align-items: stretch; */
}
.pmspace-course-card:hover {
	box-shadow:none;
	transition: box-shadow 0.04s ease;
	background: var(--global-palette8);
}
.pmspace-course-card:hover .pmspace-card-category {
	background: var(--global-palette2);
	color: var(--global-palette4);
	box-shadow: none;
	transition: background 0.06s ease, color 0.06s ease, box-shadow 0.06s ease;
}	
.pmspace-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
/* Card button layout — overrides display and margin only; appearance
   protected by doubled-selector specificity on .pms-btn-primary. */
.pmspace-card-button {
    display: flex;          /* block-level flex in the card's column layout */
    margin: 0 auto 1.5rem auto;
}
.pmspace-card-image-wrapper { position: relative; }
.pmspace-card-image { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* Format and position of card's Category flag */
.pmspace-card-category {
	position: absolute; top: 15%; left: 0;
	background: var(--global-palette3); color: #fff;
	padding: 4px 15px 4px 10px;
	border-top-right-radius: 50px; border-bottom-right-radius: 50px;
	font-size: 0.85em; margin-right: 20px; min-width: 70px;
	box-shadow: 0px 1px 5px var(--global-palette5);
	transition: background 0.06s ease, color 0.06s ease, box-shadow 0.06s ease;
}
.pmspace-card-progress { margin-left: 20px; margin-right: 20px; }
.pmspace-card-title { margin: 1rem 0 0.5rem 0; text-align: center; font-size: 1.15em; font-weight: bold; color: var(--global-palette3); }
.pmspace-card-info { text-align: center; font-size: 12px; margin-bottom: 0.5rem; }
.pmspace-card-excerpt { font-size: 12px; margin: 0 20px 1rem 20px; text-align: left; }

/* .pmspace-card-button appearance from .pms-btn-secondary (see above) */

/* Coming Soon Banner */
.pmspace-card-image-wrapper {
    position: relative;
    overflow: hidden;
}

/* Status Banner - Base Styles */
.pmspace-status-banner {
    position: absolute;
    top: 110px;
    right: -70px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    padding: 8px 75px;
    transform: rotate(320deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-transform: uppercase;
}

/* Coming Soon Banner - Option 1 */
.pmspace-banner-coming-soon {
    background-color: rgba(245, 165, 36, 0.9);
    color: rgb(44, 89, 128);
}

/* New Course Banner - Option 2 */
.pmspace-banner-new-course {
    background-color: rgba(39, 174, 96, 0.9);
    color: 	#ffffff;
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
    .pmspace-status-banner {
        font-size: 14px;
        padding: 6px 90px;
        top: 110px;
        right: -75px;
    }
}

/*	------------------
	 Filter Bar style
	------------------
*/
.pmspace-course-filterbar {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
/* Filter toggle buttons — specialised UI component, NOT a CTA button.
   Uses its own colour scheme: inactive = pale blue, active = palette1. */
.pmspace-filter-btn {
    background: #ebf4fc;
    color: var(--global-palette3);
    border: none;
    border-radius: 5px;
    padding: 0.4em 1.2em;
    cursor: pointer;
    font-size: 0.8em; font-weight: bold;
    transition: background 0.2s, color 0.2s;
}
.pmspace-filter-btn.active {
    background: var(--global-palette1);
    color: #fff;
}
/* Keep Card size when less than 3 across */
.pmspace-course-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 340px));
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Course Page Template  (templates/single-pm_course.php)
   ========================================================================== */

/* ── Hero banner: enforce 100px min-height ───────────────────────────────────
   Kadence sets large min-heights on .entry-hero / .entry-hero-container-inner.
   Reset the containers to auto, then pin the inner header to 100px min.     */
body.single-pm_course .entry-hero,
body.single-pm_course .entry-hero-container-inner {
	min-height: 0;
	height: auto;
}
body.single-pm_course .entry-hero .entry-header {
	min-height: 100px;
	height: auto;
}

/* ── Self-contained two-column layout ──────────────────────────────────────
   Uses a plugin-specific class so the layout works 
   without depending on theme CSS class names. */
#content.pms-course-layout {
	display: flex;
	flex-direction: row;
	max-width: var(--pmspace-content-width, 1180px);
	margin-left: auto;
	margin-right: auto;
	padding: 24px;
	gap: 32px;
	box-sizing: border-box;
	width: 100%;
}
/* pmspace-theme adds .has-page-bg-image to <body> when a background image is configured. */
.pms-course-content-bg {
	width: 100%;
}
body.has-page-bg-image .pms-course-content-bg {
	background-color: rgba(255, 255, 255, 0.8);
}
#content.pms-course-layout #primary.site-main {
	flex: 1 1 0;
	min-width: 0;
}
#content.pms-course-layout #secondary.widget-area {
	width: var(--pmspace-sidebar-width, 300px);
	flex-shrink: 0;
}

@media (max-width: 768px) {
	#content.pms-course-layout {
		flex-direction: column;
		padding: 16px;
		gap: 24px;
	}
	#content.pms-course-layout #secondary.widget-area {
		width: 100%;
	}
}

/* ── Featured image (16:9, full-width in main column) ───────────────────── */
.pms-course-featured-image {
	width: 100%;
	margin-bottom: 24px;
}
.pms-course-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

/* ── Breadcrumb outer strip (full-width background) ────────────────── */
.pms-course-breadcrumbs,
.pms-lesson-breadcrumbs {
	background-color: rgba(255,255,255,0.8);
	width: 100%;
}

/* ── Shared breadcrumb nav — KB-style ::before chevrons ─────────────── */
.pms-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 10px;
	max-width: var(--pmspace-content-width, 1180px);
	margin: 0 auto;
	padding: 4px 24px;
	box-sizing: border-box;
	font-size: 12px;
	color: var(--global-palette4, #555);
}

/* Chevron prefix on every item via ::before — matches pm-icons-chevron-left (\e931) */
.pms-breadcrumbs a::before,
.pms-breadcrumbs [aria-current="page"]::before {
	content: "\e931";
	font-family: 'PM Space Icons' !important;
	speak: never;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	display: inline-block;
	vertical-align: middle;
	padding-bottom: 0.2em;
	line-height: 1;
	color: currentColor;
	margin-right: 2px;
	font-size: 0.8em;
}

.pms-breadcrumbs a {
	color: var(--global-palette1);
	text-decoration: none;
}
.pms-breadcrumbs a:hover {
	text-decoration: none;
	font-weight: 700;
}
.pms-breadcrumbs [aria-current="page"] {
	color: var(--global-palette5);
	font-weight: 400;
}

/* ── Sidebar enrol button (centred) ─────────────────────────────────── */
.pms-sidebar-center {
	text-align: center;
	margin: 12px 0;
}

/* ── Lesson Status heading ──────────────────────────────────────────── */
.pms-course-progress-heading {
	background-color: var(--global-palette3);
	color: var(--global-palette9);
	border-radius: 8px 8px 0 0;
	padding: 8px 12px;
	margin: 16px 0 0;
}

/* ── Course Pricing block ───────────────────────────────────────────── */
.pms-course-pricing {
	background-color: var(--global-palette8);
	padding: 20px;
	text-align: center;
	margin-top: 24px;
}
.pms-course-pricing h3 { margin: 0 0 8px; }
.pms-course-pricing h2 { margin: 0 0 12px; }
.pms-course-pricing h5 { margin: 0 0 16px; font-weight: normal; line-height: 1.6; }
.pms-course-pricing a {
	color: var(--global-palette3);
}

/* #pms-checkout-btn — appearance from .pms-btn-primary in pmspace-theme/style.css */

/* ── End-of-page spacer ─────────────────────────────────────────────── */
.pms-page-end-space {
	height: 100px;
	width: 100%;
	background: var(--global-palette8);
}

/*	--------------------------------------------
	Specific columns in the student report table
	--------------------------------------------
*/
.pmspace-student-report {
  font-size: 12px !important;
  border-collapse: collapse;
  width: 100%;
}

.pmspace-student-report th, .pmspace-lesson-table td { border-top:4px solid #E7F3FC; padding:6px; }
.pmspace-student-report tr:nth-child(even) { background:#fafafa; }

.pmspace-student-report th,
.pmspace-student-report td {
  padding: 6px 8px !important;
  vertical-align: middle;
  line-height: 1.2;
}

/* Status Report  - centre with doughnut chart*/
.pmspace-user-summary div div{
	margin-top:20px;
}

/* Move the Lessons table below the doughnut chart */
#pmspace-frontend-lesson-table .widefat{
	display:inline-block;
}

/* Applied to the specific soft-centered columns (Status, Start, Completed, Grade, Points) */
.pmspace-student-report th.pmspace-center,
.pmspace-student-report td.pmspace-center {
  text-align: center !important;
  white-space: nowrap;
  width: 90px; /* adjust if you want wider/narrower columns */
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* centre the columns Status, Grade and Points only */
.widefat th:nth-child(2),
.widefat td:nth-child(2),
.widefat th:nth-child(5),
.widefat td:nth-child(5),
.widefat th:nth-child(6),
.widefat td:nth-child(6) {
  text-align: center;
}

/* Table Data */
.widefat tr td{
	/* border-color:#ecf0f1;
	border-style:solid;
	border-width:1px;*/
	border-right-style:solid;
	border-right-color:#ecf0f1;
	border-right-width:1px !important;	
}

/* report-frontend.css
 * Styling for the student report donut + legend.
 */

.pmspace-report-chart-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 1em 0;
  flex-wrap: wrap;
}

/* Legend (left) */
.pmspace-report-legend {
  flex: 1 1 320px;
  max-width: 480px;
  overflow: auto;
}

.pmspace-legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pmspace-legend-table thead th {
  text-align: left;
  padding: 6px 8px;
  font-weight: 600;
  border-bottom: 1px solid #e6e6e6;
}

.pmspace-legend-table tbody td {
  padding: 6px 8px;
  vertical-align: middle;
  border-bottom: 1px solid #f4f4f4;
}

.pm-legend-col-colour {
  width: 36px;
}

.pm-legend-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3) inset;
}

/* small lesson name column, truncated with ellipsis */
.pm-legend-lesson-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* views numeric column */
.pm-legend-views-cell {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Donut wrapper (right) */
.pmspace-report-donut-wrap {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Peity SVG will be injected; ensure responsive */
.pmspace-report-donut {
  display: inline-block;
}

/* Fallback textual representation */
.pmspace-report-donut-fallback {
  padding: 12px;
  background: #f7f7f7;
  border-radius: 6px;
  font-size: 12px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .pmspace-report-chart-row { flex-direction: column-reverse; }
  .pmspace-report-donut-wrap { margin-bottom: 10px; }
  .pmspace-legend-table thead th, .pmspace-legend-table tbody td { font-size: 12px; padding: 6px; }
}

/* Ensure table remains responsive on small screens */
@media (max-width: 720px) {
  .pmspace-student-report {
    font-size: 10px !important;
  }
  .pmspace-student-report th.pmspace-center,
  .pmspace-student-report td.pmspace-center {
    width: 80px;
  }
}

/* ===========================================================================
   LESSON TEMPLATE (templates/single-pm_lesson.php)
   =========================================================================== */

/* ── Full-width content background ────────────────────────────────────────── */
.pms-lesson-content-bg {
	width: 100%;
}
body.has-page-bg-image .pms-lesson-content-bg {
	background-color: rgba(255, 255, 255, 0.8);
}

/* ── Two-column flex layout (main + 300 px sidebar) ──────────────────────── */
#content.pms-lesson-layout {
	display: flex;
	flex-direction: row;
	max-width: var(--pmspace-content-width, 1180px);
	margin-left: auto;
	margin-right: auto;
	padding: 24px;
	gap: 32px;
	box-sizing: border-box;
	width: 100%;
}
#content.pms-lesson-layout #primary.site-main {
	flex: 1 1 0;
	min-width: 0;
}
#content.pms-lesson-layout #secondary.widget-area {
	width: 350px;
	flex-shrink: 0;
}
@media (max-width: 768px) {
	#content.pms-lesson-layout {
		flex-direction: column;
		padding: 16px;
		gap: 24px;
	}
	#content.pms-lesson-layout #secondary.widget-area {
		width: 100%;
	}
}

/* .pms-lesson-breadcrumbs outer strip — see consolidated rule above */
/* .pms-breadcrumbs nav styles   — see shared .pms-breadcrumbs block above */

/* ── Featured image with overlaid lesson title ────────────────────────────── */
.pms-lesson-featured-image-wrap {
	position: relative;
	width: 100%;
	margin-bottom: 0;
}
.pms-lesson-featured-img {
	width: 100%;
	display: block;
	height: auto;
}
.pms-lesson-img-title-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 2;
}
.pms-lesson-img-title {
	font-family: 'Pathway Gothic One', sans-serif;
	font-size: 60px;
	color: #ffffff;
	text-align: center;
	text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.75);
	margin: 0;
	padding: 0 20px;
	line-height: 1.1;
}
@media (max-width: 768px) {
	.pms-lesson-img-title {
		font-size: 36px;
	}
}

/* ── Bottom gradient fade (last 30% of image) ────────────────────────────── */
.pms-lesson-featured-image-wrap::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 30%;
	background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.9) 100%);
	pointer-events: none;
	z-index: 1;
}

/* ── Prev / Next lesson navigation ───────────────────────────────────────── */
.pms-lesson-nav-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: -24px;
	margin-bottom: 28px;
	position: relative;
	z-index: 3;
	padding: 0 8px;
}
.pm-navigate-lesson {
	font-family: 'Pathway Gothic One', sans-serif;
	font-size: 14pt;
	color: var(--global-palette1);
	text-decoration: none;
	transition: color 0.2s;
}
.pm-navigate-lesson:hover {
	color: var(--global-palette2);
	text-decoration: none;
}

/* ── SCORM block ──────────────────────────────────────────────────────────── */
.pms-lesson-scorm {
	margin-bottom: 28px;
}

/* ── SCORM launch button ──────────────────────────────────────────────────── */
.pms-lesson-scorm button.fancybox,
.pms-lesson-scorm a.fancybox {
	display: inline-block;
	box-shadow:1px 1px 2px 0px #95a5a6;
	background-color: var(--global-palette1);
	color: #fff;
	padding: 8px 18px;
	border: none;
	border-radius: 4px;
	font-family: 'Inter', Arial, sans-serif;
	font-size: 12pt;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease;
}
.pms-lesson-scorm button.fancybox:hover,
.pms-lesson-scorm a.fancybox:hover {
	box-shadow:none;
	background-color: var(--global-palette2);
	color: var(--global-palette3);
}

/* ── Mark-as-complete button ──────────────────────────────────────────────── */
#pm-mark-complete-btn {
	display: inline-block;
	box-shadow:1px 1px 2px 0px #95a5a6;
	background-color: var(--global-palette1);
	color: #fff;
	padding: 8px 18px;
	border: none;
	border-radius: 4px;
	font-family: 'Inter', Arial, sans-serif;
	font-size: 12pt;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
#pm-mark-complete-btn:hover {
	box-shadow:none;
	background-color: var(--global-palette2);
	color: var(--global-palette3);
}

/* ── Completion controls ──────────────────────────────────────────────────── */
.pms-lesson-complete {
	/* margin-top: 32px; */
	text-align: center;
}
.pms-lesson-mark-complete {
	margin-bottom: 16px;
}
.pms-lesson-status-block {
	margin-top: 12px;
}

/*  class="pm-icons pm-icons-check" */
/* .lesson-complete-msg ::before {
    content: "\e957";
    font-family: 'PM Space Icons' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
	padding-bottom:0.1em;	/* small adjustment to position relative to text *
    line-height: 1;
    color: currentColor;   /* matches the text immediately to its right *
    margin-right: 2px;
    font-size: 0.8em;
} */

/* ── Sidebar Lesson Notice for Logged-out Users ────────────────────────────── */
.pm-return-to-course {
	padding:24px;
	border: 3px solid;
	border-radius:10px;
	border-color:var(--global-palette1);
	background: var(--global-palette8);
	position: sticky;
	top:60px;
}

.pm-return-to-course .pm-icons-padlock-closed {
	font-size: 48px;
	margin-bottom:24px;
	color: var(--global-palette3);
}

.pm-return-to-course:hover {
	background: var(--global-palette9);
	border-color:var(--global-palette2);
	transition: background-color 0.6s ease;
	transition: border-color 0.6s ease;
}

/* ==========================================================================
   Mobile Responsive (≤ 600px)
   ========================================================================== */
@media (max-width: 600px) {

    /* ── Course lesson table: stack status column below lesson name ── */
    .pmspace-lesson-table,
    .pmspace-lesson-table tbody,
    .pmspace-lesson-table tr,
    .pmspace-lesson-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    /* Visually separate the stacked status cell */
    .pmspace-lesson-table tr td:last-child:not(:first-child) {
        padding-left: 2em;
        border-top: none;
        padding-bottom: 8px;
    }

    /* ── Course table shortcode: same stacking ── */
    .pmspace-course-table,
    .pmspace-course-table tbody,
    .pmspace-course-table tr,
    .pmspace-course-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    /* Hide the "Status" column header — it's obvious when stacked */
    .pmspace-course-table thead th:last-child {
        display: none;
    }
    .pmspace-course-table tr td:last-child {
        border-top: none;
        padding-bottom: 12px;
    }

    /* ── Student report: controls row wraps ── */
    .pmspace-controls-row {
        flex-wrap: wrap;
    }
    .pmspace-controls-row > label {
        flex: 0 0 100%;
    }
    .pmspace-controls-row > select,
    .pmspace-controls-row select {
        flex: 1 1 auto;
        min-width: 0 !important;
        width: 100%;
    }
    /* Export button wrapper: full width, no auto margins */
    .pmspace-controls-row > div {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
    }
    .pmspace-controls-row > div button {
        width: 100%;
        justify-content: center;
    }

    /* ── Progress report: donut stacks above table ── */
    .pmspace-progress-layout {
        flex-direction: column;
    }
    #pmspace-frontend-chart {
        max-width: 100% !important;
        display: flex;
        justify-content: center;
    }
    .pmspace-progress-layout > div {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* ── Progress report: rotate narrow column headers ── */
    .pmspace-student-report .widefat th.pmspace-center,
    .pmspace-student-report .widefat th:nth-child(2),
    .pmspace-student-report .widefat th:nth-child(5),
    .pmspace-student-report .widefat th:nth-child(6) {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        white-space: nowrap;
        height: 80px;
        vertical-align: bottom;
        padding: 4px 2px;
        font-size: 11px;
    }

    /* ── Lesson Views: chart appears above the list table ── */
    /* column-reverse puts the DOM-second element (chart) visually first */
    .pmspace-lesson-visit-report {
        flex-direction: column-reverse;
        flex-wrap: wrap !important;
    }
    .pmspace-lesson-visit-list,
    .pmspace-lesson-visit-chart {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    /* Remove left indent that only makes sense in the side-by-side layout */
    .pmspace-lesson-visit-list ul {
        margin-left: 0 !important;
    }
}
