/* ==========================================================================
   tryit_LMS
   Layout and component styles. Every colour is a custom property, so the
   whole platform can be rethemed by editing the :root block below.
   ========================================================================== */

:root {
  /* Brand */
  --primary:        #006fbf;
  --primary-dark:   #004489;
  --primary-light:  #e8f8ff;
  --primary-hover:  #004489;

  /* Text */
  --text:           #202122;
  --text-secondary: #494c4e;
  --text-muted:     #6e7477;
  --text-inverse:   #ffffff;

  /* Surfaces */
  --bg:             #ffffff;          /* tool pages */
  --bg-sunken:      #f6f7f8;          /* My Home and Course Home */
  --surface:        #ffffff;
  --surface-alt:    #f9fbff;
  --surface-hover:  #f1f5fb;

  /* Lines */
  --border:         #cdd5dc;
  --border-light:   #e3e9f1;
  --border-strong:  #6e7477;          /* inputs, checkboxes, editor frame */

  /* Control fills */
  --btn-secondary-bg:       #e3e9f1;
  --btn-secondary-bg-hover: #cdd5dc;

  /* Status */
  --success:        #46a661;
  --success-bg:     #eaf6ed;
  --success-text:   #027a21;
  --warning:        #e87511;
  --warning-bg:     #fdf1e6;
  --warning-text:   #ba4700;
  --danger:         #cd2026;
  --danger-bg:      #fbeaea;
  --info:           #0c7c84;
  --info-bg:        #e6f3f4;
  --badge-count:    #ba4700;

  /* Shape */
  --radius:         6px;
  --radius-lg:      8px;
  --shadow-sm:      0 2px 4px 0 rgba(0,0,0,.03);
  --shadow:         0 4px 8px 0 rgba(0,0,0,.03);
  --shadow-lg:      0 2px 12px 0 rgba(0,0,0,.15);
  --shadow-input:   inset 0 2px 0 0 rgba(177,185,190,.2);

  /* Metrics */
  --minibar-h:      90px;
  --navbar-h:       62px;
  --band-h:         4px;
  --page-max:       1230px;
  --gutter:         30px;
  --control-h:      42px;             /* buttons and inputs share this */

  /* Type scale. Sizes are measured values; everything sizes off these so a
     future change is one line rather than a sweep of the whole file. */
  --fs-body:        19px;   --lh-body:        28px;
  --fs-title:       40px;   --lh-title:       48px;
  --fs-section:     30px;   --lh-section:     36px;
  --fs-h3:          20px;   --lh-h3:          30px;
  --fs-h4:          16px;   --lh-h4:          24px;
  --fs-widget:      16px;   --lh-widget:      19.2px;
  --fs-course:      25px;
  --fs-nav:         19px;
  --fs-compact:     16px;   --lh-compact:     24px;
  --fs-small:       14px;   --lh-small:       20px;
  --fs-label:       14px;   --lh-label:       18px;
  --fs-input:       16px;   --lh-input:       24px;
  --fs-th:          14px;   --lh-th:          18px;
  --fs-td:          16px;   --lh-td:          28px;

  --font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: .2px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* Homepages sit on a sunken background; tool pages are white. */
body.page-home { background: var(--bg-sunken); }
body.page-tool { background: var(--bg); }

img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
button { font-family: inherit; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-weight: 400; color: var(--text); }
h1 { font-size: var(--fs-title);   line-height: var(--lh-title); }
h2 { font-size: var(--fs-section); line-height: var(--lh-section); }
h3 { font-size: var(--fs-h3);      line-height: var(--lh-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4);      line-height: var(--lh-h4); font-weight: 700; }
/* Section headings inside forms use the 30px section size, not h3. */
form h2, form h3, .form-section-title {
  font-size: var(--fs-section); line-height: var(--lh-section);
  font-weight: 400; padding-bottom: 15px;
}
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.6em; }
hr { border: 0; border-top: 1px solid var(--border-light); margin: 24px 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Page frame: brand band, header, nav band -------------------------- */
/* The header and nav band scroll away with the page, as in the reference. */
.brand-band { height: var(--band-h); background: var(--primary); width: 100%; }

.minibar {
  position: static;
  height: var(--minibar-h);
  background: var(--surface);
  display: block;
}
/* Backgrounds run full width; only the contents are constrained. */
.minibar-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter);
  height: 100%; display: flex; align-items: center; gap: 4px;
}
/* Five stacked dots, the reference's divider between header clusters. */
.minibar-divider {
  width: 24px; height: 24px; flex: none; margin: 0 9px;
  background-image: radial-gradient(circle, var(--border) 1.5px, transparent 1.6px);
  background-size: 3px 5px; background-position: center;
  background-repeat: repeat-y;
}
.minibar-course {
  font-size: var(--fs-course); font-weight: 400; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.minibar-course:hover { color: var(--primary); text-decoration: none; }
/* Two classes deep so it beats the generic .avatar rule defined further down. */
.avatar.minibar-avatar {
  width: 42px; height: 42px; border-radius: var(--radius);
  font-size: var(--fs-h4); line-height: var(--lh-h4);
}
.minibar-logo { display: flex; align-items: center; gap: 10px; margin-right: 12px; }
.minibar-logo:hover { text-decoration: none; }
.minibar-logo .mark {
  width: 34px; height: 34px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px;
}
.minibar-logo .wordmark { font-size: 19px; color: var(--text); font-weight: 700; letter-spacing: -.2px; }
.minibar-spacer { flex: 1 1 auto; }

/* Header items take the full 90px height; hover draws a 4px bar across the
   top edge, directly under the brand band, rather than a filled background. */
.minibar-item {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: var(--minibar-h); padding: 0 12px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-secondary); font-size: var(--fs-small);
  line-height: 22.4px;
}
.minibar-item::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: transparent;
}
.minibar-item:hover, .minibar-item[aria-expanded="true"] {
  color: var(--primary); text-decoration: none;
}
.minibar-item:hover::before, .minibar-item[aria-expanded="true"]::before {
  background: var(--primary);
}
.minibar-item:focus-visible { outline: none; color: var(--primary); }
.minibar-item:focus-visible::before { background: var(--primary); }
.minibar-item .caret { font-size: 10px; opacity: .7; }
.minibar-icon { width: 30px; height: 30px; display: block; color: var(--text-secondary); }
.minibar-item:hover .minibar-icon { color: var(--primary); }
.minibar-badge {
  position: absolute; top: 3px; right: 5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff;
  border-radius: 9px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }

