/* Course page v2 · fold 5 "Is this the right level?" (#next-level, .nl-). Tokens only (base.css / page.css); no hex values.
   Desktop: head, one white panel holding the level table, an action bar. The current column has an --l100 fill and a JS-drawn
   brand ring (.nl-ring); without JS the current cells draw brand side borders instead. Hover on another column fills it and lifts
   a JS-placed .nl-plate. Phones: a "Compare with" switch shows one course column (JS); without JS the panel scrolls sideways. */

.course-v2 .nl .nl-head { max-width: none; }
.course-v2 .nl .nl-head .v3-h2 { max-width: none; }
.course-v2 .nl .nl-lead { max-width: 62ch; }

/* ---------- Panel and table ---------- */
.course-v2 .nl-panel {
    position: relative; background: var(--white); border: 1px solid var(--l200); border-radius: var(--r-panel);
    box-shadow: var(--shadow-card);
}
.course-v2 .nl-panel:focus { outline: none; }
.course-v2 .nl-panel:focus-visible { outline: var(--focus-light); outline-offset: 3px; }
.course-v2 .nl-table {
    width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0;
    font-size: 16px; line-height: 1.5; color: var(--ink-2); position: relative; z-index: 1;
}
.course-v2 .nl-table .nl-corner { width: 22%; }
.course-v2 .nl-table.nl-three .nl-colhead { width: 26%; }
.course-v2 .nl-table.nl-two .nl-colhead { width: 39%; }
.course-v2 .nl-table th, .course-v2 .nl-table td { text-align: left; vertical-align: middle; font-size: 16px; }

