/* Comsol Training - shared styles. Teal and charcoal, phone first. */
:root {
  --teal: #3c6478;
  --teal-d: #2c4c5c;
  --teal-2: #4f8a9b;
  --teal-l: #e8f0f3;
  --teal-ll: #f3f7f9;
  --charcoal: #2b2f33;
  --ink: #2b2f33;
  --ink-2: #4a5157;
  --ink-3: #6b747b;
  --line: #d9e2e7;
  --bg: #f4f6f7;
  --card: #ffffff;
  --warn: #b3261e;
  --warn-bg: #fdeceb;
  --ok: #2e7d5b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 50, .06), 0 4px 14px rgba(20, 40, 50, .06);
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-h: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --topbar: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 900px) { body { font-size: 18px; } }
a { color: var(--teal); }
img { max-width: 100%; height: auto; }
button { font: inherit; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top));
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--charcoal); min-width: 0; }
.brand img { width: 34px; height: auto; flex: none; }
.brand b { font-family: var(--font-h); font-weight: 700; font-size: 15px; letter-spacing: .06em; color: var(--teal); }
.brand span { font-size: 13px; color: var(--ink-3); display: block; line-height: 1.1; }
.topbar .title { flex: 1; min-width: 0; font-family: var(--font-h); font-weight: 600; font-size: 14px; color: var(--charcoal);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn { flex: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  display: inline-grid; place-items: center; color: var(--charcoal); cursor: pointer; }
.icon-btn:hover { background: var(--teal-ll); }
.icon-btn svg { width: 22px; height: 22px; }
.topbar .dash { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--teal); text-decoration: none;
  font-family: var(--font-h); font-weight: 600; font-size: 14px; white-space: nowrap; }
.topbar .dash:hover { background: var(--teal-ll); }
.topbar .dash svg { width: 20px; height: 20px; }
/* inside a lesson on a phone the course title needs the room: the Dashboard button becomes an icon */
@media (max-width: 599px) {
  .topbar .title ~ .dash { width: 42px; padding: 0; justify-content: center; }
  .topbar .title ~ .dash span { display: none; }
}
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 40; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none;
  color: var(--ink); text-decoration: none; border-radius: 8px; cursor: pointer; font-size: 16px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--teal-ll); }
.menu-pop .who { padding: 8px 12px 10px; font-size: 14px; color: var(--ink-3); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- generic page ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 64px; }
.narrow { max-width: 460px; }
h1, h2, h3 { font-family: var(--font-h); color: var(--charcoal); line-height: 1.25; }
.page-h { font-size: 26px; margin: 8px 0 6px; }
.lede { color: var(--ink-2); margin: 0 0 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--teal); background: var(--teal); color: #fff; font-weight: 600;
  text-decoration: none; cursor: pointer; font-size: 16px; }