/* --- Dropdowns --------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 500;
  min-width: 280px; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  display: none;
}
.dropdown-panel.open { display: block; }
.dropdown-panel.left { right: auto; left: 0; }
.dropdown-head {
  padding: 8px 16px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .4px;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: var(--text); font-size: 14px;
}
.dropdown-item:hover { background: var(--surface-hover); text-decoration: none; }
.dropdown-item .sub { display: block; font-size: 12px; color: var(--text-muted); }
.dropdown-empty { padding: 18px 16px; color: var(--text-muted); font-size: 14px; text-align: center; }
.dropdown-foot {
  border-top: 1px solid var(--border-light); margin-top: 4px; padding: 10px 16px 4px;
  font-size: 13px;
}
.course-swatch {
  width: 30px; height: 22px; border-radius: 3px; flex: none;
  background: var(--primary);
}

/* --- Nav band ----------------------------------------------------------- */
/* 62px including its 1px top and bottom borders; present on every page. */
.navband {
  position: static;
  background: var(--surface);
  border-top: 1px solid rgba(124,134,149,.18);
  border-bottom: 1px solid rgba(124,134,149,.18);
  height: var(--navbar-h);
  box-shadow: 0 4px 4px -4px rgba(0,0,0,.02);
}
.navband-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter);
  height: 100%; display: flex; align-items: center; gap: 20px;
}
.navband-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text); font-size: var(--fs-nav); line-height: 23px;
  letter-spacing: .2px; white-space: nowrap;
}
.navband-link:hover { color: var(--primary); text-decoration: underline; }
.navband-link.active { color: var(--primary); font-weight: 700; }
.navband-menu { display: flex; align-items: center; }

/* The old sticky course bar is gone; these remain for any stragglers. */
.navbar-title { font-size: var(--fs-course); font-weight: 400; color: var(--text); }

/* --- Page scaffolding -------------------------------------------------- */
.page { max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter) 60px; }
.page.wide { max-width: var(--page-max); }
.breadcrumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs .sep { margin: 0 7px; opacity: .6; }

/* Title row: 59px tall with a 30px gap under it, so a button row placed
   directly beneath lands where the reference puts it. */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 5px 0 6px; margin-bottom: 30px; flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
/* Action buttons sit under the title, left aligned to the content edge. */
.button-row { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 30px; }
/* Tables and lists sit directly on the page, with no card around them. */
.tool-block { padding: 19px 0 28.5px; }
.table-group-title {
  background: var(--surface-alt); border: 1px solid var(--border); border-bottom: 0;
  padding: 10px 14px; font-size: var(--fs-body); line-height: var(--lh-body);
}
/* The name link in a list row. */
.row-title-link { font-size: 17px; line-height: var(--lh-td); font-weight: 700; color: var(--primary); }
/* Headline-type inputs are capped rather than running the full width. */
.headline-input { max-width: 510px; }
.page-header .subtitle { color: var(--text-secondary); font-size: var(--fs-small); line-height: var(--lh-small); margin-top: 4px; }
.page-actions { display: flex; gap: 15px; flex-wrap: wrap; }

/* --- Buttons ----------------------------------------------------------- */
/* Every button is 42px tall with no border; secondary is a filled grey. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 30px; height: var(--control-h);
  border: 0; border-radius: var(--radius);
  background: var(--btn-secondary-bg); color: var(--text);
  font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 700;
  letter-spacing: .2px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.btn:hover { background: var(--btn-secondary-bg-hover); color: var(--text); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ad1a1f; color: #fff; }
.btn-subtle { background: transparent; color: var(--primary); padding: 0 12px; }
.btn-subtle:hover { background: transparent; color: var(--primary-hover); }
/* Icon-only button: square, transparent at rest. */
.btn-icon { padding: 0; width: var(--control-h); background: transparent; }
.btn-icon:hover { background: var(--btn-secondary-bg); }
.btn-sm { padding: 0 15px; height: 34px; font-size: 13px; }
.btn-lg { padding: 0 30px; height: 48px; font-size: var(--fs-compact); }
/* Buttons sitting in a row are 15px apart. */
.btn + .btn { margin-left: 0; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }

