/* ============================================================ base ====== */
:root {
  --bg: #e6f0fd;              /* light blue page background */
  --brand-soft: #dce9fb;      /* light tint of the account colour */
  --brand-tint: #f2f8ff;      /* very light tint of the account colour */
  --panel: #ffffff;
  --ink: #17203a;
  --muted: #66708a;
  --line: #e3e7f2;
  --brand: #24508c;
  --brand-2: #16345f;
  --gold: #c99a2e;
  --ok: #1f9d63;
  --warn: #d4761b;
  --bad: #cf3b3b;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(23, 32, 58, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ------------------------------------------------ self-assessment (B & C) -- */
/* The written parts of the self-assessment: Section B's observation columns
   and Section C's question + answer blocks. An input of the stage that is not
   active is disabled, which the browser renders greyed on its own. */
.assess-section h4 { margin: 18px 0 6px; }
.assess-section .table-wrap { overflow-x: auto; }
.assess-table-wide { width: 100%; }
.assess-table .assess-beh-area { width: 26%; font-weight: 600; }
.assess-input { width: 100%; min-height: 56px; resize: vertical; font: inherit; }
.assess-input:disabled { background: #f1f4f9; color: #8a93a6; cursor: not-allowed; }
.assess-text-val { white-space: pre-wrap; background: #f6f8fd; border: 1px dashed var(--line);
  border-radius: 8px; padding: 8px 10px; }
.assess-refl-q { margin: 12px 0; }
.assess-refl-text { font-weight: 600; margin-bottom: 6px; }
.assess-refl-q .assess-input { min-height: 80px; }

/* ================================================== collapsible side menu == */
/* Every console and the learner app group their menu items into dropdowns: the
   heading toggles its items, the group holding the current view is always open,
   and a group whose items were all hidden by a role rule hides itself. */
.nav-group { margin-bottom: 4px; }
.nav-group.hidden { display: none; }
.nav-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  padding: 10px 12px; border-radius: 10px; font: inherit;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: #6b7794;
}
.nav-group-head:hover { background: #eef2fa; color: var(--brand); }
.nav-group-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nav-group-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the caret is drawn with borders, not a character, so no font or encoding can
   ever break it */
.nav-group-caret {
  flex: 0 0 auto; width: 0; height: 0; margin-right: 3px;
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent;
  border-top: 5.5px solid currentColor;
  transition: transform .16s ease;
}
.nav-group.open > .nav-group-head .nav-group-caret { transform: rotate(180deg); }
.nav-group-body { display: none; padding-left: 6px; }
.nav-group.open > .nav-group-body { display: block; }
/* the learner's dark sidebar */
.app-side .nav-group-head { color: #8ea2c6; }
.app-side .nav-group-head:hover { background: #1d2f55; color: #fff; }
.app-side .nav-group-body { padding-left: 4px; }

/* ========================================================== layout ====== */
.topbar {
  background: linear-gradient(120deg, var(--brand-2), var(--brand));
  color: #fff; padding: 14px 22px; display: flex; align-items: center;
  gap: 14px; position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow);
}
.topbar .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; }
.topbar .brand img { height: 34px; width: auto; max-width: 130px; object-fit: contain;
  border-radius: 6px; background: #fff; padding: 2px; }
/* The programme logo sits in the menu bar and must keep the bar's own
   background behind it, so it is drawn on a white plate rather than floating
   over the coloured gradient. */
.topbar .brand img#progLogo {
  height: 36px; width: 36px; object-fit: contain; object-position: center;
  background: #fff; padding: 3px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); flex: 0 0 auto;
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 10px; font-weight: normal; }
.topbar .who .who-icon { height: 16px; width: 16px; flex: 0 0 16px; fill: currentColor; opacity: .85; }
.topbar .who img.avatar { height: 32px; width: 32px; border-radius: 50%; object-fit: cover; border: 2px solid #ffffff88; }

.shell { display: flex; min-height: calc(100vh - 62px); }
.side {
  width: 230px; background: #fff; border-right: 1px solid var(--line);
  padding: 18px 12px; flex-shrink: 0;
}
.side .nav-btn {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 11px 14px; margin-bottom: 4px; border-radius: 10px; cursor: pointer;
  font-size: 14.5px; color: var(--ink); font-weight: 600;
}
.side .nav-btn:hover { background: #eef2fa; }
.side .nav-btn.active { background: var(--brand); color: #fff; }
.side .nav-btn .cnt { float: right; background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.main { flex: 1; padding: 24px; min-width: 0; }

/* ========================================================== pieces ====== */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h3 { font-size: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat .l { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

/* ------------------------------------------------------- dashboard ------ */
/* The dashboard wears the account colour: a coloured header band, tinted
   statistic cards and a coloured top edge on each dashboard panel. */
#view-dashboard > h2,
#view-home > h2 {
  background: linear-gradient(120deg, var(--brand-2), var(--brand));
  color: #fff; padding: 14px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
/* Each metric can carry its own tone (tone-* classes below); anything without
   a tone follows the account colour. */
.stat.tone-blue   { --tone: #2f6fd0; --tone-soft: #dce9fb; --tone-line: #d3e2f7; }
.stat.tone-teal   { --tone: #0f766e; --tone-soft: #dcf0ec; --tone-line: #cfe8e3; }
.stat.tone-violet { --tone: #6d3fd1; --tone-soft: #eae2fb; --tone-line: #ded2f6; }
.stat.tone-amber  { --tone: #b45309; --tone-soft: #fdf1de; --tone-line: #f7e5c9; }
.stat.tone-red    { --tone: #c62828; --tone-soft: #fbe3e3; --tone-line: #f5d3d3; }
.stat.tone-green  { --tone: #1f7a44; --tone-soft: #e0f2e7; --tone-line: #d1e9db; }
.stat.tone-pink   { --tone: #b8217a; --tone-soft: #fbe3f1; --tone-line: #f6d2e6; }
.stat.tone-slate  { --tone: #475569; --tone-soft: #e9edf4; --tone-line: #dde3ec; }
#view-dashboard .stat,
#view-home .stat,
.dash-strip .stat {
  background: linear-gradient(160deg, #ffffff, var(--tone-soft, var(--brand-soft)));
  border: 1px solid var(--tone-line, var(--brand-soft));
  border-left: 5px solid var(--tone, var(--brand));
  box-shadow: 0 6px 18px rgba(23, 32, 58, .06);
}
#view-dashboard .stat .n,
#view-home .stat .n,
.dash-strip .stat .n { color: var(--tone, var(--brand)); }
#view-dashboard .stat .l,
#view-home .stat .l,
.dash-strip .stat .l { color: var(--tone, var(--brand-2)); opacity: .9; }
#view-dashboard .card,
#view-home .card { border-top: 4px solid var(--brand); }
#view-dashboard .progress,
#view-home .progress { background: var(--brand-soft); }
#view-dashboard .progress i,
#view-home .progress i { background: var(--brand); }

/* Motto line that sits at the very top of every dashboard. */
.motto { display: block; font-size: 12px; font-weight: 800; letter-spacing: .28em; opacity: .92; margin-bottom: 3px; }
#view-dashboard > h2 .motto,
#view-home > h2 .motto,
.home-title .motto { color: inherit; }
.home-title { margin-top: 0; }
/* ---------------------------------------------------------- charts ----- */
.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.chart-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; border-top: 4px solid var(--brand);
}
.chart-box h4 { margin: 0 0 10px; font-size: 14px; }
.chart-box .chart-sub { color: var(--muted); font-size: 12px; margin: -6px 0 10px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-wrap svg.donut { width: 140px; height: 140px; flex: 0 0 auto; }
.donut-wrap .legend { flex-direction: column; gap: 6px; margin-top: 0; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 128px) 1fr 42px; gap: 8px; align-items: center; font-size: 12px; }
.bar-row .label { overflow: auto; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { background: #eef2f8; border-radius: 6px; height: 12px; overflow: auto; }
.bar-row .track i { display: block; height: 100%; border-radius: 6px; }
.bar-row b { text-align: right; }
/* expandable learner summary inside the progress ranking table */
.sum-row td { background: #f7faff; border-top: 2px solid var(--brand-soft); }
.sum-box { padding: 6px 2px 14px; }
.sum-box h4 { margin: 0 0 8px; font-size: 13px; }
.sum-row.hidden { display: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #e2f6ec; color: var(--ok); }
.badge.off { background: #fdeaea; color: var(--bad); }
.badge.warn { background: #fdf1e3; color: var(--warn); }
.badge.info { background: #e8eefb; color: var(--brand); }
.badge.lock { background: #eef0f5; color: var(--muted); }

label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9cbec; border-color: var(--brand); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 150px; }
.row .fixed { flex: 0 0 auto; min-width: 0; }

button, .btn {
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 18px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--brand-2); text-decoration: none; }
button.ghost, .btn.ghost { background: #eef2fa; color: var(--brand); }
button.ghost:hover { background: #dde6f6; }
button.danger, .btn.danger { background: var(--bad); }
button.small, .btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #f8faff; }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 200; max-width: 90vw; font-weight: 600;
}
#toast.err { background: var(--bad); }
#toast.ok { background: var(--ok); }

.cbp-comms-toggle {
  position: fixed; top: 70px; right: 18px; z-index: 120;
  padding: 8px 13px; border: 2px solid #ffffff66; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(23, 32, 58, .22);
}
.cbp-comms-count {
  display: inline-block; min-width: 20px; margin-left: 4px; padding: 1px 5px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px;
}
.cbp-comms-panel {
  position: fixed; top: 118px; right: 16px; z-index: 119; width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 78px); overflow: auto; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 38px #17203a33;
}
.cbp-comms-head, .cbp-comms-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.cbp-comms-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cbp-comms-tabs { display: flex; gap: 6px; margin: 10px 0; }
.cbp-comms-tabs button { flex: 1; padding: 7px 5px; font-size: 12px; }
.cbp-comms-list { display: grid; gap: 8px; }
.cbp-comms-item {
  display: grid; gap: 3px; width: 100%; padding: 10px 12px; text-align: left;
  color: var(--ink); background: #f7f9fd; border: 1px solid var(--line);
}
.cbp-comms-item:hover { background: var(--brand-tint); color: var(--ink); }
.cbp-comms-item span { overflow-wrap: anywhere; color: var(--muted); font-weight: 400; font-size: 13px; }
.cbp-comms-item small { color: var(--muted); font-weight: 400; }
.cbp-comms-item.unread { border-left: 4px solid var(--brand); }
.cbp-comms-item i { color: var(--brand); font-size: 11px; font-style: normal; }
.cbp-comms-item i.cbp-comms-play { color: var(--ok); font-weight: 800; }
.cbp-comms-empty { padding: 18px 6px; text-align: center; }
.cbp-comms-form { display: grid; gap: 10px; margin-top: 12px; }
.cbp-comms-form select[multiple] { min-height: 116px; }
.cbp-comms-form textarea { min-height: 90px; resize: vertical; }
.cbp-comms-messages {
  display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow: auto; padding: 12px 2px;
}
.cbp-comms-message { align-self: flex-start; max-width: 88%; padding: 8px 11px; border-radius: 12px; background: #eef2fa; }
.cbp-comms-message.mine { align-self: flex-end; background: var(--brand-soft); }
.cbp-comms-message p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cbp-comms-message small { color: var(--muted); }
/* message attachments */
.cbp-comms-attach { display: grid; gap: 6px; }
.cbp-comms-attach input[type=file] { font-size: 12px; }
.cbp-comms-att-list { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.cbp-comms-att { margin: 6px 0; }
.cbp-comms-att video, .cbp-comms-att audio { width: 100%; max-width: 320px; display: block; }
.cbp-comms-att img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; }
.cbp-comms-att-link {
  display: inline-block; padding: 6px 10px; border-radius: 8px;
  background: #eef2fa; border: 1px solid var(--line, #dbe3ef);
  text-decoration: none; color: var(--brand, #24508c); font-size: 13px;
}
.cbp-comms-att-link:hover { background: var(--brand-soft, #e7eefb); }
button.cbp-comms-att-link { cursor: pointer; text-align: left; }
.cbp-comms-sent-item { padding: 0; overflow: hidden; }
.cbp-comms-sent-open {
  display: grid; gap: 3px; width: 100%; padding: 10px 12px; text-align: left;
  color: var(--ink); background: transparent; border: 0; border-radius: 0;
}
.cbp-comms-sent-open:hover { background: var(--brand-tint); color: var(--ink); }
.cbp-comms-sent-open span, .cbp-comms-sent-open small { overflow-wrap: anywhere; }
.cbp-comms-sent-item > .cbp-comms-att { margin: 0; padding: 0 12px 10px; }
.cbp-attachment-preview { display: grid; place-items: center; margin: 16px 0; }
.cbp-attachment-preview img { max-width: 100%; max-height: 60vh; border-radius: 10px; }
.cbp-attachment-preview video { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; }
.cbp-attachment-preview audio { width: 100%; }
.cbp-attachment-preview iframe { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 10px; }
.cbp-attachment-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.err-text { color: var(--bad); font-size: 13px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: Consolas, monospace; }
.mt { margin-top: 14px; }
.center { text-align: center; }

/* ========================================================== landing ===== */
.hero { max-width: 1100px; margin: 0 auto; padding: 54px 20px 10px; text-align: center; }
.hero h1 { font-size: 34px; color: var(--brand-2); }
.hero p { color: var(--muted); max-width: 720px; margin: 0 auto 18px; }
.hero .logo { height: 74px; border-radius: 14px; background: #fff; padding: 6px; box-shadow: var(--shadow); }
.portals { max-width: 1100px; margin: 24px auto 60px; padding: 0 20px;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.portal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.portal-card h3 { margin: 0; font-size: 18px; }
.portal-card .desc { color: var(--muted); font-size: 13.5px; flex: 1; }
.tenant-chip { display: flex; align-items: center; gap: 8px; background: #f6f8fd;
  border: 1px solid var(--line); padding: 7px 10px; border-radius: 10px; margin-top: 6px; }
.tenant-chip img { height: 24px; width: 24px; object-fit: cover; border-radius: 6px; }
.tenant-chip a { font-weight: 700; }

/* ============================================================ auth ====== */
.auth-wrap { min-height: 100vh; display: flex; align-items: stretch; }
.auth-side {
  flex: 1; background: linear-gradient(150deg, var(--brand-2), var(--brand) 60%, #3b74c0);
  color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: center;
}
.auth-side h2 { font-size: 30px; }
.auth-side ul { padding-left: 18px; opacity: .95; }
.auth-panel { width: 470px; background: #fff; padding: 40px 42px; overflow-y: auto; }
.auth-panel .tabs { display: flex; border-bottom: 2px solid var(--line); margin-bottom: 8px; }
.auth-panel .tabs button { flex: 1; background: none; color: var(--muted); border-radius: 0; padding: 12px; }
.auth-panel .tabs button.active { color: var(--brand); border-bottom: 3px solid var(--brand); background: none; }
.auth-logos { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.auth-logos img { height: 52px; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 3px; }

/* Live top-10 portraits on the left of an account login page. */
.login-performers {
  margin: 18px 0 20px; padding: 15px 16px 13px; border-radius: 18px;
  background: rgba(7, 20, 45, .18); border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.login-performers-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.login-performers-head h3 { margin: 0; color: #fff; font-size: 15px; letter-spacing: .01em; }
.login-performers-head span {
  white-space: nowrap; padding: 4px 8px; border-radius: 999px;
  background: rgba(255, 217, 121, .16); color: #ffd979;
  font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.login-performers-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px 7px; }
.login-performer { min-width: 0; text-align: center; }
.lp-avatar-wrap { position: relative; display: block; width: 46px; height: 46px; margin: 0 auto 5px; }
.lp-avatar {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .72);
  background: linear-gradient(145deg, #fff, #dce9ff); color: var(--brand-2);
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 4px 11px rgba(9, 22, 46, .26);
}
.lp-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lp-initials { line-height: 1; }
.lp-rank {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px;
  background: #ffd979; color: #1d2c49; border: 1px solid rgba(255, 255, 255, .9);
  font-size: 9px; font-weight: 900; line-height: 1;
  box-shadow: 0 2px 5px rgba(9, 22, 46, .22);
}
.lp-name {
  display: block; overflow: hidden; color: #fff; font-size: 10.5px; font-weight: 700;
  line-height: 1.2; white-space: nowrap; text-overflow: ellipsis;
}
.lp-score {
  display: inline-block; margin-top: 2px; padding: 1px 5px; border-radius: 999px;
  background: rgba(0, 0, 0, .16); color: #ffd979; font-size: 9px; font-weight: 800;
}
.login-performer.rank-1 .lp-avatar {
  border-color: #ffd979; box-shadow: 0 0 0 2px rgba(255, 217, 121, .22), 0 4px 11px rgba(9, 22, 46, .26);
}
.login-performer.rank-2 .lp-avatar { border-color: #dbe6f5; }
.login-performer.rank-3 .lp-avatar { border-color: #e8b48a; }
.login-performers-note { margin: 10px 0 0; font-size: 10.5px; line-height: 1.45; opacity: .72; }
.lp-school-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); }
@media (max-width: 620px) {
  .login-performers { padding: 13px 12px 11px; }
  .lp-avatar-wrap { width: 42px; height: 42px; }
  .login-performers-grid { gap: 9px 4px; }
  .lp-name { font-size: 9.5px; }
}

/* ---- best-performer ribbon on top of the students page ------------------ */
.pp-ribbon {
  margin: 0 0 18px; padding: 14px 16px 10px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(120deg, var(--brand-2), #2c5a9b 60%, var(--brand));
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 10px 26px rgba(23, 32, 58, .18);
}
.pp-ribbon-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.pp-ribbon-head h3 { margin: 0; color: #fff; font-size: 15px; letter-spacing: .01em; }
.pp-ribbon-note {
  white-space: nowrap; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 217, 121, .16); color: #ffd979;
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
/* the belt clips its content and fades both ends, so chips drift in and out */
.pp-ribbon-view {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 26px, #000 calc(100% - 26px), transparent);
}
.pp-ribbon-track { display: flex; width: max-content; animation: ppDrift var(--pp-duration, 40s) linear infinite; }
.pp-ribbon:hover .pp-ribbon-track,
.pp-ribbon:focus-within .pp-ribbon-track { animation-play-state: paused; }
.pp-ribbon-group { display: flex; gap: 10px; padding-right: 10px; }
/* the belt travels from left to right: the track holds two identical groups, so
   shifting it by exactly one group width loops without a gap at the seam */
@keyframes ppDrift { from { transform: translateX(-50%); } to { transform: translateX(0); } }
/* an account with no marks yet keeps the belt and says what it is waiting for */
.pp-ribbon.is-empty { padding-bottom: 14px; }
.pp-ribbon-empty {
  margin: 2px 0 0; max-width: 62ch; color: rgba(255, 255, 255, .84);
  font-size: 11.5px; line-height: 1.45;
}
/* a short list stands still and wraps instead of repeating the same few faces */
.pp-ribbon-track.is-static { animation: none; flex-wrap: wrap; width: auto; }
.pp-ribbon-track.is-static .pp-ribbon-group { flex-wrap: wrap; width: 100%; row-gap: 8px; }
.pp-ribbon-track.is-static .pp-ribbon-group[aria-hidden="true"] { display: none; }
.pp-chip {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 168px;
  padding: 7px 12px 7px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
}
.pp-face { position: relative; width: 38px; height: 38px; flex: 0 0 auto; }
.pp-initials {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(145deg, #fff, #dce9ff);
  border: 2px solid rgba(255, 255, 255, .8);
  color: var(--brand-2); font-size: 11px; font-weight: 800;
}
.pp-face img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.pp-rank {
  position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px;
  background: #ffd979; color: #1d2c49; border: 1px solid rgba(255, 255, 255, .9);
  font-size: 9px; font-weight: 900; line-height: 1;
}
.pp-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pp-who b {
  color: #fff; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 108px;
}
.pp-marks { color: #ffd979; font-size: 10px; font-weight: 700; }
.pp-cover { color: rgba(255, 255, 255, .72); font-size: 9.5px; }
.pp-chip.rank-1 .pp-initials { border-color: #ffd979; box-shadow: 0 0 0 2px rgba(255, 217, 121, .3); }
.pp-chip.rank-2 .pp-initials { border-color: #dbe6f5; }
.pp-chip.rank-3 .pp-initials { border-color: #e8b48a; }
.pp-ribbon-foot { margin: 8px 0 0; font-size: 10px; color: rgba(255, 255, 255, .66); }
/* a reader's own books, opened inside the analytics table */
table.nested { margin: 4px 0 6px; background: #fff; }
table.nested th { font-size: 11px; }
table.nested td { font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .pp-ribbon-view { overflow-x: auto; }
  .pp-ribbon-track { animation: none; }
  .pp-ribbon-group[aria-hidden="true"] { display: none; }
}

/* Faint account/portal logo watermark inside the right-hand login card.
   It sits behind the form (z-index -1, above the card's white background) and
   uses the account's own logo — or its monogram when no logo is uploaded. */
.auth-panel { position: relative; z-index: 0; }
.login-mark {
  /* centred at the foot of the login card, so the account's own mark sits in the
     middle of the space below the form rather than pushed into a corner */
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 64%; max-height: 62%; object-fit: contain;
  opacity: .10; pointer-events: none; user-select: none; z-index: -1;
}
@media (max-width: 900px) { .login-mark { display: none; } }
.closed-banner { background: #fdeaea; color: var(--bad); border: 1px solid #f5c8c8;
  padding: 12px 14px; border-radius: 10px; font-weight: 600; margin-top: 14px; }

/* =========================================================== modal ====== */
.modal-bg { position: fixed; inset: 0; background: rgba(12, 18, 36, .72);
  display: flex; align-items: center; justify-content: center; z-index: 120; padding: 18px; }
.modal { background: #fff; border-radius: 16px; max-width: 860px; width: 100%;
  max-height: 92vh; overflow: auto; padding: 24px; position: relative; }
.modal.wide { max-width: 1040px; }
.modal .x { position: absolute; top: 10px; right: 12px; background: #eef2fa; color: var(--brand);
  width: 34px; height: 34px; border-radius: 50%; border: 0; font-size: 18px; padding: 0; }
.video-frame { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; }
.letter-box { background: #fbf7ec; border: 1px solid #eadfc4; border-radius: 12px;
  padding: 22px 26px; white-space: pre-wrap; font-family: Georgia, serif; font-size: 16.5px; }

/* =========================================================== app UI ===== */
.app-shell { display: flex; min-height: 100vh; }
.app-side { width: 250px; background: #14213d; color: #dbe4f5; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.app-side .head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: #fff; }
.app-side .head img { height: 38px; width: 38px; max-width: 130px; object-fit: contain;
  background: #fff; padding: 3px; border-radius: 8px; flex: 0 0 auto; }
.app-side .head b { font-size: 14.5px; }
.app-side .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #8ea2c6; margin: 16px 8px 6px; }
.app-side button { background: none; color: #dbe4f5; text-align: left; width: 100%;
  padding: 10px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.app-side button:hover { background: #1d2f55; }
.app-side button.active { background: var(--brand); color: #fff; }
.app-side .video-item { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.app-side .video-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.app-side .video-item.watched .dot { background: var(--ok); }
.app-main { flex: 1; padding: 22px 26px; min-width: 0; }
.pinned-video { position: fixed; right: 18px; bottom: 18px; width: 300px; z-index: 90;
  background: #000; border-radius: 12px; overflow: auto; box-shadow: 0 12px 34px rgba(0,0,0,.4); }
.pinned-video video { width: 100%; display: block; }
.pinned-video .bar { background: #14213d; color: #fff; font-size: 12px; padding: 6px 9px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pinned-video .bar button { padding: 2px 9px; font-size: 12px; }

.dash-strip { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 20px; }
.dash-strip .stat .n { font-size: 26px; }
.progress { height: 9px; background: #e9edf6; border-radius: 999px; overflow: auto; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4f8ae0); }

.module-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); }
.module-card.locked { opacity: .62; }
.module-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.book-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.book-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: .15s; }
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-card.current { border: 2px solid var(--brand); }
.book-card.done { border-color: var(--ok); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.step { flex: 1; min-width: 34px; height: 8px; border-radius: 999px; background: #e6eaf3; }
.step.done { background: var(--ok); }
.step.active { background: var(--gold); }

.reader { display: grid; grid-template-columns: 250px 1fr; gap: 18px; }
.chapter-list button { display: block; width: 100%; text-align: left; background: #f6f8fd;
  color: var(--ink); border: 1px solid var(--line); margin-bottom: 8px; font-weight: 600; }
.chapter-list button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chapter-list button.locked,
.chapter-list button:disabled { opacity: .55; cursor: not-allowed; }
.chapter-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.chapter-body .content { white-space: pre-wrap; font-size: 16px; line-height: 1.7; }
.no-paste { background: #fffdf3; border: 1px dashed var(--gold); }

/* A chapter's answer area is open only while the reader is on the chapter's LAST
   page (feature chapter.reading-gate); the reader stays usable the whole time, so
   a learner can always turn back to it. */
.read-gate { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
  padding: 12px 14px; border: 1px dashed var(--gold); border-radius: 12px; background: #fffdf3; }
/* the note is in the page for good and is hidden while the reader is on the last
   page — its own display would otherwise beat the browser's [hidden] rule */
.read-gate[hidden] { display: none; }
/* our own `button { display: inline-block }` beats the browser's [hidden] rule too,
   so a button put away with .hidden = true (the letter's start button while the
   questions are open) is really taken off the screen */
button[hidden], .btn[hidden] { display: none; }
.read-gate .lock { font-size: 18px; line-height: 1; }
.read-gate b { display: block; }
.read-gate .small { display: block; margin-top: 2px; }
/* While the answer area is open the chapter is SET ASIDE: the sheet in the reader
   and the written text blur, and their read-aloud is greyed out, so nothing is read
   or copied from the page in front of the learner while they answer. The turn
   buttons are left alone — turning away from the last page lifts the veil. */
.read-gate.answer-open { border-style: solid; border-color: #b7dfc0; background: #f1f8f2; }
#chapterBody.answering .book-frame-wrap { filter: blur(7px); }
#chapterBody.answering .book-page::after {
  content: "✍️ Answering — the chapter is set aside";
  position: absolute; inset: 0; z-index: 4; display: flex;
  align-items: center; justify-content: center; text-align: center; padding: 12px;
  font-size: 13px; font-weight: 700; color: var(--brand); line-height: 1.4;
  background: rgba(255, 255, 255, .62); border-radius: 10px; pointer-events: none;
}
#chapterBody.answering .chapter-body .content { filter: blur(6px); user-select: none; }
#chapterBody.answering .book-narrator,
#chapterBody.answering .chapter-body .narrator { opacity: .4; pointer-events: none; }
.chapter-body textarea[disabled] { background: #f2f5fa; color: var(--muted); cursor: not-allowed; }
.obj.locked { opacity: .6; }

/* The letter that closes a module. While the learner's TWO questions are open
   the letter (its clip, its text and its read-aloud) is veiled exactly like a
   chapter that has been set aside; "Back to the letter" lifts the veil. */
.letter-stage .letter-sheet { transition: filter .2s ease; }
.letter-sheet.veiled { position: relative; }
.letter-sheet.veiled .letter-box,
.letter-sheet.veiled .content,
.letter-sheet.veiled .attached-media,
.letter-sheet.veiled .narrator { filter: blur(6px); user-select: none; pointer-events: none; }
.letter-sheet.veiled .letter-box::after {
  content: "✍️ Answering — the letter is set aside";
  position: absolute; inset: auto 0 0 0; text-align: center; padding: 8px;
  font-size: 13px; font-weight: 700; color: var(--brand); filter: none;
}
.letter-q { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; }
.letter-q b { display: block; margin-bottom: 6px; }
.letter-q.submitted { background: #fbfcfe; }
.letter-q .ml-text { width: 100%; min-height: 90px; }
.ml-opts { display: grid; gap: 6px; }
.ml-opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; cursor: pointer; }
.ml-opt:hover { border-color: var(--gold); background: #fffdf3; }
.ml-opt input { margin-top: 3px; }

/* Voice typing: a mic button tucked into the corner of every textarea. */
.speech-field { position: relative; }
.speech-field textarea { padding-right: 40px; }
.speech-mic {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line, #dbe3ef); border-radius: 50%;
  background: #fff; color: var(--muted, #64748b); cursor: pointer; line-height: 1;
}
.speech-mic:hover { color: var(--brand, #24508c); border-color: var(--brand, #24508c); }
.speech-mic.listening {
  background: var(--brand, #24508c); border-color: var(--brand, #24508c); color: #fff;
  animation: speech-pulse 1.2s ease-in-out infinite;
}
@keyframes speech-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(36, 80, 140, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(36, 80, 140, 0); }
}
.obj { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.obj .q { font-weight: 700; margin-bottom: 8px; }
.obj .opt { display: flex; gap: 9px; align-items: flex-start; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.obj .opt:hover { background: #f2f5fc; }
.obj .opt.correct { background: #e2f6ec; }
.obj .opt.wrong { background: #fdeaea; }
.summary-box { border-radius: 12px; padding: 16px; border: 1px solid var(--line); margin-bottom: 14px; background: #fff; }
.summary-box.active { border-left: 8px solid var(--brand); }
.summary-box.locked { opacity: .55; }
.timestamp { font-size: 12.5px; color: var(--muted); }
.flag { color: var(--bad); font-weight: 700; font-size: 12.5px; }

/* ====================================================== certificates ==== */
.cert-sheet { background: #fff; border: 10px double var(--gold); border-radius: 6px;
  padding: 40px 46px; text-align: center; position: relative; }
.cert-sheet .logo { height: 60px; }
.cert-sheet h1 { font-size: 30px; color: var(--brand-2); letter-spacing: .04em; margin-top: 10px; }
.cert-sheet .name { font-size: 27px; font-weight: 800; color: var(--gold); font-family: Georgia, serif; margin: 14px 0; }
.cert-sheet .books { text-align: left; display: inline-block; margin: 10px auto; }
.cert-sheet .foot { display: flex; justify-content: space-between; margin-top: 26px; color: var(--muted); font-size: 13px; }
@media print {
  body * { visibility: hidden; }
  .cert-sheet, .cert-sheet * { visibility: visible; }
  .cert-sheet { position: absolute; left: 0; top: 0; width: 100%; border-color: #000; }
  .no-print { display: none !important; }
}

/* ================================================= final toolbar ======== */
.final-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.final-tabs button { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.final-tabs button.active { background: var(--brand); color: #fff; }
.thought-entry { display: flex; gap: 10px; }

@media (max-width: 900px) {
  .auth-wrap { flex-direction: column; }
  .auth-panel { width: 100%; }
  .auth-side { padding: 30px; }
  .side, .app-side { width: 100%; height: auto; position: static; }
  .shell, .app-shell { flex-direction: column; }
  .reader { grid-template-columns: 1fr; }
}



.pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 400px;
  max-height: 95vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  margin: 6px 0;
  overflow: auto;
}

/* closed-book cover shown in listings and previews until it is clicked */
.book-open-card {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; max-width: 420px; cursor: pointer;
}
.book-open-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.book-open-icon { font-size: 20px; line-height: 1; }
.book-open-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.book-open-text b { font-size: 13px; }
.book-open-text .small { margin-top: 2px; }

/* ------------------------------------------------- book-style PDF reader -- */
/* A PDF opens one page at a time like a book: page-turn arrows either side of
   the sheet, a page counter, plus arrow-key turning and a full-page mode. */
.book-reader {
  background: linear-gradient(160deg, #eef2f8, #e3e9f3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 10px 0;
}
.book-stage { display: flex; align-items: center; gap: 10px; }
.book-page {
  flex: 0 1 auto; min-width: 0; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; aspect-ratio: 1 / 1.414; max-height: 95vh;
  box-shadow: 0 12px 28px rgba(23, 32, 58, .14);
}
.book-page .pdf-frame {
  display: block;
  border: 0; border-radius: 0; margin: 0;
}
/* The page is fit by width so text stays readable. If the page is taller than
   the available space, the iframe scrolls vertically so every line is reachable. */
.book-page { position: relative; aspect-ratio: 1 / 1.414; }
/* The page layer is the WHOLE page: as wide as the sheet and as tall as the
   page itself, so the print is at maximum readable width. The sheet clips it
   (overflow hidden above) and the layer slides inside it (bookScrollTo) —
   a taller page is read by scrolling, never cropped, and the flick at its
   end turns the leaf. */
.book-frame-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; background: #fff; will-change: transform; transition: transform .08s linear; }
.book-frame-wrap .pdf-frame { width: 100%; height: 100%; }
/* PDF.js rendering of the open page (canvas + transparent text layer) is only
   switched on for read-aloud, so the native viewer remains the default. */
.book-frame-wrap.pdf-rendered .pdf-frame { display: none; }
.pdf-render { position: absolute; top: 0; left: 0; z-index: 2; background: #fff; }
.pdf-canvas { display: block; width: 100%; height: 100%; }
.pdf-text-layer { position: absolute; top: 0; left: 0; overflow: hidden; line-height: 1; }
.pdf-text-item {
  position: absolute; white-space: pre; color: transparent;
  transform-origin: 0 0; pointer-events: none;
}
.pdf-text-layer .narrate-word { color: transparent; border-radius: 2px; }
.pdf-text-layer .narrate-word.narrating {
  background: rgba(255, 236, 92, .48);
  box-shadow: 0 0 0 1px rgba(255, 226, 70, .30);
}
/* read-aloud controls under the page/text */
.book-narrator { margin: 10px 0 0; }
.narrator { margin: 10px 0 0; }
.narrator-text { position: relative; white-space: pre-wrap; }
.narrator-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.narrator-bar button { min-width: 76px; }
.narrator-status { font-size: 12.5px; color: var(--muted); }
.narrate-word { border-radius: 2px; transition: background-color .08s linear; }
.narrate-word.narrating {
  background: rgba(255, 239, 118, .50);
  box-shadow: 0 0 0 1px rgba(255, 226, 70, .24);
}
.book-reader.book-full .narrator-status { color: #cbd5e1; }
.book-reader { overflow-y: visible; }
.book-shield { position: absolute; inset: 0; z-index: 3; cursor: ew-resize; }
.book-page.turning { animation: bookTurn .2s ease; }
/* the chapter's own pages, opened automatically when the chapter is clicked */
.chapter-book { margin-top: 10px; }
.chapter-book .book-reader { margin-top: 0; }
@keyframes bookTurn {
  from { opacity: .5; transform: translateX(7px); }
  to { opacity: 1; transform: none; }
}
.page-turn {
  flex: 0 0 auto; width: 42px; align-self: center; height: 70px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--brand); font-size: 26px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 12px rgba(23, 32, 58, .08);
}
.page-turn:hover:not(:disabled) { background: var(--brand-soft); }
.page-turn:disabled { opacity: .35; cursor: default; }
.book-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.book-page-no { font-size: 13px; color: #475569; white-space: nowrap; }
.book-page-no b { color: var(--brand); }
.book-spacer { flex: 1 1 auto; }
.book-hint { white-space: nowrap; }
.book-reader.book-full {
  position: fixed; inset: 0; z-index: 900; margin: 0; border-radius: 0;
  background: #0f172a; padding: 14px; display: flex; flex-direction: column;
}
.book-reader.book-full .book-stage { flex: 1 1 auto; min-height: 0; }
.book-reader.book-full .book-page { aspect-ratio: auto; max-height: none; }
.book-reader.book-full .book-bar { color: #cbd5e1; }
.book-reader.book-full .book-page-no,
.book-reader.book-full .book-hint { color: #cbd5e1; }
@media (max-width: 640px) {
  .page-turn { width: 34px; height: 56px; font-size: 20px; }
  .book-hint { display: none; }
}
@media print {
  .page-turn, .book-bar, .narrator-bar, .book-narrator { display: none !important; }
  .book-reader { background: none; border: 0; padding: 0; }
  .book-page { aspect-ratio: auto; height: 900px; box-shadow: none; border: 0; }
}

/* chapter page picker */
.page-pick {
  display: inline-block;
  margin: 6px 0;
}
.pg-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin: 4px 0;
}
.pg-chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  background: #f6f7f9;
  user-select: none;
}
.pg-chip.on {
  background: #24508c;
  border-color: #24508c;
  color: #fff;
}
/* picker layout: the chips sit on their own full-width line below the field,
   wrap, and scroll inside a fixed box so long books still fit the page */
.page-pick { display: block; flex: 1 1 100%; min-width: 240px; }
.pg-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 4px 0 6px; }
.pg-tools label { display: flex; flex-direction: column; font-size: 11px; gap: 2px; }
.pg-tools input { width: 84px; padding: 4px 6px; font-size: 12px; }
.pg-grid {
  max-height: 190px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.pg-hint { margin: 2px 0 0; }
/* chapter key words (MODULE 1 = typed answers checked against them) */
.key-words {
  background: #f7faff; border: 1px dashed var(--line); border-radius: 8px;
  padding: 8px 10px; margin: 8px 0; font-size: 13px;
}
.key-words .kw {
  display: inline-block; background: var(--brand-soft); color: var(--brand-2);
  border: 1px solid var(--brand-soft); border-radius: 10px;
  padding: 1px 8px; margin: 2px 4px 2px 0; font-size: 12px; font-weight: 600;
}
.kw-input { min-height: 60px; }
.export-buttons{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 10px}
.export-buttons button{padding:5px 10px;font-size:12px;border-radius:6px}

/* ================================================== student detail modal ==== */
/* Student profile list in the Details tab */
.sd-profile-list p {
  margin: 6px 0; padding: 6px 0;
  border-bottom: 1px solid #f0f3f9; font-size: 14px;
}
.sd-profile-list p:last-child { border-bottom: 0; }

/* Competence rating badge + scale */
.sd-competence-rating { margin-bottom: 12px; }
.rating-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 12px;
  font-weight: 700; font-size: 15px; color: #fff;
}
.rating-badge.rating-excellent { background: #1f9d63; }
.rating-badge.rating-good { background: #2f6fd0; }
.rating-badge.rating-fair { background: #d4761b; }
.rating-badge.rating-weak { background: #cf3b3b; }
.rating-badge.rating-none { background: #94a3b8; }
.rating-label { font-size: 15px; }
.rating-score { font-size: 20px; font-weight: 800; }
.rating-desc { color: var(--muted); font-size: 13px; margin: 10px 0 8px; }
.rating-scale {
  position: relative; display: flex; border-radius: 8px;
  overflow: hidden; margin-top: 18px;
}
.scale-seg {
  flex: 1; text-align: center; color: #fff; font-size: 11px;
  padding: 5px 0; font-weight: 600;
}
.rating-marker {
  position: relative; margin-top: -1px; transform: translateX(-50%);
  text-align: center;
}
.rating-marker span {
  display: inline-block; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; margin-top: 3px;
}
.rating-marker::before {
  content: ''; display: block; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 6px solid var(--ink); margin: 0 auto;
}

/* Involvement submission timeline */
.sd-timeline { margin-top: 8px; }
.timeline-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.timeline-date { min-width: 70px; color: var(--muted); text-align: right; }
.timeline-bar {
  flex: 1; height: 20px; background: #eef2fa; border-radius: 999px;
  overflow: hidden;
}
.timeline-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--brand); min-width: 8px;
}
.timeline-count { min-width: 110px; color: var(--muted); }

/* Completion progress ring */
.sd-ring-wrap {
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap; margin-top: 4px;
}
.sd-ring { flex-shrink: 0; }
.sd-ring-info { flex: 1; min-width: 180px; }
.sd-ring-info p {
  margin: 6px 0; font-size: 14px; color: var(--muted);
}
.sd-ring-info b { color: var(--ink); }

.student-detail-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(23, 32, 58, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  overflow-y: auto; backdrop-filter: blur(4px);
}
.student-detail-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 980px; max-height: 90vh;
  display: flex; flex-direction: column; animation: sdFadeIn .25s ease;
}
@keyframes sdFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.sd-header {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.sd-close {
  background: none; border: 0; font-size: 24px; color: var(--muted);
  cursor: pointer; padding: 0; line-height: 1;
}
.sd-close:hover { color: var(--ink); }
.sd-avatar {
  width: 48px; height: 48px; border-radius: 12px; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.sd-avatar-img {
  width: 100%; height: 100%; border-radius: 12px; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.sd-info { flex: 1; min-width: 0; }
.sd-info h2 { font-size: 20px; margin-bottom: 4px; }
.sd-sub { color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.sd-progress {
  margin-left: 20px; min-width: 150px;
}
.sd-prog-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sd-prog-val { font-size: 12px; color: var(--muted); margin-top: 4px; }

.sd-tabs {
  display: flex; gap: 4px; padding: 14px 20px; border-bottom: 1px solid var(--line);
  flex-shrink: 0; overflow-x: auto;
}
.sd-tab {
  background: none; border: 0; padding: 10px 14px; font-size: 13px;
  font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.sd-tab:hover { color: var(--brand); background: #f6f8fc; }
.sd-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: #eef3fb; }

.sd-panels { flex: 1; overflow-y: auto; padding: 0; display: flex; flex-direction: column; }
.sd-panel {
  display: none; padding: 20px; animation: sdPanelFade .2s ease;
}
.sd-panel.active { display: block; }
@keyframes sdPanelFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.sd-panel h4 { font-size: 15px; margin-top: 0; margin-bottom: 12px; color: var(--ink); }
.sd-panel .mt { margin-top: 12px; }
.impact-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.impact-list li { margin-bottom: 6px; line-height: 1.5; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.cert-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff;
}
.cert-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.cert-code { color: var(--brand); font-weight: 700; }
.cert-perf { margin-top: 6px; }

.sd-prog-val b { color: var(--brand); }
.flag { color: #cf3b3b; font-size: 12px; }

@media (max-width: 640px) {
  .student-detail-overlay { padding: 12px; }
  .student-detail-card { max-height: 95vh; }
  .sd-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .sd-progress { margin-left: 0; width: 100%; }
  .sd-tabs { padding: 10px 16px; }
  .sd-tab { padding: 8px 12px; font-size: 12px; }
  .sd-panels { padding: 16px; }
}

/* Sort column indicator on the progress ranking table */
.sort-col {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}
.sort-col:hover { background: #f6f8fc; }
.sort-dir {
  font-size: 11px;
  margin-left: 4px;
  opacity: .7;
}

/* ============================================ self-assessment table ==== */
.assess-legend { margin-bottom: 10px; }
.assess-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.assess-table th, .assess-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.assess-table th { text-transform: uppercase; font-size: 11px; color: #64748b; }
.assess-table td:first-child { max-width: 520px; }
.col-pre, .col-post { width: 150px; text-align: center; }
.col-pre .assess-opt, .col-post .assess-opt { display: inline-block; width: 100%; text-align: left; padding: 2px 4px; }
.col-pre input, .col-post input { margin-right: 6px; cursor: pointer; }
.assess-val { font-weight: 700; color: var(--brand); }
.assess-none { color: #94a3b8; }
.assess-cat { margin: 14px 0; }
.assess-cat h4 { margin: 0 0 6px; color: var(--brand-dark); }
.assess-cat-total td { border-top: 2px solid var(--brand); font-weight: 700; background: #f1f5f9; }
.assess-live { margin: 10px 0; font-size: 13px; color: #475569; }
.assess-totals { margin-top: 14px; padding: 10px 14px; background: #f8fafc; border-radius: 10px; font-size: 13px; display: flex; gap: 24px; flex-wrap: wrap; }
.assess-growth { color: #15803d; font-weight: 700; }
.assess-totals span { white-space: nowrap; }
.assess-table tbody tr:hover { background: #f8fafc; }

/* Category totals in the supervisor / super-admin progress reports */
.student-assess-link { color: inherit; text-decoration: none; }
.student-assess-link:hover b { color: var(--brand); text-decoration: underline; }
.assessment-cell { min-width: 230px; max-width: 320px; vertical-align: top; }
.assess-mini { font-size: 11px; line-height: 1.35; }
.assess-mini-head {
  text-transform: uppercase; letter-spacing: .03em; color: #64748b;
  font-size: 9px; font-weight: 700; margin-bottom: 3px;
}
.assess-mini-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px dashed #e2e8f0; }
.assess-mini-row:last-child { border-bottom: 0; }
.assess-mini-name { color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.assess-mini-total { white-space: nowrap; color: #334155; }
.assess-mini-total b { font-weight: 700; color: var(--brand-dark); }
.assess-mini-total span { color: #94a3b8; margin: 0 3px; }

/* Statement-level self-assessment popup */
.assessment-detail-card {
  display: block; overflow-y: auto; padding: 20px; position: relative;
}
.assessment-detail-card > .sd-close { position: absolute; top: 12px; right: 16px; z-index: 2; }
.assess-popup-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); padding: 0 36px 14px 0; margin-bottom: 12px;
}
.assess-popup-head h2 { margin: 0 0 3px; }
.assess-popup-totals { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.assess-popup-totals .stat { min-width: 100px; padding: 8px 12px; }
.assess-popup-totals .stat .n { font-size: 16px; }
.assess-popup-totals .stat .l { font-size: 10px; }
.assess-popup-cat { padding: 14px; }
.assess-popup-cat h3 { margin-bottom: 8px; }
.assess-cat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.assess-cat-head h3 { margin: 0; flex: 1; min-width: 180px; }
.assess-score-label { font-size: 10px; color: #64748b; margin-top: 1px; }
.assess-up { color: #15803d; }
.assess-down { color: #b91c1c; }

/* Super-admin definition editor */
.assess-admin-cat { padding: 16px; }
.assess-admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.assess-admin-head h3 { margin: 0 0 2px; }
.assess-admin-head form { flex: 1; min-width: 240px; }
.assess-admin-cat .assess-table { margin-top: 8px; }
.assess-admin-cat .assess-table td:first-child { max-width: none; }
.assess-admin-cat .assess-table input { margin: 0; }
.assess-q-add { border-top: 1px solid var(--line); padding-top: 10px; }
.assess-q-add .row, .assess-q-edit .row, .assess-cat-edit .row { align-items: flex-end; }

/* User photo styling */
.user-photo-sm {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--line);
  margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.user-photo-empty {
  width: 32px; height: 32px; border-radius: 50%;
  background: #eef2fa; color: var(--muted);
  font-weight: 700; font-size: 14px;
  text-align: center; line-height: 32px;
  margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.user-name-wrap { line-height: 1.4; }

/* Performance-based rank badges on the progress table */
.rank-badge {
  display: inline-block;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #eef2fa;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  line-height: 26px;
}
.rank-badge.rank-1 { background: #fbbf24; color: #451a03; }
.rank-badge.rank-2 { background: #a3e635; color: #14532d; }
.rank-badge.rank-3 { background: #fcd34d; color: #422006; }
.rank-badge.rank-4 { background: #bfdbfe; color: #1e3a8a; }
.rank-badge.rank-5 { background: #cffafe; color: #0f766e; }


/* ------------------------------------------------ library uploads + editor - */
/* A chosen video/audio file, playable inside the form while it uploads. */
.lib-preview {
  margin: 8px 0 4px;
  padding: 10px;
  border: 1px solid var(--line, #dbe3ef);
  border-radius: 10px;
  background: #f8fafd;
}
.lib-preview-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-preview-name { margin: 6px 0; word-break: break-all; }
.lib-preview-media { width: 100%; max-height: 260px; border-radius: 8px; background: #000; }
.audio .lib-preview-media, audio.lib-preview-media { background: transparent; }

/* Uploading a clip: a live percentage bar, only full once the file is stored. */
.media-picker { margin-top: 10px; }
.media-picker .audio-frame { width: 100%; background: transparent; }
.upload-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.upload-progress-bar {
  flex: 1; height: 10px; border-radius: 999px; overflow: hidden;
  background: #e6ebf5; border: 1px solid var(--line, #dbe3ef);
}
.upload-progress-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand, #24508c), var(--brand-2, #16345f));
  transition: width .15s ease;
}
.upload-progress-label { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 38px; text-align: right; }
/* A clip attached to a letter or a book, played inline with a close button. */
.inline-media { display: block; margin: 12px 0; }
.inline-media .video-frame, .inline-media .audio-frame { width: 100%; max-width: 560px; }
.attached-media { position: relative; margin: 0 0 14px; }
.attached-media .attached-media-tools {
  position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 6px;
}
.attached-media .attached-media-btn {
  background: rgba(12, 18, 36, .72); color: #fff; border: 0; border-radius: 50%;
  width: 34px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer;
}
.attached-media .audio-frame { width: 100%; background: #f3f6fb; border-radius: 12px; }
/* Minimized: the clip moves aside into a small always-on-top corner player. */
.attached-media.minimized {
  position: fixed; bottom: 16px; right: 16px; width: 240px; z-index: 1200;
  margin: 0; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28); background: #000;
}
.attached-media.minimized .audio-frame { background: #111; }

.lib-size { font-variant-numeric: tabular-nums; }

/* Basic rich-text editor (letters): toolbar + writing area. */
.rte { border: 1px solid var(--line, #dbe3ef); border-radius: 10px; overflow: hidden; background: #fff; }
.rte-bar {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 6px;
  border-bottom: 1px solid var(--line, #dbe3ef); background: #f3f6fb;
}
.rte-btn {
  min-width: 30px; padding: 4px 8px; border: 1px solid var(--line, #dbe3ef);
  border-radius: 6px; background: #fff; cursor: pointer; font-weight: 700; font-size: 13px;
}
.rte-btn:hover { background: #e8eefb; }
.rte-body { min-height: 200px; max-height: 420px; overflow: auto; padding: 12px; outline: none; color: #000; }
/* Super admin's library text editor gets a blue page, so the editor is easy to
   spot. Text stays black (forced below), so the tint is kept light for contrast. */
.super-admin #view-library .rte-body,
.super-admin #view-library .rte-fallback { background: #dcebff; }
/* Super admin's library letter editor: dark-blue formatting toolbar with white
   controls, so the tools read clearly on the blue letter page. */
.super-admin #view-library .rte-bar {
  background: #16345f;
  border-bottom-color: #16345f;
}
.super-admin #view-library .rte-btn {
  background: #16345f;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.super-admin #view-library .rte-btn:hover { background: #24508c; color: #fff; }
/* Letter text is often pasted from Word or Docs, which arrives carrying inline
   colour attributes. Inline styles beat normal rules, so force the editor — and
   every node inside it — back to black. */
.rte-body, .rte-body * { color: #000 !important; }
.rte-body p { margin: 0 0 10px; }
.rte-body h3 { margin: 6px 0 10px; }
.rte-body blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--line, #dbe3ef);
  color: var(--muted, #5b6b84);
}
.rte-fallback { width: 100%; min-height: 200px; color: #000; }

/* Formatted letters shown to learners keep their paragraphs and lists. */
.letter-rich p { margin: 0 0 12px; }
.letter-rich ul, .letter-rich ol { margin: 8px 0 12px 22px; }
.letter-rich blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--line, #dbe3ef);
  color: var(--muted, #5b6b84);
}
.letter-rich h3, .letter-rich h4 { margin: 10px 0 8px; }

/* ======================================================= live class room == */
/* /live?code=ABC123: the class fills the screen (camera and microphone in the
   room), and what is being said is written down beside it. */
.live-body { background: #0d1526; color: #eaf0fb; }
.live-shell {
  display: flex; flex-direction: column; min-height: 100vh;
}
.live-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 10px 16px; background: #101c33;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.live-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-title b { display: block; font-size: 16px; color: #fff; }
.live-title small { color: #9db0d0; font-size: 12px; }
.live-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto;
  background: #57657f; box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
}
.live-dot.on { background: #ff4d4d; box-shadow: 0 0 0 3px rgba(255, 77, 77, .22); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 8px rgba(255, 77, 77, .05); } }
.live-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-actions .muted, .live-actions .small { color: #9db0d0; }
.live-body button.ghost {
  background: rgba(255, 255, 255, .1); color: #eaf0fb; border: 1px solid rgba(255, 255, 255, .16);
}
.live-body button.ghost:hover { background: rgba(255, 255, 255, .2); }
.live-body button.danger, .live-body #liveEndBtn {
  background: #cf3b3b; color: #fff; border: 0;
}
.live-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0; min-height: 0;
}
.live-stage {
  position: relative; background: #000; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.live-frame {
  width: 100%; height: 100%; min-height: 320px; border: 0; display: block; background: #000;
}
.live-placeholder {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  justify-content: center; text-align: center; padding: 32px; color: #c6d3ea;
}
.live-placeholder b { font-size: 18px; color: #fff; }
.live-side {
  display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid rgba(255, 255, 255, .08); background: #0f1b30;
}
.live-side-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 12px 14px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.live-side-head b { color: #fff; font-size: 14px; }
.live-side-head .muted { color: #8fa3c4; }
.live-captions {
  flex: 1; overflow-y: auto; padding: 10px 12px; display: flex;
  flex-direction: column; gap: 8px; min-height: 120px; max-height: 60vh;
}
.live-line {
  display: grid; grid-template-columns: 44px 1fr; column-gap: 8px;
  font-size: 14px; line-height: 1.45; color: #e7eefb;
  padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.live-line .live-time { color: #7d91b3; font-size: 11px; font-variant-numeric: tabular-nums; }
.live-line .live-who { display: none; }
.live-line .live-text { grid-column: 2; }
.live-line.interim .live-text, .live-line.interim {
  color: #9db0d0; font-style: italic; border-bottom: 0;
}
.live-captions p.small { color: #8fa3c4; }
.live-caption-tools {
  border-top: 1px solid rgba(255, 255, 255, .08); padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.live-type-row { display: flex; gap: 6px; }
.live-type-row input {
  flex: 1; min-width: 0; background: #16233c; border: 1px solid rgba(255, 255, 255, .14);
  color: #eaf0fb; border-radius: 8px; padding: 8px 10px;
}
.live-type-row input::placeholder { color: #7d91b3; }
.live-type-row button { background: var(--brand); color: #fff; border: 0; }
.live-tools-row { display: flex; gap: 8px; flex-wrap: wrap; }
.live-caption-tools .small.muted { color: #8fa3c4; margin: 0; }
@media (max-width: 900px) {
  .live-main { grid-template-columns: 1fr; }
  .live-side { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .08); }
  .live-captions { max-height: 45vh; }
}

/* The console's list of live classes (drawn by common.js for /super and
   /admin). */
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.list-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fbfcff;
}
.list-item .mt { margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .shell, .app, .layout { flex-direction: column !important; }
  aside, .sidebar { width: 100% !important; max-height: 40vh; overflow: auto; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .grid, .cards { grid-template-columns: 1fr !important; }
  input, select, textarea, button { max-width: 100%; }
  .cbp-comms-panel, .cbp-comms-toggle { max-width: 95vw; }
}