.btn:hover { background: var(--teal-d); }
.btn.ghost { background: #fff; color: var(--teal); }
.btn.ghost:hover { background: var(--teal-ll); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #b9c6cd; border-radius: 10px; font: inherit; font-size: 17px; background: #fff; }
input:focus { outline: 3px solid rgba(60, 100, 120, .25); border-color: var(--teal); }
.msg { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.msg.err { background: var(--warn-bg); color: var(--warn); }
.msg.ok { background: var(--teal-l); color: var(--teal-d); }
.muted { color: var(--ink-3); font-size: 15px; }
.foot { text-align: center; color: var(--ink-3); font-size: 13px; padding: 24px 16px 40px; }

/* course cards */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid { grid-template-columns: 1fr 1fr; } }
.course-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.course-card h2 { font-size: 18px; margin: 0; }
.course-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.course-card .meta { font-size: 14px; color: var(--ink-3); }
.pbar { height: 8px; border-radius: 99px; background: var(--teal-l); overflow: hidden; }
.pbar > i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 99px; transition: width .4s; }

/* course outline page */
.outline-sec { margin: 18px 0 6px; font-family: var(--font-h); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.lesson-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-list a, .lesson-list .locked { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: var(--ink); text-decoration: none; min-height: 52px; }
.lesson-list a:hover { background: var(--teal-ll); }
.lesson-list .locked { color: var(--ink-3); }
.st { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #b9c6cd; display: grid; place-items: center; }
.st.done { border-color: var(--teal); background: var(--teal) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 70% no-repeat; }
.st.open { border-color: var(--teal); }
.st.lock { border-style: dashed; }
.lesson-list .n { flex: none; width: 26px; color: var(--ink-3); font-size: 14px; text-align: right; }

/* ---------- lesson page ---------- */
.progress-strip { position: sticky; top: calc(var(--topbar) + env(safe-area-inset-top)); z-index: 25; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 14px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); }
.progress-strip .pbar { flex: 1; height: 6px; }
.lesson-layout { max-width: 1240px; margin: 0 auto; display: block; }
.side { display: none; }
.rail { display: none; }
@media (min-width: 1024px) {
  .lesson-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; padding: 0 20px; }
  .side { display: block; position: sticky; top: calc(var(--topbar) + 44px); align-self: start; max-height: calc(100vh - var(--topbar) - 60px); overflow: auto; padding: 18px 0 30px; }
  .drawer-btn { display: none; }
}
.side .outline-sec { margin-top: 14px; }
.side ol { list-style: none; margin: 0; padding: 0; }
.side li > a, .side li > span { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.35; }
.side li a:hover { background: #fff; }
.side li a.cur { background: #fff; color: var(--teal-d); font-weight: 600; box-shadow: var(--shadow); }
.side li > span { color: var(--ink-3); }
.side .st { width: 18px; height: 18px; margin-top: 1px; }

.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(20, 30, 36, .45); }
.drawer .panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); background: var(--bg); overflow: auto; padding: calc(14px + env(safe-area-inset-top)) 14px 40px; box-shadow: 4px 0 24px rgba(0,0,0,.18); }
.drawer .panel h2 { font-size: 16px; margin: 4px 0 8px; }