/* --- Forms ------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field > label, .field-label {
  display: block; font-size: var(--fs-label); line-height: var(--lh-label);
  font-weight: 700; margin-bottom: 8px; color: var(--text);
}
.field .hint { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-secondary); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 8px 15px; height: var(--control-h);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-family: inherit; font-size: var(--fs-input); line-height: var(--lh-input);
  letter-spacing: .4px; color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-input);
}
.select { padding: 9px 47px 9px 16px; }
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--primary); outline-offset: 2px; border-color: var(--border-strong);
}
.textarea { min-height: 120px; height: auto; resize: vertical; line-height: 1.55; }
.textarea.code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; }
.input-sm { padding: 5px 8px; height: 34px; font-size: 13px; }
.checkline { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: var(--fs-compact); line-height: var(--lh-compact); }
.checkline input { margin-top: 3px; flex: none; }
input[type=checkbox] {
  width: 24px; height: 24px; flex: none; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface-alt);
  accent-color: var(--primary);
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 220px; }

/* Sticky form footer: a full-bleed band pinned to the bottom of the viewport
   on every editor, with the rest of the form scrolling behind it. */
.form-actions, .builder-footer {
  position: sticky; bottom: 0; z-index: 200;
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
  height: 73px; padding: 16px 0 0; margin-top: 30px;
  background: rgba(255,255,255,.88);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 4px 0 rgba(32,33,34,.2);
}

/* --- Cards and widgets ------------------------------------------------- */
/* Widgets have no border: white fill, 8px radius and a very soft shadow. */
.card, .widget {
  min-width: 0;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 15px 20px 20px;
  margin-bottom: 30px;
}
/* No divider under a widget title; content starts directly below it. */
.widget-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0; border-bottom: 0; min-height: 40px;
}
.widget-head h2 {
  margin: 0; font-size: var(--fs-widget); line-height: var(--lh-widget); font-weight: 700;
}
.widget-body { padding: 0; }
.widget-body.flush { padding: 0; }
.widget-foot {
  padding: 12px 0 0; border-top: 1px solid var(--border-light);
  font-size: var(--fs-small);
}
.card-body { padding: 0; }

/* Empty state: a bordered box, not centred grey text. */
.empty {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 30px; color: var(--text);
  font-size: var(--fs-compact); line-height: var(--lh-compact);
}
.empty .empty-icon { font-size: 30px; opacity: .35; display: block; margin-bottom: 10px; }

/* --- Grid -------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 22px; align-items: start; }
.grid-even { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: start; }
@media (max-width: 767px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- Course tiles ------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 15px; row-gap: 15px; }
/* No shadow at rest; the tile lifts only on hover. */
.tile {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: none; display: block; color: inherit;
  transition: box-shadow .15s ease;
}
.tile:hover { box-shadow: 0 2px 14px 1px rgba(0,0,0,.06); text-decoration: none; }
.tile:hover .tile-name { color: var(--primary); }
.tile-banner {
  aspect-ratio: 2.24; background: var(--primary); position: relative;
  border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
}
.tile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-body { padding: 17px 15px 12px; }
.tile-name {
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400;
  color: var(--text);
}
.tile-meta { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 5px; }
.tile-progress { margin-top: 10px; }