/* Head cells: level label line (with the chip on the current column), then the course name. */
.course-v2 .nl-table thead th, .course-v2 .nl-table thead td { padding: 14px 16px 12px; vertical-align: top; }
.course-v2 .nl-levelrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-bottom: 4px; }
.course-v2 .nl-level { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--mute); font-family: inherit; }
.course-v2 .nl-chip { flex: none; padding: 2px 10px; background: var(--white); color: var(--brand-deep); border: 1px solid var(--l300); }
.course-v2 .nl-name {
    display: inline; font-family: 'Outfit', sans-serif; font-size: 19px; line-height: 1.3; font-weight: 600; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-v2 a.nl-name {
    text-decoration: none; padding-bottom: 2px;
    background-image: linear-gradient(var(--brand-deep), var(--brand-deep)), linear-gradient(var(--l300), var(--l300));
    background-size: 0 2px, 100% 2px; background-position: 0 100%, 0 100%; background-repeat: no-repeat;
    display: inline; -webkit-line-clamp: unset;
}
.course-v2 a.nl-name:hover, .course-v2 a.nl-name:focus-visible { color: var(--brand-deep); background-size: 100% 2px, 100% 2px; }
.course-v2 a.nl-name:focus-visible { outline: var(--focus-light); outline-offset: 3px; border-radius: 4px; }
.course-v2 .nl-youon { display: none; margin-top: 6px; font-size: 16px; font-weight: 400; line-height: 1.4; color: var(--mute); }

/* Body rows */
.course-v2 .nl-table tbody th, .course-v2 .nl-table tbody td { padding: 10px 16px; border-top: 1px solid var(--l200); line-height: 1.5; }
.course-v2 .nl-table tbody th[scope="row"] { padding-left: 24px; font-weight: 600; color: var(--ink); font-family: inherit; }
.course-v2 .nl-table tbody td { color: var(--ink-2); }
.course-v2 .nl-table .nl-go { cursor: pointer; }

/* Rounded corners for filled cells (the panel keeps overflow visible so the ring and plate can sit on its edge). */
.course-v2 .nl-table thead tr > :first-child { border-top-left-radius: calc(var(--r-panel) - 1px); }
.course-v2 .nl-table thead tr > :last-child { border-top-right-radius: calc(var(--r-panel) - 1px); }
.course-v2 .nl-table tbody tr:last-child > :first-child { border-bottom-left-radius: calc(var(--r-panel) - 1px); }
.course-v2 .nl-table tbody tr:last-child > :last-child { border-bottom-right-radius: calc(var(--r-panel) - 1px); }

/* Current column: fill, plus a border-drawn highlight until the JS ring takes over. */
.course-v2 .nl-table .is-current { background: var(--l100); box-shadow: inset 2px 0 0 var(--brand), inset -2px 0 0 var(--brand); }
.course-v2 .nl-table thead .is-current { box-shadow: inset 2px 0 0 var(--brand), inset -2px 0 0 var(--brand), inset 0 3px 0 var(--brand); }
.course-v2 .nl-panel.nl-ringed .nl-table .is-current { box-shadow: none; }

/* JS overlays: the current-column ring and the hover plate. Both aria-hidden and never in the way of a click. */
.course-v2 .nl-ring, .course-v2 .nl-plate { position: absolute; top: 0; left: 0; width: 0; height: 0; pointer-events: none; display: none; border-radius: var(--r-card); }
.course-v2 .nl-panel.nl-ringed .nl-ring {
    display: block; z-index: 2; border: 2px solid var(--brand);
    box-shadow: 0 20px 40px -22px color-mix(in srgb, var(--brand) 60%, transparent);
    clip-path: inset(0 round var(--r-card));
}
.course-v2 .nl-panel.nl-ringed .nl-plate {
    display: block; z-index: 0; background: var(--white); border: 1px solid var(--l300); box-shadow: var(--shadow-card);
    opacity: 0; transform: translate3d(0, 0, 0);
}
.course-v2 .nl-panel .nl-plate.is-on { opacity: 1; transform: translate3d(0, -4px, 0); }

@media (hover: hover) and (pointer: fine) {
    .course-v2 .nl-table:has([data-col="1"]:not(.is-current):hover) [data-col="1"],
    .course-v2 .nl-table:has([data-col="2"]:not(.is-current):hover) [data-col="2"],
    .course-v2 .nl-table:has([data-col="3"]:not(.is-current):hover) [data-col="3"] { background: var(--l50); }
    .course-v2 .nl-table:has([data-col="1"]:not(.is-current):hover) [data-col="1"] a.nl-name,
    .course-v2 .nl-table:has([data-col="2"]:not(.is-current):hover) [data-col="2"] a.nl-name,
    .course-v2 .nl-table:has([data-col="3"]:not(.is-current):hover) [data-col="3"] a.nl-name { color: var(--brand-deep); background-size: 100% 2px, 100% 2px; }
    /* With the plate on, the panel shows through the hovered cells so the lift reads as one card. */
    .course-v2 .nl-panel.nl-ringed .nl-table:has([data-col]:not(.is-current):hover) [data-col]:not(.is-current) { background: transparent; }
}

/* ---------- Action bar ---------- */
.course-v2 .nl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; margin-top: 24px; min-height: 56px; }
.course-v2 .nl-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; }
.course-v2 .nl-link { font-size: 16px; }
.course-v2 .nl-link .v3-i { width: 18px; height: 18px; transition: transform 160ms var(--ease); }
.course-v2 .nl-link:hover .v3-i { transform: translateX(3px); }
.course-v2 .nl-ask { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.course-v2 .nl-ask-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.course-v2 .nl-cta { min-height: 52px; }

/* ---------- Switch (phones, JS only) ---------- */
.course-v2 .nl-switch { display: none; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.course-v2 .nl-seg {
    position: relative; display: grid; grid-template-columns: repeat(var(--nl-n, 3), 1fr); padding: 4px;
    background: var(--white); border: 1px solid var(--l200); border-radius: var(--r-choice);
}
.course-v2 .nl-pill {
    position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--nl-n, 3));
    border-radius: 9px; background: var(--brand); transform: translate3d(calc(var(--nl-i, 0) * 100%), 0, 0);
}
.course-v2 .nl-opt { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; padding: 0 4px; cursor: pointer; border-radius: 9px; }
.course-v2 .nl-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.course-v2 .nl-opt-text { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; line-height: 1.2; color: var(--ink); text-align: center; transition: color 200ms var(--ease); }
.course-v2 .nl-opt:has(input:checked) .nl-opt-text { color: var(--white); }
.course-v2 .nl-opt:has(input:focus-visible) { outline: var(--focus-light); outline-offset: 2px; }
.course-v2 .nl-here { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.course-v2 .nl-opt:has(input:checked) .nl-here { background: var(--white); }

/* ---------- Motion (hidden start states only under html.hv-motion; page.js guarantees .cv2-in / .cv2-done) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .course-v2 .nl-panel.nl-ringed .nl-plate { transition: opacity 240ms var(--ease), transform 240ms var(--ease); }
    .course-v2 .nl-table td, .course-v2 .nl-table th { transition: background-color 240ms var(--ease); }
    .course-v2 a.nl-name { transition: background-size 240ms var(--ease), color 160ms ease; }
    .course-v2 .nl-pill { transition: transform 280ms var(--ease); }
    .course-v2 .nl-table tbody tr { transition: opacity 420ms var(--ease), transform 480ms var(--ease); }
    .course-v2 .nl-table tbody tr:nth-child(1) { transition-delay: 320ms; }
    .course-v2 .nl-table tbody tr:nth-child(2) { transition-delay: 390ms; }
    .course-v2 .nl-table tbody tr:nth-child(3) { transition-delay: 460ms; }
    .course-v2 .nl-table tbody tr:nth-child(4) { transition-delay: 530ms; }
    .course-v2 .nl-table tbody tr:nth-child(n+5) { transition-delay: 600ms; }
    .course-v2 .nl-done .nl-table tbody tr { transition-delay: 0ms; }
    .course-v2 .nl-panel.nl-ringed .nl-ring { transition: clip-path 520ms var(--ease); }
    .course-v2 .nl-chip { transition: opacity 260ms var(--ease), transform 260ms var(--ease); }
    .course-v2 .nl-table.nl-swap [data-col] { animation: nl-in 200ms var(--ease) both; }
}
html.hv-motion .course-v2 .nl.cv2-armed:not(.cv2-in) .nl-table tbody tr { opacity: 0; transform: translate3d(0, 8px, 0); }
html.hv-motion .course-v2 .nl-panel.nl-pre .nl-ring { clip-path: inset(0 0 100% 0 round var(--r-card)); }
html.hv-motion .course-v2 .nl-panel.nl-pre .nl-chip { opacity: 0; transform: scale(.85); }
.course-v2 .nl-panel.nl-drawn .nl-chip { transition-delay: 480ms; }
@keyframes nl-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }

/* ---------- 1024-1365px: wider row-header column ---------- */
@media (min-width: 1024px) and (max-width: 1365px) {
    .course-v2 .nl-table .nl-corner { width: 24%; }
    .course-v2 .nl-table.nl-three .nl-colhead { width: 25.33%; }
    .course-v2 .nl-table.nl-two .nl-colhead { width: 38%; }
}

/* ---------- Tablet (768-1023px) ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
    .course-v2 .nl-table .nl-corner { width: 26%; }
    .course-v2 .nl-table.nl-three .nl-colhead { width: 24.66%; }
    .course-v2 .nl-table.nl-two .nl-colhead { width: 37%; }
    .course-v2 .nl-table thead th, .course-v2 .nl-table thead td { padding: 14px 14px 12px; }
    .course-v2 .nl-table tbody th, .course-v2 .nl-table tbody td { padding: 11px 14px; }
    .course-v2 .nl-table tbody th[scope="row"] { padding-left: 18px; }
    .course-v2 .nl-levelrow { flex-wrap: wrap; }
}

/* ---------- Phones (<768px) ---------- */
@media (max-width: 767px) {
    .course-v2 .nl.v3-section { padding: 56px 0 64px; }
    .course-v2 .nl .v3-h2 { font-size: 28px; line-height: 1.12; }
    .course-v2 .nl-levelrow { flex-wrap: wrap; justify-content: flex-start; }

    /* No JS: the panel scrolls sideways (inside itself only) with a sticky row-header column. */
    .course-v2 .nl-panel { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
    .course-v2 .nl-table { min-width: 840px; }
    .course-v2 .nl-table .nl-corner { width: 120px; }
    .course-v2 .nl-table.nl-three .nl-colhead, .course-v2 .nl-table.nl-two .nl-colhead { width: 240px; }
    .course-v2 .nl-table.nl-two { min-width: 600px; }
    .course-v2 .nl-table thead th, .course-v2 .nl-table thead td { padding: 14px 14px 12px; }
    .course-v2 .nl-table tbody th, .course-v2 .nl-table tbody td { padding: 12px 14px; }
    .course-v2 .nl-table tbody th[scope="row"] { padding-left: 16px; }
    .course-v2 .nl-table .nl-corner, .course-v2 .nl-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 2; background: var(--white); }

    /* JS on: the switch picks one course column; the table fits the panel. */
    .course-v2 .nl.nl-js .nl-switch { display: block; }
    .course-v2 .nl.nl-js .nl-panel { overflow: visible; }
    .course-v2 .nl.nl-js .nl-table { min-width: 0; }
    .course-v2 .nl.nl-js .nl-table .nl-corner { width: 40%; position: static; }
    .course-v2 .nl.nl-js .nl-table .nl-colhead { width: 60% !important; }
    .course-v2 .nl.nl-js .nl-table tbody th[scope="row"] { position: static; }
    .course-v2 .nl.nl-js .nl-table[data-show-col="1"] [data-col]:not([data-col="1"]),
    .course-v2 .nl.nl-js .nl-table[data-show-col="2"] [data-col]:not([data-col="2"]),
    .course-v2 .nl.nl-js .nl-table[data-show-col="3"] [data-col]:not([data-col="3"]) { display: none; }
    .course-v2 .nl.nl-js .nl-youon { display: block; }
    /* The visible course column is always the last one: round its corners. */
    .course-v2 .nl.nl-js .nl-table thead [data-col] { border-top-right-radius: calc(var(--r-panel) - 1px); }
    .course-v2 .nl.nl-js .nl-table tbody tr:last-child [data-col] { border-bottom-right-radius: calc(var(--r-panel) - 1px); }
    .course-v2 .nl.nl-js .nl-panel.nl-ringed .nl-ring { display: none; }
    .course-v2 .nl.nl-js .nl-panel.nl-ringed .nl-table .is-current { box-shadow: inset -2px 0 0 var(--brand), inset 2px 0 0 var(--brand); }
    .course-v2 .nl-plate { display: none !important; }

    .course-v2 .nl-bar { flex-direction: column; align-items: stretch; gap: 16px; margin-top: 20px; }
    .course-v2 .nl-links { flex-direction: column; align-items: stretch; gap: 0; }
    .course-v2 .nl-link { width: 100%; }
    .course-v2 .nl-ask { flex-direction: column; align-items: stretch; gap: 12px; margin-left: 0; }
    .course-v2 .nl-cta { width: 100%; min-height: 56px; justify-content: center; }
}

/* ---------- Forced colours and print ---------- */
@media (forced-colors: active) {
    .course-v2 .nl-ring, .course-v2 .nl-plate { display: none !important; }
    .course-v2 .nl-table .is-current { outline: 2px solid Highlight; outline-offset: -2px; }
    .course-v2 .nl-pill { background: Highlight; }
}
@media print {
    .course-v2 .nl-ring, .course-v2 .nl-plate, .course-v2 .nl-switch { display: none !important; }
    .course-v2 .nl-table [data-col] { display: table-cell !important; }
    .course-v2 .nl-table thead [data-col] { display: table-cell !important; }
    .course-v2 .nl-table tbody tr { opacity: 1 !important; transform: none !important; }
}
.course-v2 .nl-corner-t { font-size: 16px; font-weight: 600; color: var(--mute); }