.lesson-main { min-width: 0; padding: 14px 14px 80px; }
@media (min-width: 700px) { .lesson-main { padding: 22px 28px 90px; } }
.lesson-head { max-width: 760px; margin: 0 auto; }
.crumb { margin: 4px 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); font-family: var(--font-h); font-weight: 600; }
.lesson-head h1 { font-size: 26px; margin: 0 0 12px; }
@media (min-width: 900px) { .lesson-head h1 { font-size: 32px; } }
.lesson-body { max-width: 760px; margin: 0 auto; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lsec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 8px; margin: 0 0 16px; scroll-margin-top: calc(var(--topbar) + 60px); }
@media (min-width: 700px) { .lsec { padding: 26px 30px 14px; } }
.lsec > :first-child { margin-top: 0; }
.lesson-body h2.sec { font-size: 21px; color: var(--teal); margin: 0 0 12px; padding-bottom: 10px; border-bottom: 2px solid var(--teal-l); }
@media (min-width: 900px) { .lesson-body h2.sec { font-size: 24px; } }
.lesson-body h2.sec-warn { color: var(--warn); border-bottom-color: var(--warn-bg); display: flex; gap: 10px; align-items: flex-start; }
.lesson-body h2.sec-warn::before { content: "!"; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 17px; display: grid; place-items: center; margin-top: 1px; }
.lesson-body .sec-label { margin: 0 0 2px; font-family: var(--font-h); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.lesson-body h3 { font-size: 18px; margin: 22px 0 8px; color: var(--charcoal); }
.lesson-body p { margin: 0 0 14px; }
.lesson-body .subhead { font-family: var(--font-h); font-weight: 600; font-size: 17px; margin-top: 20px; }
.lesson-body ul, .lesson-body ol { margin: 0 0 16px; padding-left: 24px; }
.lesson-body li { margin: 0 0 6px; }
.lesson-body li::marker { color: var(--teal); }
.lesson-body ul ul, .lesson-body ol ol, .lesson-body ul ol, .lesson-body ol ul { margin: 6px 0 4px; }
.lesson-body strong { color: var(--charcoal); }
.lesson-body a.xl { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.lesson-body a.btn-link { display: inline-block; background: var(--teal); color: #fff; text-decoration: none; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.lesson-body a.btn-link strong { color: #fff; }
.lesson-body .al-center { text-align: center; }
.lesson-body .al-right { text-align: right; }
.lesson-body figure { margin: 6px 0 16px; }
.lesson-body img { border-radius: 8px; }
.lesson-body .warn-text { color: var(--warn); }
.lesson-body .hidden-text { color: transparent; font-size: 0; }
.lesson-body table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 15px; }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.lesson-body th { background: var(--teal-ll); color: var(--teal-d); font-family: var(--font-h); font-weight: 600; }
.lesson-body tr:nth-child(even) td { background: #fafbfb; }
@media (max-width: 600px) { .lesson-body table { display: block; overflow-x: auto; } }
.callout { border-radius: 12px; padding: 14px 16px 2px 16px; margin: 4px 0 16px; border-left: 5px solid var(--teal); background: var(--teal-ll); position: relative; }
.callout::before { display: block; font-family: var(--font-h); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.callout.keypoint { background: var(--teal-l); border-left-color: var(--teal); }
.callout.keypoint::before { content: "Key point"; color: var(--teal); }
.callout.note { background: #f2f3f4; border-left-color: var(--charcoal); }
.callout.note::before { content: "Note"; color: var(--charcoal); }
.callout.warning { background: var(--warn-bg); border-left-color: var(--warn); }
.callout.warning::before { content: "Warning"; color: var(--warn); }
.callout.quote { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--teal-2); font-style: italic; }
.callout.quote::before { content: "Extract"; color: var(--teal-2); font-style: normal; }

.doc-card { display: flex; align-items: center; gap: 14px; padding: 14px; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--teal-ll); text-decoration: none; color: var(--ink); flex-wrap: wrap; }
.doc-card:hover { border-color: var(--teal); background: var(--teal-l); }
.doc-ic { flex: none; width: 40px; height: 48px; border-radius: 6px; background: var(--teal); position: relative; }
.doc-ic::after { content: "PDF"; position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 700 11px var(--font-h); color: #fff; letter-spacing: .04em; }
.doc-t { flex: 1; min-width: 150px; font-weight: 600; line-height: 1.3; }
.doc-m { flex: none; font-size: 13px; color: var(--ink-3); }
.embed-html iframe { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

.lesson-nav { max-width: 760px; margin: 20px auto 0; display: flex; gap: 10px; }
.lesson-nav .btn { flex: 1; }
.lesson-end { height: 1px; }
.done-note { max-width: 760px; margin: 12px auto 0; text-align: center; color: var(--ok); font-weight: 600; font-size: 15px; }

/* "In this lesson" rail on wide screens, "Sections" drop-down elsewhere */
@media (min-width: 1280px) {
  .lesson-layout { grid-template-columns: 270px minmax(0, 1fr) 230px; max-width: 1480px; }
  .rail { display: block; position: sticky; top: calc(var(--topbar) + 44px); align-self: start; max-height: calc(100vh - var(--topbar) - 60px); overflow: auto; padding: 22px 0 30px; }
  .sec-btn { display: none !important; }
}
.rail h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin: 0 0 8px; }
.rail ol, .sec-pop ol { list-style: none; margin: 0; padding: 0; }
.rail a, .sec-pop a { display: block; padding: 7px 10px 7px 12px; border-left: 3px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 14px; line-height: 1.35; }
.rail a:hover, .sec-pop a:hover { color: var(--teal-d); background: #fff; }
.rail a.on, .sec-pop a.on { border-left-color: var(--teal); color: var(--teal-d); font-weight: 600; background: #fff; }
.sec-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--charcoal); font-size: 14px; font-weight: 600; cursor: pointer; }
.sec-btn svg { width: 14px; height: 14px; }
.sec-wrap { position: relative; }
.sec-pop { position: absolute; right: 0; top: 42px; width: min(86vw, 360px); max-height: 60vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 40; }

/* ---------- knowledge checks ---------- */
.quiz-card { display: block; padding: 16px; margin: 8px 0 16px; border: 2px solid var(--teal-l); border-radius: 12px; background: var(--teal-ll); color: var(--ink); font-size: inherit; }
.qk-label { margin: 0 0 8px; font-family: var(--font-h); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--teal); }
.qk-q { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.qk-q + .qk-q { border-top: 1px solid var(--line); padding-top: 14px; }
.qk-q legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.qk-hint { margin: 0 0 8px; font-size: 14px; color: var(--ink-3); }
.qk-opt { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: inherit; margin: 0 0 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.qk-opt input { margin-top: 5px; flex: none; width: 18px; height: 18px; accent-color: var(--teal); }
.qk-opt.ok { border-color: var(--ok); background: #eaf5ef; }
.qk-opt.bad { border-color: var(--warn); background: var(--warn-bg); }
.qk-check { min-height: 40px; margin: 2px 0 8px; }
.qk-fb { font-size: 15px; font-weight: 600; }
.qk-fb.ok { color: var(--ok); }
.qk-fb.bad { color: var(--warn); }

/* ---------- overlay viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; display: none; flex-direction: column; background: #fff; }
.viewer.open { display: flex; }
@media (min-width: 900px) {
  .viewer { inset: 3vh 3vw; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
  .viewer-scrim { position: fixed; inset: 0; z-index: 79; background: rgba(20, 30, 36, .55); display: none; }
  .viewer-scrim.open { display: block; }
}
.viewer-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: #fff; }
@media (min-width: 900px) { .viewer-bar { padding-top: 8px; } }
.viewer-bar .vt { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .btn { min-height: 40px; padding: 0 12px; font-size: 14px; }
.viewer-body { flex: 1; min-height: 0; position: relative; background: #eef1f3; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pdf-pages { height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 8px 40px; }
.pdf-pages canvas { display: block; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); max-width: 100%; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); padding: 20px; text-align: center; }

/* ---------- print ---------- */
@media print {
  body * { display: none !important; }
  body::after { content: "Printing is not available for training material."; display: block; padding: 40px; font: 16px sans-serif; }
}
@media (max-width: 599px) {
  .brand div { display: none; }
  .brand img { width: 38px; }
}

/* ---------- phase 2: final quiz, certificates, verification ---------- */
.status-card { margin: 18px 0 8px; }
.status-card h2 { font-size: 19px; margin: 0 0 6px; }
.status-card p { margin: 0 0 12px; }
.status-card .btn + .btn { margin-left: 8px; }
.cert-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cert-no { font-family: var(--font-h); font-weight: 700; color: var(--teal-d); letter-spacing: .02em; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--teal-l); color: var(--teal-d); }
.pill.ok { background: #eaf5ef; color: var(--ok); }
.pill.bad { background: var(--warn-bg); color: var(--warn); }
.quiz-wrap { max-width: 760px; }
.quiz-q { margin: 0 0 14px; }
.quiz-q legend { font-weight: 600; margin-bottom: 10px; padding: 0; font-size: 1.02em; }
.quiz-q .qn { display: block; font-family: var(--font-h); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); font-weight: 700; margin-bottom: 4px; }
.quiz-q.missed { border-color: var(--warn); }
.quiz-q .qk-opt { margin-bottom: 8px; }
.quiz-q .qk-opt:has(input:checked) { border-color: var(--teal); background: var(--teal-ll); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 22px; }
.result { margin: 0 0 18px; border-left: 5px solid var(--teal); }
.result.pass { border-left-color: var(--ok); }
.result.fail { border-left-color: var(--warn); }
.result h2 { font-size: 21px; margin: 0 0 6px; }
.attempts { list-style: none; margin: 0; padding: 0; }
.attempts li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.attempts li:first-child { border-top: 0; }
.verify-wrap { max-width: 620px; }
.verify-form { display: flex; gap: 10px; flex-wrap: wrap; }
.verify-form input { flex: 1 1 220px; min-height: 48px; font: inherit; font-size: 18px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  text-transform: uppercase; letter-spacing: .03em; }
.verify-form input:focus { outline: 2px solid var(--teal-2); outline-offset: 1px; }
.vres { margin-top: 18px; }
.vres dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 12px 0 0; }
.vres dt { color: var(--ink-3); font-size: 15px; }
.vres dd { margin: 0; font-weight: 600; }
@media (max-width: 480px) { .vres dl { grid-template-columns: 1fr; gap: 2px; } .vres dd { margin-bottom: 8px; } }
.cert-list { display: grid; gap: 12px; }

/* ---------- courses page and purchase (phase 3) ---------- */
.hero { display: grid; gap: 16px; align-items: start; margin-bottom: 8px; }
@media (min-width: 800px) { .hero { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; } }
.hero-signin b { font-family: var(--font-h); color: var(--charcoal); }
.sec-h { font-size: 19px; margin: 22px 0 12px; }
.buy-card { gap: 12px; }
.buy-card .facts { margin: 0; padding: 0 0 0 20px; color: var(--ink-2); font-size: 15px; }
.buy-card .facts li { margin: 2px 0; }
.buy-card .price { display: flex; flex-direction: column; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }
.buy-card .price b { font-family: var(--font-h); font-size: 22px; color: var(--teal-d); }
.buy-card .price span { font-size: 14px; color: var(--ink-3); }
.note-card { margin-top: 22px; background: var(--teal-ll); }
.note-card p { margin: 0 0 10px; font-size: 15px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--teal-l); border-top-color: var(--teal); animation: spin 1s linear infinite; margin: 6px auto 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* read-aloud player */
.listen { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--teal-ll); }
.listen-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: grid; place-items: center; cursor: pointer; }
.listen-btn:hover { background: var(--teal-d); }
.listen-btn svg { width: 22px; height: 22px; fill: currentColor; }
.listen-btn .i-pause { display: none; }
.listen.playing .listen-btn .i-play { display: none; }
.listen.playing .listen-btn .i-pause { display: block; }
.listen-mid { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; }
.listen-label { font-family: var(--font-h); font-weight: 600; font-size: 14px; color: var(--teal-d); }
.listen-seek { width: 100%; margin: 0; accent-color: var(--teal); }
.listen-time { font-size: 12px; color: #5b6770; font-variant-numeric: tabular-nums; }
.listen-rate { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--teal); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; min-width: 44px; }
.listen.failed { opacity: .7; }

/* second language: switch and Chinese typography */
.lang-switch { display: inline-flex; border: 1px solid var(--teal-l); border-radius: 99px; padding: 2px; margin: 0 0 10px; background: #fff; }
.lang-switch button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--teal); padding: 4px 14px; border-radius: 99px; cursor: pointer; }
.lang-switch button.on { background: var(--teal); color: #fff; }
.lang-note { background: var(--teal-l); color: var(--teal-d); border-radius: 10px; padding: 8px 12px; font-size: 15px; margin: 0 0 14px; }
:lang(zh-CN), [lang="zh-CN"] { font-family: var(--font), "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }
[lang="zh-CN"] .lesson-body p, [lang="zh-CN"] .lesson-body li, .lesson-body[lang="zh-CN"] p, .lesson-body[lang="zh-CN"] li { line-height: 1.85; letter-spacing: .01em; }
.lesson-body[lang="zh-CN"] h2.sec, .lesson-body[lang="zh-CN"] h3 { font-family: var(--font-h), "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
.qk-text { width: 100%; box-sizing: border-box; font: inherit; font-size: 17px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qk-text:focus { outline: 2px solid var(--teal); border-color: var(--teal); }

/* ---------- course page: Reset Progress ---------- */
.course-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.danger:hover { background: #8f1e18; }
.confirm-dlg { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; max-width: min(420px, calc(100vw - 32px)); }
.confirm-dlg::backdrop { background: rgba(20, 40, 50, .45); }
.confirm-dlg h2 { font-family: var(--font-h); font-size: 20px; margin: 0 0 8px; }
.confirm-dlg p { margin: 0 0 18px; color: var(--ink-2); }
.confirm-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- corporate logins: team page and the "training as" bar ---------- */
.worker-bar { position: sticky; top: var(--topbar); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--teal-d); color: #fff; font-size: 15px; }
.worker-bar button { background: #fff; color: var(--teal-d); border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.team-h { font-family: var(--font-h); font-size: 19px; margin: 0 0 4px; }
.two-col { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .two-col { grid-template-columns: 1fr 1fr; } }
.team-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 10px; }
.team-search { max-width: 260px; }
.worker { margin-bottom: 12px; }
.worker-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.worker-name { font-weight: 700; font-size: 17px; }
.worker-course { margin-top: 12px; }
.wc-title { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.wc-meta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.pill.warn { background: #fff4de; color: #8a5a00; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 14px; }
.sign-decl { font-size: 16px; }
.sign-check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 16px; }
.wrap label.check, .confirm-dlg label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 8px 0; cursor: pointer; }
.wrap label.check input, .confirm-dlg label.check input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.team-search { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: #fff; }
.biz-btn { min-height: 64px; font-size: 18px; margin-bottom: 12px; }
.hero-signin .biz-link { margin-top: 10px; }
.biz-logo { display: block; margin: 22px auto 14px; max-width: min(300px, 80%); max-height: 72px; width: auto; height: auto; border-radius: 0; }
#teamLogo.biz-logo { margin: 8px 0 10px; max-height: 56px; }

/* Back button in the top bar */
.topbar .back-btn { margin-right: 4px; }
.topbar .back-btn svg { width: 22px; height: 22px; }
.team-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sup-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sup-date { min-height: 38px; padding: 4px 8px; border: 1px solid #b9c6cd; border-radius: 8px; font: inherit; font-size: 15px; background: #fff; }
.sup-note { font-weight: 600; color: var(--ok); } .sup-note.bad { color: var(--warn); }
.rec-up { cursor: pointer; }
.sup-rec .linkbtn { font-size: 14px; }

/* ---------- Cometrics Training brand (cometrics.net): the same pages in the Cometrics colours ----------
   Teal and yellow from the Cometrics logo, a dark top bar like the logo's background; lessons stay on the same light page. */
html[data-brand="cometrics"] {
  --teal: #1d5f6f;
  --teal-d: #164a57;
  --teal-2: #2b7383;
  --teal-l: #e2f0f2;
  --teal-ll: #f1f8f9;
  --charcoal: #22231d;
  --ink: #22231d;
  --line: #d8e3e5;
  --bg: #f4f6f6;
  --cm-dark: #17160f;
  --cm-yellow: #d4d36a;
  --cm-sky: #50a6b5;
}
html[data-brand="cometrics"] .topbar { background: var(--cm-dark); border-bottom: 3px solid var(--cm-yellow); }
html[data-brand="cometrics"] .brand img { border-radius: 8px; }
html[data-brand="cometrics"] .brand b { color: var(--cm-sky); letter-spacing: .12em; }
html[data-brand="cometrics"] .brand span { color: #e9e8c4; }
html[data-brand="cometrics"] .topbar .title { color: #f3f3ea; }
html[data-brand="cometrics"] .topbar .icon-btn,
html[data-brand="cometrics"] .topbar .dash { background: transparent; border-color: #3a3a30; color: #f3f3ea; }
html[data-brand="cometrics"] .topbar .icon-btn:hover,
html[data-brand="cometrics"] .topbar .dash:hover { background: #26251c; }
html[data-brand="cometrics"] .menu-pop .icon-btn { background: #fff; color: var(--charcoal); }
html[data-brand="cometrics"] .page-h { position: relative; padding-bottom: 8px; }
html[data-brand="cometrics"] .hero .page-h::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 4px; border-radius: 2px; background: var(--cm-yellow); }
html[data-brand="cometrics"] .course-card { border-top: 4px solid var(--cm-sky); }
html[data-brand="cometrics"] .worker-bar { background: var(--cm-dark); color: #f3f3ea; }
html[data-brand="cometrics"] .foot a { color: var(--teal); }
/* Cometrics team enquiry form on the home page */
.enquiry { margin-top: 22px; scroll-margin-top: calc(var(--topbar) + 16px); }
.enquiry h2 { margin: 0 0 4px; font-size: 20px; }
.enquiry .grid2 { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .enquiry .grid2 { grid-template-columns: 1fr 1fr; } }
.enquiry label { display: block; font-weight: 600; font-size: 15px; margin: 10px 0 4px; }
.enquiry input, .enquiry textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; background: #fff; }
.enquiry textarea { min-height: 84px; resize: vertical; }
.enquiry .hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.enquiry .btn { margin-top: 14px; }
/* Business login page: "New client?" line and button under the sign-in steps */
.setup-cta { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.setup-cta p { margin: 0 0 10px; color: var(--ink-2); font-weight: 600; }
.enquiry select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
#setupForm { position: relative; margin-top: 14px; scroll-margin-top: calc(var(--topbar) + 12px); }