/* --- Progress bars ----------------------------------------------------- */
.progress { height: 8px; background: var(--border-light); border-radius: 5px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.progress.success > span { background: var(--success); }
.progress-label { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* --- Badges and pills -------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 11px;
  font-size: 12px; font-weight: 700; line-height: 1.7;
  background: var(--surface-hover); color: var(--text-secondary);
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: #26702f; }
.badge-warning { background: var(--warning-bg); color: #8a4708; }
.badge-danger  { background: var(--danger-bg);  color: #9b1418; }
.badge-info    { background: var(--info-bg);    color: #0a5f66; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

/* --- Tables ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-td); }
.table th, .table td {
  padding: 14px; text-align: left; vertical-align: middle;
  border: 1px solid var(--border);
}
.table td { font-size: var(--fs-td); line-height: var(--lh-td); color: var(--text); }
.table thead th {
  background: var(--surface-alt);
  font-size: var(--fs-th); line-height: var(--lh-th); font-weight: 400;
  color: var(--text); white-space: nowrap;
  border: 1px solid var(--border);
}
/* Rounded outer corners on the header row, as in the reference. */
.table thead th:first-child { border-top-left-radius: var(--radius); }
.table thead th:last-child  { border-top-right-radius: var(--radius); }
.table tbody tr:hover { background: var(--surface-alt); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .muted { color: var(--text-muted); }
.table-row-head td { background: var(--surface-hover); font-weight: 700; }

/* --- Alerts ------------------------------------------------------------ */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--radius);
  border: 1px solid var(--border-light); margin-bottom: 18px; font-size: 14px;
}
.alert p:last-child { margin-bottom: 0; }
.alert-info    { background: var(--info-bg);    border-color: #b9dfe2; }
.alert-success { background: var(--success-bg); border-color: #bce0c6; }
.alert-warning { background: var(--warning-bg); border-color: #f5d4ae; }
.alert-danger  { background: var(--danger-bg);  border-color: #edbcbd; }
.alert .alert-icon { font-size: 17px; line-height: 1.3; }

/* --- Utilities --------------------------------------------------------- */
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }
.strong { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.stack > * + * { margin-top: 14px; }
.divide > * + * { border-top: 1px solid var(--border-light); padding-top: 14px; margin-top: 14px; }

/* ==========================================================================
   Tool-specific styles
   ========================================================================== */

/* --- Login ------------------------------------------------------------- */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 480px;
  background: var(--surface);
}
.login-art {
  background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary) 55%, #0d8fb5 100%);
  color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center;
}
.login-art h1 { color: #fff; font-size: 40px; font-weight: 300; max-width: 15ch; line-height: 1.15; }
.login-art p { font-size: 17px; opacity: .9; max-width: 44ch; }
.login-art .mark-lg {
  width: 58px; height: 58px; border-radius: 12px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 26px; font-weight: 700; margin-bottom: 28px;
}
.login-form-wrap { padding: 60px 56px; display: flex; flex-direction: column; justify-content: center; }
.login-form-wrap h2 { font-size: 25px; margin-bottom: 6px; }
.demo-accounts {
  margin-top: 28px; padding: 16px; background: var(--surface-alt);
  border: 1px solid var(--border-light); border-radius: var(--radius); font-size: 13px;
}
.demo-accounts h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.demo-accounts table { width: 100%; border-collapse: collapse; }
.demo-accounts td { padding: 3px 0; }
.demo-accounts code {
  background: var(--surface); border: 1px solid var(--border-light);
  padding: 1px 6px; border-radius: 3px; font-size: 12px;
}
@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 40px 28px; }
  .login-art h1 { font-size: 30px; }
  .login-form-wrap { padding: 36px 28px; }
}

/* --- Content: the two-panel lessons app -------------------------------- */
/* Fills the viewport below the nav band; each panel scrolls on its own. */
.lessons-app-outer { max-width: var(--page-max); margin: 0 auto; }
.lessons-app {
  max-width: var(--page-max); margin: 0 auto;
  display: grid; grid-template-columns: 335px minmax(0, 1fr);
  height: calc(100vh - 156px);
  background: var(--surface);
}
.lessons-nav {
  width: 335px; background: var(--surface);
  border-right: 1px solid var(--border);
  padding-top: 4px; overflow-y: auto;
}
.lessons-nav-header {
  display: flex; align-items: center; gap: 4px;
  height: 70px; padding: 0 6px;
  border-bottom: 1px solid var(--border);
}
.lessons-nav-action { font-size: 15px; font-weight: 700; padding: 0 8px; }
.lessons-nav-spacer { flex: 1 1 auto; }
.lessons-search { position: sticky; top: 0; background: var(--surface); padding: 14px 24px; z-index: 2; }
.lessons-search-input { width: 275px; max-width: 100%; }
.lessons-rows { padding-bottom: 20px; }

/* A row is 46px tall: colour bar at the left, title at 16px/24px. */
.lessons-row {
  position: relative; display: flex; align-items: center; gap: 9px;
  width: 100%; height: 46px; padding: 0 12px 0 69px;
  background: none; border: 3px solid transparent; border-radius: var(--radius);
  font-family: inherit; text-align: left; color: var(--text); cursor: pointer;
}
.lessons-row-bar {
  position: absolute; left: 30px; top: 3px;
  width: 3px; height: 40px; border-radius: 3px;
}
.lessons-row-title {
  font-size: var(--fs-compact); line-height: 20px; font-weight: 400; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lessons-row:hover { background: var(--primary-light); text-decoration: none; }
.lessons-row:hover .lessons-row-title { color: var(--primary-hover); }
.lessons-row.active {
  background: var(--surface-alt); border: 3px solid var(--primary); border-radius: var(--radius);
}
.lessons-unit-head .twisty {
  position: absolute; left: 39px; font-size: 10px; color: var(--text-muted);
  transition: transform .15s ease;
}
.lessons-unit-head[aria-expanded="false"] .twisty { transform: rotate(-90deg); }
.lessons-topics { list-style: none; margin: 0; padding: 0; }
.lessons-topics.collapsed { display: none; }
.lessons-empty-row {
  display: block; padding: 8px 18px 8px 69px;
  font-size: var(--fs-small); color: var(--text-muted);
}
.toc-tick { flex: none; width: 15px; font-size: 12px; }
.toc-tick.done { color: var(--success); }
.toc-tick.todo { color: var(--border); }

/* Right panel */
.lessons-content { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.lessons-content-header {
  display: flex; align-items: center; gap: 10px;
  height: 70px; padding: 0 15px; flex: none;
  border-bottom: 1px solid var(--border);
}
.lessons-body { flex: 1 1 auto; overflow-y: auto; padding: 0 15px 60px; }
.lessons-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 400; margin: 30px 0; }
.lessons-description { font-size: var(--fs-body); line-height: 24px; color: var(--text-secondary); }
.lessons-unit-block { margin-bottom: 34px; }
.lessons-unit-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lessons-unit-title h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; }

/* Visible/Hidden switch: 64x34 track with the knob inside. */
.switch-field { display: flex; align-items: center; gap: 10px; }
.switch {
  position: relative; display: inline-block; width: 64px; height: 34px;
  border-radius: 20px; padding: 2px; background: var(--surface);
  border: 1px solid var(--border); flex: none;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--border); transition: transform .15s ease, background .15s ease;
}
.switch input:checked ~ .switch-knob { transform: translateX(30px); background: var(--primary); }
.switch-label { font-size: 15px; line-height: 18px; }

.content-main { padding: 26px 34px 44px; min-width: 0; }
.content-main .topic-title { margin-bottom: 4px; }
.topic-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted);
  padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--border-light);
}
.topic-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border-light);
}

