:root {
  --bg: #fff; --card: #fff; --text: #1d2327; --muted: #5f6b73; --line: #dfe3e6;
  --accent: #1f6f8b; --accent-text: #fff; --error: #b3261e; --ok: #1e7a3c; --note: #fff7e0;
  --soft: #e6f1f4; --sage: #7fa88f;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text);
       min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem;
       border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
#nav { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
main { flex: 1; width: 100%; max-width: 56rem; margin: 0 auto; padding: 2rem 1rem; outline: none; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 1rem; }
.hero { text-align: center; padding: 3rem 0; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 .75rem; }
.hero p { color: var(--muted); max-width: 36rem; margin: 0 auto 1.5rem; font-size: 1.1rem; }
.row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: .6rem 1.1rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent);
       color: var(--accent-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .6; cursor: wait; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.narrow { max-width: 26rem; margin: 0 auto; }
form label { display: block; margin: 0 0 1rem; font-weight: 600; font-size: .95rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  padding: .55rem .65rem; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
form .check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
@media (max-width: 30rem) { .two { grid-template-columns: 1fr; } }
.msg { padding: .6rem .8rem; border-radius: 6px; margin: 0 0 1rem; }
.msg.error { color: var(--error); border: 1px solid currentColor; }
.msg.ok { color: var(--ok); border: 1px solid currentColor; }
.note { background: var(--note); border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
h2 { margin: 2rem 0 .75rem; font-size: 1.2rem; }
ul.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
ul.list li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem;
             display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tag { font-size: .8rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; align-self: center; }
input:not([type=checkbox]):not([type=radio]), select, textarea { font: inherit; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; width: 100%; margin-top: .3rem; }
textarea { resize: vertical; }
.row.left { justify-content: flex-start; align-items: center; margin: 1rem 0; }
.pre { white-space: pre-line; }
.card + .card { margin-top: 1.5rem; }

/* catalog */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; align-items: end; margin-bottom: 1.5rem; }
.filters label { margin: 0; }
.grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.course { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.course img, .img-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); display: block; }
.course-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.course-body h3 { margin: 0; font-size: 1.05rem; }
.course-body p { margin: 0; flex: 1; }
.hero-img { width: 100%; max-height: 18rem; object-fit: cover; border-radius: 10px; }

/* player */
.player { display: grid; grid-template-columns: 16rem 1fr; gap: 1rem; align-items: start; }
@media (max-width: 45rem) { .player { grid-template-columns: 1fr; } }
.outline h3 { margin: 0 0 .5rem; font-size: 1rem; }
.outline ol { padding-left: 1.2rem; margin: 0 0 1rem; display: grid; gap: .4rem; }
.outline .linkish { text-align: left; }
.stage h2 { margin-top: 0; }
.stage video { width: 100%; max-height: 70vh; background: #000; border-radius: 6px; }
.question { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; }
.question legend { font-weight: 600; padding: 0 .25rem; }
.question .check { margin: .4rem 0; font-weight: 400; }
.check.inline { display: inline-flex; margin: 0 .6rem 0 0; font-weight: 400; }

/* admin */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .5rem .8rem; text-decoration: none; border-radius: 6px 6px 0 0; }
.tabs a.active { background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); margin-bottom: -1px; color: var(--text); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .95rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td input, td select { margin: .2rem .3rem .2rem 0; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); }
.narrow-input { width: 7rem; }
.tag.warn { color: var(--error); border-color: currentColor; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.stat { padding: 1rem; }
.stat strong { font-size: 1.4rem; }
main { max-width: 72rem; }

/* authoring */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .7; }
.label { font-weight: 600; font-size: .95rem; margin: 1rem 0 .3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .3rem .2rem; }
.thumb { width: 8rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.item { border-top: 1px solid var(--line); padding: 1rem 0; }
.choice input:not([type=checkbox]) { flex: 1; min-width: 10rem; }
.question textarea { width: 100%; margin: .4rem 0; }

/* home */
.home-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; padding: 2rem 0 1.5rem; }
.home-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.15; margin: 0 0 1rem; letter-spacing: -.01em; }
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 .6rem; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 34rem; margin: 0 0 1.25rem; }
.hero-art { position: relative; padding: 1.5rem 0 2.5rem 1.5rem; }
.hero-art::before { content: ""; position: absolute; inset: 0 0 1rem 3rem; border-radius: 24px; background: linear-gradient(135deg, var(--soft), #eef5ef); }
.ha-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 32px rgba(20, 50, 60, .12); max-width: 22rem; }
.ha-img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #cfe3ea, #dcebe0); }
.ha-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ha-body { padding: .9rem 1rem 1rem; }
.ha-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: .7rem; overflow: hidden; }
.ha-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.ha-badge { position: absolute; right: 0; bottom: 0; display: flex; gap: .65rem; align-items: center; background: var(--card); border: 1px solid var(--line);
            border-radius: 12px; padding: .7rem .9rem; box-shadow: 0 8px 24px rgba(20, 50, 60, .14); max-width: 15rem; }
