* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1b2a41; background: #f5f7fb; line-height: 1.5; }
a { color: #16386b; }
main { max-width: 1040px;
}
main.wide { max-width: 1280px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.card { background: #fff; border: 1px solid #e3e9f3; border-radius: 16px; padding: 28px; max-width: 440px; margin: 0 auto 20px; }
.card.wide { max-width: none; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password] { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; border: 1px solid #b9c2ce; border-radius: 6px; }
input:focus { outline: 2px solid #16386b; outline-offset: 1px; }
button, .button { display: inline-block; padding: 10px 20px; font: inherit; font-weight: 600; color: #fff; background: #16386b; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #0b1f3a; }
button.link { padding: 0; background: none; color: #16386b; font-weight: 400; text-decoration: underline; }
form.inline { display: inline; }
.small { font-size: .88rem; color: #5b6b82; }
.error, .notice { padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }
.error { background: #fdecec; color: #8c1d1d; border: 1px solid #f3bcbc; }
.notice { background: #e9f6ec; color: #1c5a2b; border: 1px solid #b7dfc0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e6eaef; vertical-align: middle; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #5b6b82; }
.plans { display: grid; gap: 10px; margin: 16px 0 20px; }
.plan { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid #b9c2ce; border-radius: 8px; font-weight: 400; cursor: pointer; margin: 0; }
.plan input { margin-top: 5px; }
.video { position: relative; padding-top: 56.25%; margin-bottom: 16px; background: #000; border-radius: 8px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
h1 { color: #0b1f3a; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 20px; border: 1px solid #b9c2ce; border-radius: 999px; color: #1b2a41; background: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 2px 6px rgba(11,31,58,.08); transition: background .2s ease; }
.google-btn::before { content: ""; width: 18px; height: 18px; flex: 0 0 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23FFC107' d='M43.6 20.5H42V20H24v8h11.3C33.7 32.7 29.2 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.3-.1-2.4-.4-3.5z'/%3E%3Cpath fill='%23FF3D00' d='M6.3 14.7l6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 16.3 4 9.7 8.3 6.3 14.7z'/%3E%3Cpath fill='%234CAF50' d='M24 44c5.2 0 9.9-2 13.4-5.2l-6.2-5.2C29.2 36 26.7 37 24 37c-5.2 0-9.6-3.3-11.3-7.9l-6.5 5C9.5 39.6 16.2 44 24 44z'/%3E%3Cpath fill='%231976D2' d='M43.6 20.5H42V20H24v8h11.3c-.8 2.2-2.2 4.2-4.1 5.6l6.2 5.2C37 39.2 44 34 44 24c0-1.3-.1-2.4-.4-3.5z'/%3E%3C/svg%3E") center/contain no-repeat; }
.google-btn:focus-visible { outline: 2px solid #16386b; outline-offset: 2px; }
.or-line { display: flex; align-items: center; gap: 12px; color: #5b6b82; font-size: .85rem; margin: 16px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: #e3e9f3; }
.google-btn:hover { background: #f5f7fb; }
.or-line { text-align: center; color: #5b6b82; font-size: .85rem; margin: 6px 0 14px; }

/* ---- Course and exercise pages ---- */
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: #b7800a; margin: 0 0 4px; }
.course-head { margin-bottom: 28px; }
.course-head h1 { margin-bottom: 6px; }
.hero { background: linear-gradient(135deg, #0b1f3a 0%, #16386b 100%); color: #fff; border-radius: 18px; padding: 32px 36px; margin: 0 0 40px; box-shadow: 0 14px 32px rgba(11, 31, 58, .18); }
.hero .kicker { color: #ffd977; }
.hero h1 { color: #fff; font-size: 1.9rem; margin: 0 0 12px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; color: rgba(255, 255, 255, .8); font-size: .92rem; }
.hero .meta span + span::before { content: "•"; color: #f5b82e; margin: 0 12px; }
.sub-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.sub { background: #fff; border: 1px solid #e3e9f3; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.sub:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(11, 31, 58, .09); border-color: #c9d4e4; }
.sub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.sub h3 { font-size: 1.02rem; margin: 0; color: #0b1f3a; line-height: 1.3; }
.sub-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: #eef3fb; color: #16386b; display: flex; align-items: center; justify-content: center; }
.sub p { font-size: .9rem; color: #5b6b82; margin: 0 0 20px; flex: 1; line-height: 1.55; }
.sub-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aim { text-align: center; font-size: .85rem; font-weight: 600; padding: 9px 12px; border-radius: 999px; text-decoration: none; border: 1.5px solid #16386b; color: #16386b; transition: background .15s ease, color .15s ease; }
.aim:hover { background: #eef3fb; }
.aim-primary { background: #16386b; color: #fff; }
.aim-primary:hover { background: #0b1f3a; border-color: #0b1f3a; color: #fff; }
.aim:focus-visible { outline: 2px solid #f5b82e; outline-offset: 2px; }
.crumbs { font-size: .88rem; margin-bottom: 12px; color: #5b6b82; }
.crumbs a { color: #16386b; }
@media (max-width: 560px) {
  .hero { padding: 24px; }
  .hero h1 { font-size: 1.5rem; }
}

/* ---- Top navigation (matches the home page) ---- */
.site-nav { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid #e3e9f3; }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #0b1f3a; background: linear-gradient(135deg, #f5b82e, #ff9f1c); box-shadow: 0 6px 18px rgba(245, 184, 46, .35); }
.brand-name { font-weight: 700; color: #0b1f3a; letter-spacing: .2px; font-size: 1.1rem; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-pill { display: inline-flex; align-items: center; gap: 6px; background: #eef2f8; color: #0b1f3a; border: 1px solid transparent; border-radius: 999px; padding: .45rem 1rem; font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; }
.nav-pill.is-raised { background: #fff; border-color: #e3e9f3; box-shadow: 0 2px 10px rgba(11, 31, 58, .08); }
.nav-pill.is-gold { background: linear-gradient(135deg, #f5b82e, #ffb020); color: #0b1f3a; box-shadow: 0 8px 20px rgba(245, 184, 46, .32); border: 0; }
.nav-pill:hover { filter: brightness(.98); }
.nav-pill:focus-visible, .nav-link:focus-visible, .panel-item:focus-visible { outline: 2px solid #16386b; outline-offset: 2px; }
.nav-link { color: #16386b; font-weight: 600; font-size: .9rem; text-decoration: none; padding: .45rem .6rem; }
.nav-link:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.course-menu { position: relative; }
.course-menu > summary { list-style: none; }
.course-menu > summary::-webkit-details-marker { display: none; }
.course-menu > summary::after { content: "▾"; font-size: .75rem; opacity: .6; }
.course-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 300px; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 24px 60px rgba(11, 31, 58, .18); border: 1px solid #e3e9f3; }
.panel-head { margin: 6px 12px 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #5b6b82; font-weight: 700; }
.panel-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #1b2a41; text-decoration: none; font-weight: 600; font-size: .92rem; }
.panel-item:hover { background: #eef3fb; color: #0b1f3a; }
.panel-item.is-active { background: #fff6dd; }
.panel-tag { min-width: 56px; text-align: center; font-size: .75rem; font-weight: 700; color: #0b1f3a; background: #f5b82e; padding: 4px 8px; border-radius: 999px; }
@media (max-width: 560px) {
  .nav-inner { padding: 10px 14px; }
  .course-panel { left: 0; right: auto; }
}

/* ---- Cards per row (4, 5 or 6) ---- */
.view-switch { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: -8px 0 20px; }
.view-switch span { font-size: .85rem; color: #5b6b82; margin-right: 6px; }
.view-switch button { border: 1px solid #c9d4e4; background: #fff; color: #0b1f3a; border-radius: 999px; padding: 4px 14px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; min-width: 40px; }
.view-switch button:hover { border-color: #16386b; }
.view-switch button.is-active { background: #16386b; border-color: #16386b; color: #fff; }
.view-switch button:focus-visible { outline: 2px solid #f5b82e; outline-offset: 2px; }
.sub-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sub-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.sub-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.sub-grid.cols-5 .sub, .sub-grid.cols-6 .sub { padding: 16px; border-radius: 14px; }
.sub-grid.cols-5 .sub h3, .sub-grid.cols-6 .sub h3 { font-size: .92rem; }
.sub-grid.cols-5 .sub p, .sub-grid.cols-6 .sub p { font-size: .82rem; margin-bottom: 14px; }
.sub-grid.cols-5 .sub-icon, .sub-grid.cols-6 .sub-icon { display: none; }
.sub-grid.cols-6 .sub-foot { grid-template-columns: 1fr; }
.sub-grid.cols-6 .aim { padding: 7px 10px; font-size: .8rem; }
@media (max-width: 1100px) {
  .sub-grid.cols-4, .sub-grid.cols-5, .sub-grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sub-grid.cols-4, .sub-grid.cols-5, .sub-grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-grid.cols-6 .sub-foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .sub-grid.cols-4, .sub-grid.cols-5, .sub-grid.cols-6 { grid-template-columns: 1fr; }
  .sub-grid.cols-5 .sub-icon, .sub-grid.cols-6 .sub-icon { display: flex; }
}

/* ---- Syllabus map and topic colours ---- */
.tone-1 { --tone: linear-gradient(135deg, #0b1f3a, #16386b); }
.tone-2 { --tone: linear-gradient(135deg, #b7800a, #f5b82e); }
.tone-3 { --tone: linear-gradient(135deg, #0f5b5b, #1f8a84); }
.tone-4 { --tone: linear-gradient(135deg, #4b2a7b, #7c4dbd); }
.tone-5 { --tone: linear-gradient(135deg, #8a2d3b, #c4516a); }
.topic-no { color: #fff; }
.tone-2 .topic-no { color: #0b1f3a; }
.overview { margin-bottom: 36px; scroll-margin-top: 100px; }
.overview .kicker { margin-bottom: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-height: 138px; padding: 18px 20px; border-radius: 18px; background: var(--tone); color: #fff; text-decoration: none; box-shadow: 0 10px 24px rgba(11, 31, 58, .12); transition: transform .2s ease, box-shadow .2s ease; }
.tile::after { content: ""; position: absolute; right: -36px; bottom: -44px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(11, 31, 58, .18); color: #fff; }
.tile-no { font-size: 2.1rem; font-weight: 800; line-height: 1; opacity: .92; }
.tile-name { margin-top: auto; font-weight: 700; font-size: 1rem; line-height: 1.25; }
.tile-count { font-size: .8rem; opacity: .85; }
.tone-2.tile { color: #0b1f3a; }
.tone-2.tile:hover { color: #0b1f3a; }
.tile:focus-visible { outline: 2px solid #f5b82e; outline-offset: 3px; }