/* --- List rows (assignments, quizzes, discussions) --------------------- */
.list-group { border-top: 1px solid var(--border-light); }
.list-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-light);
}
.list-row:hover { background: var(--surface-alt); text-decoration: none; }
a.list-row, a.list-row:hover, a.tile, a.tile:hover { text-decoration: none; }
.list-row .lr-main { flex: 1 1 auto; min-width: 0; }
.list-row .lr-title { font-size: 15px; font-weight: 700; }
.list-row .lr-sub {
  font-size: 13px; color: var(--text-muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis;
}
.list-row .lr-side { flex: none; text-align: right; font-size: 13px; color: var(--text-secondary); }
.list-section-head {
  padding: 10px 20px; background: var(--surface-hover);
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

/* --- Announcements ----------------------------------------------------- */
.announcement { padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.announcement:last-child { border-bottom: 0; }
.announcement h3 { margin-bottom: 3px; font-size: 15px; }
.announcement .ann-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.announcement .ann-body { font-size: 14px; color: var(--text-secondary); }
.announcement .ann-body p:last-child { margin-bottom: 0; }

/* --- Grades ------------------------------------------------------------ */
.grades-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grades-grid th, .grades-grid td {
  border: 1px solid var(--border-light); padding: 8px 10px; text-align: center;
  white-space: nowrap;
}
.grades-grid thead th {
  background: var(--surface-alt); font-weight: 700; color: var(--text-secondary);
  position: sticky; top: 0; z-index: 2; font-size: 12px;
}
.grades-grid th.student-col, .grades-grid td.student-col {
  text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1;
  min-width: 210px; box-shadow: 1px 0 0 var(--border-light);
}
.grades-grid thead th.student-col { background: var(--surface-alt); z-index: 3; }
.grades-grid tbody tr:hover td { background: var(--surface-alt); }
.grades-grid tbody tr:hover td.student-col { background: var(--surface-hover); }
.grades-grid .cat-col { background: var(--primary-light); font-weight: 700; }
.grades-grid .total-col { background: var(--surface-hover); font-weight: 700; }
.grade-input {
  width: 62px; padding: 4px 6px; text-align: right;
  border: 1px solid var(--border); border-radius: 4px;
  font-family: inherit; font-size: 13px;
}
.grade-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.grade-input.dirty { border-color: var(--warning); background: var(--warning-bg); }
.grade-scroll { overflow: auto; max-height: 72vh; border: 1px solid var(--border-light); border-radius: var(--radius); }

.grade-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.stat .stat-value { font-size: 27px; font-weight: 300; margin-top: 4px; line-height: 1.1; }
.stat .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- Quiz -------------------------------------------------------------- */
.quiz-layout { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 22px; align-items: start; }
@media (max-width: 767px) { .quiz-layout { grid-template-columns: 1fr; } }
.qnav { position: sticky; top: 16px; }
.qnav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.qnav-btn {
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--text-secondary); display: grid; place-items: center;
}
.qnav-btn:hover { border-color: var(--primary); color: var(--primary); }
.qnav-btn.answered { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.qnav-btn.current { outline: 2px solid var(--primary); outline-offset: 1px; }
.qnav-btn.correct { background: var(--success-bg); border-color: var(--success); color: #26702f; }
.qnav-btn.incorrect { background: var(--danger-bg); border-color: var(--danger); color: #9b1418; }

.question {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.question-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 20px; background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
}
.question-body { padding: 20px; }
.question-body > p:first-child { margin-top: 0; }
.option {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px; border: 1px solid var(--border-light);
  border-radius: var(--radius); margin-bottom: 9px; cursor: pointer; font-size: 14px;
}
.option:hover { background: var(--surface-alt); border-color: var(--border); }
.option input { margin-top: 3px; flex: none; }
.option.selected { background: var(--primary-light); border-color: var(--primary); }
.option.is-correct { background: var(--success-bg); border-color: var(--success); }
.option.is-wrong { background: var(--danger-bg); border-color: var(--danger); }
.option .opt-tag { margin-left: auto; font-size: 12px; font-weight: 700; }

.quiz-timer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--radius);
  background: var(--surface-hover); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 15px;
}
.quiz-timer.urgent { background: var(--danger-bg); color: #9b1418; }

/* --- Discussions ------------------------------------------------------- */
.post {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 20px; margin-bottom: 14px;
}
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.post-head .who { font-weight: 700; font-size: 14px; }
.post-head .when { font-size: 12px; color: var(--text-muted); }
.post-subject { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.post-body { font-size: 14px; color: var(--text-secondary); }
.post-body p:last-child { margin-bottom: 0; }
.post-actions { margin-top: 12px; display: flex; gap: 8px; }
.post-replies { margin-left: 34px; padding-left: 18px; border-left: 2px solid var(--border-light); }
@media (max-width: 767px) { .post-replies { margin-left: 8px; padding-left: 12px; } }

/* --- Calendar ---------------------------------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
            border-top: 1px solid var(--border-light); }
.cal-dow {
  padding: 9px 6px; text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text-secondary); background: var(--surface-alt);
  border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
}
.cal-dow:last-child { border-right: 0; }
.cal-cell {
  min-height: 108px; padding: 6px 7px; min-width: 0; overflow: hidden;
  border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.other-month { background: var(--surface-alt); }
.cal-cell.today { background: var(--primary-light); }
.cal-date { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 5px; }
.cal-cell.today .cal-date {
  background: var(--primary); color: #fff; width: 23px; height: 23px;
  border-radius: 50%; display: grid; place-items: center; font-size: 12px;
}
.cal-event {
  display: block; font-size: 11px; line-height: 1.35; padding: 3px 6px;
  border-radius: 3px; margin-bottom: 3px;
  background: var(--primary-light); color: var(--primary-dark);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-event:hover { text-decoration: none; filter: brightness(.96); }
.cal-event.due { background: var(--warning-bg); color: #8a4708; }
.cal-event.quiz { background: var(--info-bg); color: #0a5f66; }
.cal-event.class { background: var(--surface-hover); color: var(--text-secondary); }
.cal-event.module { background: var(--success-bg); color: #26702f; }
.cal-event.material { background: var(--surface-alt); color: var(--text-secondary); }
@media (max-width: 767px) { .cal-cell { min-height: 74px; } .cal-event { font-size: 10px; } }

/* Question Library picker inside the quiz builder. */
.qb-library {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border-light); border-radius: var(--radius);
}
.qb-library .list-row:hover { background: var(--surface-hover); }

/* Grade rows a category's drop rule excludes from its subtotal. */
.table tbody tr.is-dropped td { opacity: .55; }
.table tbody tr.is-dropped td:first-child { text-decoration: line-through; }
.table tbody tr.cat-subtotal td {
  background: var(--surface-alt); border-top: 1px solid var(--border-light);
}

/* Inherited values shown on a form but owned by a tier above it. */
.input[readonly] {
  background: var(--surface-alt); color: var(--text-secondary); cursor: default;
}
.input[readonly]:focus { box-shadow: none; border-color: var(--border); }

/* Event Type filter. Unbuilt tools stay listed but dimmed and disabled. */
.cal-types { display: flex; flex-wrap: wrap; gap: 7px 18px; }
.cal-type { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cal-type input { cursor: pointer; }
.cal-type.is-disabled { color: var(--text-muted); cursor: not-allowed; opacity: .6; }
.cal-type.is-disabled input { cursor: not-allowed; }

/* --- Classlist --------------------------------------------------------- */
.person { display: flex; align-items: center; gap: 11px; }
.person .who { font-weight: 700; font-size: 14px; }
.person .sub { font-size: 12px; color: var(--text-muted); }

/* --- File chips -------------------------------------------------------- */
.file-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px; border: 1px solid var(--border-light);
  border-radius: var(--radius); background: var(--surface-alt);
  font-size: 13px; margin: 0 8px 8px 0;
}
.file-chip .fsize { color: var(--text-muted); font-size: 12px; }

/* --- Tabs -------------------------------------------------------------- */
/* Tool-area sub-nav: a row of links over a single rule. The selected one is
   bold blue text — the reference has no underline bar here. */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  padding-bottom: 8px; margin-bottom: 22px; overflow-x: auto;
}
.tab {
  padding: 0 15px; font-size: var(--fs-compact); line-height: var(--lh-compact);
  color: var(--text); border-bottom: 0; white-space: nowrap;
}
.tab:first-child { padding: 0 15px 0 0; }
.tab:hover { color: var(--primary); text-decoration: none; }
.tab.active { color: var(--primary); font-weight: 700; border-bottom: 0; }

/* --- Print ------------------------------------------------------------- */
@media print {
  .minibar, .navband, .brand-band, .toc, .topic-nav, .page-actions, .btn { display: none !important; }
  .content-layout { grid-template-columns: 1fr; border: 0; box-shadow: none; }
  body { background: #fff; }
}

/* ==========================================================================
   My Home, Daylight-style hero and course filter tabs
   ========================================================================== */

.home-banner-wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.home-hero {
  position: relative;
  height: 200px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 55%, #0d8fb5 100%);
  overflow: hidden;
}
.home-hero-overlay {
  position: absolute; inset: 0;
  /* faint instrument-panel motif so the band is not a flat colour */
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.10) 0 32%, transparent 33%),
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.08) 0 46%, transparent 47%),
    linear-gradient(90deg, rgba(0,0,0,.34) 0%, rgba(0,0,0,.12) 45%, transparent 75%);
}
.home-hero-inner {
  position: relative;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 26px;
  color: #fff;
}
.home-hero-inner h1 {
  color: #fff;
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 300;
  letter-spacing: -.5px;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.home-hero-inner p {
  margin: 6px 0 0;
  font-size: 15px;
  opacity: .92;
}

/* Two equal columns, 60px apart, on both homepages. */
.home-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: start; margin-top: 30px;
}
.home-side { display: flex; flex-direction: column; }
/* Banner ends at 356; widget area starts 10px under it. Course Home has no
   banner, so its widget area starts 40px under the nav band instead. */