.ha-check { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 50%; background: var(--sage); color: #fff; font-weight: 700; }
@media (max-width: 45rem) { .home-hero { grid-template-columns: 1fr; } .hero-art { padding-left: 0; } .hero-art::before { left: 1.5rem; } }
.facts { list-style: none; padding: 1rem 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem;
         border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts:empty { display: none; }
.facts li { display: flex; flex-direction: column; }
.facts strong { font-size: 1.35rem; color: var(--accent); }
.band { margin-top: 2.5rem; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.topics, .pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.topics a { display: block; padding: .6rem 1rem; border-radius: 8px; background: var(--soft); text-decoration: none; font-weight: 600; }
.topics a:hover { background: var(--accent); color: var(--accent-text); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.steps h3 { margin: .6rem 0 .3rem; font-size: 1.05rem; }
.steps p { margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--sage); color: #fff; font-weight: 700; }
.pills li { padding: .35rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: .95rem; }
.cta { text-align: center; margin-top: 3rem; background: var(--soft); border: 0; }
.cta h2 { margin-top: 0; }

/* admin "view as" banner */
.view-as { display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .6rem 1rem;
           background: #fff4d6; border-bottom: 1px solid #e8c766; color: #5a4300; font-size: .95rem; }
.view-as[hidden] { display: none; }
.view-as .btn { padding: .3rem .8rem; }

/* My learning: course and certificate cards with a status colour on the left edge. */
.mylist { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .75rem; }
.mylist li { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1rem; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-left: 4px solid var(--st, var(--line)); border-radius: 10px; padding: .75rem 1rem .75rem .75rem; }
.mylist h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.mylist h3 a { color: var(--text); text-decoration: none; }
.mylist h3 a:hover { text-decoration: underline; }
.mybody { min-width: 0; display: grid; gap: .35rem; justify-items: start; }
.mythumb { width: 7.5rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--soft);
  display: grid; place-items: center; color: var(--accent); font-weight: 700; font-size: 1.6rem; }
.mythumb.seal { background: #fbf6ea; }
.mythumb.seal span { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #b8903f; color: #fff; font-size: .85rem;
  display: grid; place-items: center; box-shadow: 0 0 0 3px #fbf6ea, 0 0 0 4px #b8903f; }
.st-progress { --st: #d99a2b; }
.st-completed { --st: var(--ok); }
.st-cert { --st: #b8903f; }
.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .15rem .65rem;
  border-radius: 99px; white-space: nowrap; }
.status::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.status.progress { background: #fdf1dc; color: #8a5a00; }
.status.completed { background: #e3f3e8; color: #1e6b36; }
.counts { margin: -.25rem 0 .75rem; }
@media (max-width: 600px) {
  .mylist li { grid-template-columns: 5rem 1fr; }
  .mythumb { width: 5rem; font-size: 1.2rem; }
  .myact { grid-column: 1 / -1; }
  .myact .btn { display: block; text-align: center; }
}