.page.home-page { padding-top: 10px; }
.page.course-home-page { padding-top: 40px; }
@media (max-width: 767px) { .home-grid { grid-template-columns: 1fr; gap: 30px; } }

/* Course filter tabs: scroll sideways rather than wrap, like the real widget */
.course-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: thin;
}
.course-tab {
  flex: none;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-compact);
  line-height: var(--lh-compact);
  color: var(--text);
  height: 48px; padding: 0 12px;
  position: relative;
  border-bottom: 0;
  white-space: nowrap;
}
.course-tab-bar {
  position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 4px; border-radius: 4px 4px 0 0; background: transparent;
}
.course-tab:hover { color: var(--primary); }
.course-tab.active { color: var(--primary); font-weight: 700; }
.course-tab.active .course-tab-bar { background: var(--primary); }
.course-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.tile[hidden] { display: none !important; }

/* ==========================================================================
   Grouped course navbar (D2L Daylight-style dropdown menus)
   ========================================================================== */
.navband-menu { position: relative; }
.navband-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.navband-menu-toggle .caret { font-size: 9px; opacity: .65; }
.navband-menu-toggle[aria-expanded="true"] { background: var(--surface-hover); color: var(--text); }
/* Navbar menus open downward and left-aligned, unlike the minibar's */
.navband-menu .dropdown-panel {
  top: calc(100% + 4px);
  left: 0;
  right: auto;
  min-width: 220px;
}
.navband-menu .dropdown-item.active { color: var(--primary); font-weight: 700; background: var(--primary-light); }

/* ==========================================================================
   Content Navigator widget (per-unit completion rings) on the course home
   ========================================================================== */
.nav-progress-list { display: flex; flex-direction: column; }
.nav-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  height: 84px;
  border-bottom: 1px solid var(--border-light);
  color: inherit;
}
.nav-progress-row:last-child { border-bottom: 0; }
.nav-progress-row:hover { background: var(--primary-light); color: var(--primary-hover); text-decoration: none; }
.nav-progress-row .npr-title { flex: 1 1 auto; font-size: var(--fs-compact); line-height: 20px; font-weight: 400; order: -1; }
.nav-progress-row .npr-chev { color: var(--text-muted); flex: none; }
.ring {
  --pct: 0;
  --ring-color: var(--primary);
  flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--border-light) 0);
}
.ring > span {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ring.done { --ring-color: var(--success); }

/* ==========================================================================
   D2L-style activity builder shell (quizzes, and reused for assignments)
   ========================================================================== */
.builder-topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.builder-topbar .back { font-size: 14px; color: var(--primary); white-space: nowrap; }
.builder-topbar .bt-title { font-size: 18px; font-weight: 400; color: var(--text-secondary); }

.builder-wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 96px; }
.builder-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 767px) { .builder-grid { grid-template-columns: 1fr; } }

.builder-main .field label, .builder-main .field-label { font-weight: 700; }
.builder-gradeline { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.builder-gradeline .pts { font-weight: 700; }
.builder-gradeline .sep { color: var(--border); }

/* Settings accordion (native details/summary) */
.accordion { display: flex; flex-direction: column; gap: 14px; }
.acc-item {
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
.acc-item > summary {
  list-style: none; cursor: pointer; padding: 15px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.acc-item > summary::-webkit-details-marker { display: none; }
.acc-item > summary .acc-title { font-family: var(--font-display, inherit); font-weight: 700; font-size: 16px; }
.acc-item > summary .acc-caret { color: var(--text-muted); transition: transform .15s ease; }
.acc-item[open] > summary .acc-caret { transform: rotate(90deg); }
.acc-summary { padding: 0 18px 14px; font-size: 13px; color: var(--text-muted); }
.acc-item[open] .acc-summary { display: none; }
.acc-body { padding: 4px 18px 18px; border-top: 1px solid var(--border-light); }
.acc-body .field:last-child { margin-bottom: 0; }

/* Sticky footer */
.builder-footer {
  position: sticky; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -2px 6px rgba(0,0,0,.06);
}
.builder-footer .spacer { flex: 1 1 auto; }
.builder-footer .vis-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-secondary); }

/* iOS-style visibility switch */
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0; border-radius: 12px; background: var(--border);
  transition: background .15s ease;
}
.switch .track::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Questions list in the builder */
.qb-questions { border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.qb-actions { display: flex; gap: 10px; align-items: center; margin: 8px 0 4px; }
.qb-empty { text-align: center; color: var(--text-muted); padding: 34px 20px; }
.qb-empty .big { font-size: 19px; font-weight: 400; color: var(--text-secondary); margin-bottom: 4px; }

/* Modal (question editor) */
dialog.modal {
  border: 0; border-radius: var(--radius-lg); padding: 0; width: min(680px, 94vw);
  box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface);
}
dialog.modal::backdrop { background: rgba(20,16,24,.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head .x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 18px 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ==========================================================================
   Rich-text editor (self-contained; mirrors the D2L content editor)
   ========================================================================== */
.rte { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.rte-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 6px 8px; background: var(--surface-alt); border-bottom: 1px solid var(--border-light);
}
.rte-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent;
  background: none; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--text);
}
.rte-btn:hover { background: var(--surface-hover); border-color: var(--border-light); }
.rte-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.rte-div { width: 1px; height: 20px; background: var(--border-light); margin: 0 4px; }
.rte-surface {
  padding: 14px 16px; outline: none; overflow-y: auto; max-width: none;
  font-size: 15px; line-height: 1.6;
}
.rte-surface:focus { box-shadow: inset 0 0 0 2px var(--primary-light); }
.rte-surface:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.rte-textarea {
  width: 100%; border: 0; padding: 14px 16px; resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.55;
}
.rte-textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary-light); }
.rte.source-mode .rte-source-toggle { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* --- Calendar: list view with a sidebar -------------------------------- */
.cal-toolbar-wrap { max-width: var(--page-max); margin: 0 auto 30px; padding: 0 var(--gutter); }
.cal-toolbar {
  display: flex; align-items: center; gap: 15px;
  height: 65px; padding: 10px 20px 0;
  background: var(--surface-alt);
  border-bottom: 1px solid #cccccc;
}
.cal-toolbar-spacer { flex: 1 1 auto; }
.cal-toolbar-links { display: flex; gap: 18px; font-size: var(--fs-compact); }

/* Segmented control, shared with Course Admin's Category | Name toggle. */
.segmented { display: inline-flex; height: 44px; }
.segment {
  display: inline-flex; align-items: center; padding: 11px 30px;
  font-size: var(--fs-label); line-height: 20px; font-weight: 700; letter-spacing: .4px;
  background: var(--btn-secondary-bg); color: var(--text);
  border: 1px solid var(--border); border-right: 0;
}
.segment:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.segment:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.segment:hover { text-decoration: none; background: var(--btn-secondary-bg-hover); }
.segment.selected { background: #494c4e; color: #fff; border-color: #494c4e; }
.segment.is-disabled { opacity: .5; cursor: default; }

.cal-layout {
  max-width: var(--page-max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  align-items: start;
}
.cal-main { padding: 0 var(--gutter) 60px; min-width: 0; }
.cal-head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.cal-heading { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 400; margin: 0; }
.cal-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.cal-filter-label { font-size: var(--fs-body); font-weight: 700; color: var(--text-secondary); }
.cal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 3px; cursor: pointer;
  font-size: var(--fs-compact); color: var(--text-secondary);
}
.cal-pill.on { background: var(--primary-light); color: var(--primary-hover); }
.cal-pill.is-disabled { opacity: .5; cursor: not-allowed; }
.cal-count { font-size: var(--fs-compact); color: var(--text-secondary); margin-bottom: 8px; }

.cal-list { border-top: 1px solid var(--border); }
.cal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 0; border-bottom: 1px solid var(--border); color: inherit;
}
.cal-row:hover { text-decoration: none; background: var(--surface-alt); }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-left: 42px; }
.cal-row-title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 700; }
.cal-row-sub { font-size: var(--fs-small); color: var(--text-secondary); }
.cal-row-date { margin-left: auto; font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400; }
.cal-row-chev { color: var(--text-muted); }

.cal-sidebar {
  width: 400px; background: var(--surface); padding: 17px;
  min-height: calc(100vh - 221px);
  box-shadow: inset 2px 0 3px 0 #bbbbbb;
}
.cal-mini-head { font-size: var(--fs-compact); font-weight: 700; margin-bottom: 10px; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 40px); gap: 4px; }
.cal-mini-dow {
  font-size: var(--fs-body); font-weight: 700; text-align: center;
  border-bottom: 1px solid var(--border-light); padding-bottom: 4px;
}
.cal-mini-day {
  position: relative; width: 40px; height: 40px; border-radius: var(--radius);
  display: grid; place-items: center; font-size: var(--fs-compact);
}
.cal-mini-day.other-month { color: var(--text-muted); }
.cal-mini-day.today { background: var(--primary); color: #fff; }
.cal-mini-dot {
  position: absolute; bottom: 5px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--primary);
}
.cal-tasks { margin-top: 30px; }
.cal-tasks h3 { font-size: var(--fs-h3); margin-bottom: 10px; }

/* --- Course Admin: category sections ----------------------------------- */
.admin-category { margin-bottom: 30px; }
.admin-category-title {
  font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 400;
  padding-bottom: 15px; margin: 0;
}
.admin-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, 300px); }
.admin-tool-row { display: flex; align-items: center; gap: 10px; height: 38px; }
.admin-tool-icon { width: 16px; height: 16px; border-radius: 3px; flex: none; }
.admin-tool-link { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--primary); }

@media (max-width: 767px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-sidebar { width: 100%; box-shadow: none; border-top: 1px solid var(--border); }
}

/* --- Interaction states (spec 6) --------------------------------------- */
.lessons-row:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -3px; border-radius: var(--radius);
}
.nav-progress-row:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -3px; border-radius: var(--radius);
}
.tab:focus-visible, .course-tab:focus-visible, .segment:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius);
}
.navband-link:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px;
}
.tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- Responsive (spec 7) ----------------------------------------------- */
/* Below the container width the gutter becomes a percentage of the viewport. */
@media (max-width: 1229px) {
  :root { --gutter: 2.439vw; }
}
/* The name beside the avatar is dropped on narrower viewports. */
@media (max-width: 1024px) {
  .minibar-hide-sm { display: none; }
}
/* Hamburger only appears once the nav band collapses. */
.minibar-burger {
  display: none; width: 30px; height: 30px; padding: 0;
  border: 0; background: none; cursor: pointer;
  color: var(--text-secondary); margin-right: 8px;
}
.minibar-burger:hover { color: var(--primary); }

@media (max-width: 767px) {
  :root { --minibar-h: 72px; }
  .minibar-burger { display: inline-flex; align-items: center; justify-content: center; }
  /* The band is hidden until the hamburger opens it, then it stacks. */
  .navband { display: none; }
  .navband.is-open { display: block; height: auto; }
  .navband.is-open .navband-inner {
    height: auto; flex-direction: column; align-items: flex-start;
    gap: 0; padding: 8px var(--gutter);
  }
  .navband.is-open .navband-link { height: 44px; display: flex; align-items: center; }
  .minibar-course { font-size: var(--fs-h3); max-width: 40vw; }
  .minibar-divider { display: none; }
  /* The lessons app stacks rather than holding two panels side by side. */
  .lessons-app { grid-template-columns: 1fr; height: auto; }
  .lessons-nav { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .lessons-content { overflow: visible; }
  .tiles { grid-template-columns: 1fr; }
}
