/* ==========================================================================
   Application pages: student portal and admin panel

   Built from the same tokens and components as the public site: hairline
   rules, no drop shadows, radii no larger than 6px, IBM Plex Mono for labels,
   figures and codes. Loaded last, after layout.css.
   ========================================================================== */

/* --- Sign out: a POST form that looks like the nav link beside it ----------- */

.nx-logout-form { display: inline; margin: 0; }

.nx-drawer__meta .nx-logout-form button {
  padding: 0;
  color: var(--nx-on-slab-2);
  background: none;
  border: 0;
  text-decoration: underline;
  font: inherit;
  text-decoration-color: var(--nx-rule-slab-strong);
  cursor: pointer;
}

.nx-drawer__meta .nx-logout-form button:hover { color: var(--nx-on-slab); }

/* --- Section links in the mobile drawer (portal / panel) --------------------- */

.nx-drawer__label {
  margin: 2rem 0 0;
  color: var(--nx-blue-lit);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nx-drawer__label + .nx-drawer__nav { margin-top: 0.75rem; }
.nx-drawer__label:first-of-type { margin-top: 1.25rem; }

.nx-drawer__nav a[aria-current="page"] { color: var(--nx-blue-lit); }

/* --- Portal / panel shell ------------------------------------------------------ */

.nx-app-head { padding-block: clamp(2.25rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem); }
.nx-app-head .nx-phead__title { font-size: var(--nx-step-4); }

.nx-subnav {
  position: sticky;
  top: 4.5rem; /* under the sticky header, as .nx-listing-bar */
  z-index: 20;
  background: var(--nx-paper-2);
  border-bottom: 1px solid var(--nx-rule);
}

.nx-subnav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1rem, 2.4vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nx-subnav__list a {
  position: relative;
  display: block;
  padding: 0.95rem 0 0.85rem;
  color: var(--nx-ink-2);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.nx-subnav__list a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--nx-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--nx-dur) var(--nx-ease);
  content: "";
}

.nx-subnav__list a:hover,
.nx-subnav__list a[aria-current="page"] { color: var(--nx-ink); }
.nx-subnav__list a:hover::after,
.nx-subnav__list a[aria-current="page"]::after { transform: scaleX(1); }

/* On the same breakpoint as the site header, the drawer carries these links. */
@media (max-width: 1080px) {
  .nx-subnav { display: none; }
}

.nx-app-body { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); padding-block: clamp(2rem, 4vw, 3.5rem); }

.nx-messages { display: grid; gap: 0.6rem; }

.nx-app-grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  align-items: start;
}

.nx-facts { display: grid; margin: 0; }

.nx-facts > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--nx-rule);
}

.nx-facts > div:first-child { border-top: 1px solid var(--nx-rule); }

.nx-facts dt {
  color: var(--nx-ink-3);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nx-facts dd { margin: 0; overflow-wrap: anywhere; }
.nx-mono { font-family: var(--nx-font-mono); }

/* --- Status tags: square, mono, one colour per state ---------------------------------
   Coral text fails AA on its own wash, so "needs attention" states use ink text
   on the coral wash with a coral edge instead. */

.nx-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  color: var(--nx-ink-2);
  background: var(--nx-paper-2);
  border-left: 3px solid var(--nx-rule-strong);
  border-radius: var(--nx-r-xs);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.nx-status--under_review,
.nx-status--due { color: var(--nx-blue-deep); background: var(--nx-blue-wash); border-left-color: var(--nx-blue); }

.nx-status--approved,
.nx-status--verified,
.nx-status--active,
.nx-status--paid,
.nx-status--completed { color: var(--nx-white); background: var(--nx-blue); border-left-color: var(--nx-blue-deep); }

.nx-status--rejected,
.nx-status--overdue,
.nx-status--paused,
.nx-status--failed { color: var(--nx-ink); background: var(--nx-coral-wash); border-left-color: var(--nx-coral); }

.nx-status--withdrawn,
.nx-status--cancelled { color: var(--nx-ink-3); }

.nx-status-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }

/* --- Timeline -------------------------------------------------------------------------- */

.nx-timeline { display: grid; gap: 0; margin: 1rem 0; padding: 0; list-style: none; }

.nx-timeline li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.6rem;
  color: var(--nx-ink-3);
  border-left: 1px solid var(--nx-rule);
}

.nx-timeline li::before {
  position: absolute;
  top: 0.95rem;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--nx-paper);
  border: 1px solid var(--nx-rule-strong);
  content: "";
}

.nx-timeline li.is-done { color: var(--nx-ink); }
.nx-timeline li.is-done::before { background: var(--nx-ink); border-color: var(--nx-ink); }
.nx-timeline li.is-current { color: var(--nx-blue-deep); font-weight: 600; }
.nx-timeline li.is-current::before { background: var(--nx-blue); border-color: var(--nx-blue); }
.nx-timeline .nx-mono { margin-right: 0.5rem; color: var(--nx-ink-3); font-size: var(--nx-step--2); font-weight: 400; }

/* --- Document checklist ------------------------------------------------------------------ */

.nx-doclist { display: grid; margin: 0 0 1rem; padding: 0; list-style: none; }

.nx-doclist li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--nx-rule);
}

.nx-doclist li:first-child { border-top: 1px solid var(--nx-rule); }

/* --- Tables: ruled, and stacked into labelled rows on a phone ----------------------------------- */

.nx-table-wrap { overflow-x: auto; }

.nx-table { width: 100%; border-collapse: collapse; font-size: var(--nx-step--1); }

.nx-table th {
  padding: 0.6rem 0.75rem 0.6rem 0;
  color: var(--nx-ink-3);
  border-bottom: 1px solid var(--nx-ink);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.nx-table td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--nx-rule); vertical-align: top; }
.nx-table__note { margin: 0.35rem 0 0; font-size: var(--nx-step--2); }
.nx-table .nx-num { font-family: var(--nx-font-mono); text-align: right; }

@media (max-width: 720px) {
  .nx-table thead { display: none; }
  .nx-table, .nx-table tbody, .nx-table tr, .nx-table td { display: block; width: 100%; }
  .nx-table tr { padding: 0.6rem 0; border-bottom: 1px solid var(--nx-ink); }
  .nx-table td { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.75rem; padding: 0.35rem 0; border: 0; }
  .nx-table td::before {
    color: var(--nx-ink-3);
    font-family: var(--nx-font-mono);
    font-size: var(--nx-step--2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: attr(data-label);
  }
  .nx-table .nx-num { text-align: left; }
}

/* --- Small inline actions --------------------------------------------------------------------- */

.nx-inline-form { display: inline; margin: 0; }

.nx-link-button {
  padding: 0;
  color: var(--nx-blue);
  background: none;
  border: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.nx-link-button:hover { color: var(--nx-blue-deep); }

/* Inside a stacked table cell (a grid), keep the tag its own width. */
.nx-status { justify-self: start; }

/* --- Panel: figures, filters, pager ------------------------------------------------------------- */

.nx-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  border-top: 1px solid var(--nx-ink);
  border-left: 1px solid var(--nx-rule);
}

.nx-kpi {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 1.1rem 1.2rem;
  color: var(--nx-ink);
  border-right: 1px solid var(--nx-rule);
  border-bottom: 1px solid var(--nx-rule);
  text-decoration: none;
  transition: background var(--nx-dur-fast) var(--nx-ease);
}

.nx-kpi:hover { background: var(--nx-white); }
.nx-kpi__value { font-family: var(--nx-font-mono); font-size: var(--nx-step-3); line-height: 1; }
.nx-kpi__label { color: var(--nx-ink-2); font-family: var(--nx-font-mono); font-size: var(--nx-step--2); letter-spacing: 0.08em; text-transform: uppercase; }

.nx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--nx-rule);
  border-bottom: 1px solid var(--nx-rule);
}

.nx-filters label { display: grid; flex: 1 1 11rem; gap: 0.35rem; }
.nx-filters__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.nx-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  color: var(--nx-ink-2);
  font-size: var(--nx-step--1);
}

.nx-pager__links { display: flex; gap: 1rem; align-items: center; }

/* --- Panel: schedule editor and review forms --------------------------------------------------- */

.nx-schedule { display: grid; gap: 0.75rem; margin: 0; padding: 0; border: 0; }
.nx-schedule__rows { display: grid; gap: 0.4rem; }

.nx-schedule__head,
.nx-schedule__row {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}

.nx-schedule__head {
  color: var(--nx-ink-3);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nx-schedule__row .nx-form__control { padding-block: 0.5rem; }

.nx-doclist--review li { align-items: flex-start; }

.nx-review-form {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.nx-review-form .nx-form__control { flex: 1 1 12rem; padding-block: 0.45rem; }

.nx-change {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  overflow-wrap: anywhere;
  white-space: normal;
}

/* --- Read-only values laid out like form controls (pay page) ---------------------------------- */

.nx-form__control--static {
  margin: 0;
  color: var(--nx-ink);
  background: var(--nx-paper-2);
  border-color: var(--nx-rule);
  cursor: default;
  /* Unlike an input, text here cannot shrink; let long emails and numbers wrap. */
  min-width: 0;
  overflow-wrap: anywhere;
}

.nx-form__field { min-width: 0; }

/* --- Fee receipt ------------------------------------------------------------------------------------ */

.nx-receipt {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--nx-white);
  border: 1px solid var(--nx-ink);
  border-radius: var(--nx-r-sm);
}

.nx-receipt__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--nx-ink);
}

.nx-receipt__brand { display: flex; gap: 0.9rem; align-items: flex-start; }
.nx-receipt__brand img { flex: 0 0 auto; border-radius: var(--nx-r-xs); }
.nx-receipt__issuer { margin: 0; font-family: var(--nx-font-display); font-size: var(--nx-step-1); font-weight: 700; }
.nx-receipt__address { margin: 0.25rem 0 0; color: var(--nx-ink-2); font-size: var(--nx-step--1); }
.nx-receipt__title { text-align: right; }
.nx-receipt__title h1 { margin: 0; font-size: var(--nx-step-3); }
.nx-receipt__title p { margin: 0.2rem 0 0; }

.nx-receipt__amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  background: var(--nx-paper-2);
  border-left: 3px solid var(--nx-blue);
}

.nx-receipt__figure { font-family: var(--nx-font-mono); font-size: var(--nx-step-3); }
.nx-receipt__note { margin: 0; color: var(--nx-ink-2); font-size: var(--nx-step--1); }

.nx-receipt__legal {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  color: var(--nx-ink-3);
  border-top: 1px solid var(--nx-rule);
  font-size: var(--nx-step--2);
}

.nx-receipt__legal p { margin: 0; }

@media (max-width: 560px) {
  .nx-receipt__title { text-align: left; }
}

/* Print: the receipt alone, on white. The recognition statement is inside it. */
@media print {
  .nx-skip-link, .nx-header, .nx-drawer, .nx-mega, .nx-footer,
  [data-nx-site-header], [data-nx-site-footer], .nx-subnav, .nx-no-print { display: none !important; }
  body, .nx-page, .nx-section { background: #fff !important; }
  .nx-receipt-page { padding: 0 !important; }
  .nx-receipt { margin: 0; border: 0; padding: 0; }
  .nx-receipt__amount { background: #fff; }
  a { color: inherit; text-decoration: none; }
}

/* --- Panel: revenue figures and bar charts -------------------------------------------------------- */

.nx-kpi--static:hover { background: none; }
.nx-kpi__meta { color: var(--nx-ink-3); font-size: var(--nx-step--2); }

.nx-chart { display: grid; gap: 0.6rem; margin: 0; }

.nx-chart__title {
  color: var(--nx-ink-2);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nx-chart__svg { display: block; width: 100%; height: 9rem; }
.nx-chart__axis { stroke: var(--nx-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.nx-chart__bar { fill: var(--nx-blue); }
.nx-chart__refund { fill: var(--nx-coral); }

.nx-chart__labels {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nx-chart__labels li {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  color: var(--nx-ink-3);
  font-size: var(--nx-step--2);
  text-align: center;
}

.nx-chart__value { color: var(--nx-ink); font-family: var(--nx-font-mono); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .nx-chart__value { display: none; }
}

/* The pay button's label is long; on a narrow phone it takes the full width and wraps. */
@media (max-width: 480px) {
  [data-payment-submit] { width: 100%; justify-content: center; white-space: normal; text-align: center; }
}

/* Narrow phones: panel and portal buttons carry longer labels than the public
   site's, so they may wrap; schedule inputs may shrink below their natural width. */
@media (max-width: 480px) {
  .nx-app-body .nx-btn { white-space: normal; text-align: center; }
  .nx-schedule__row .nx-form__control { width: 100%; min-width: 0; }
}

/* --- Portal: enrolment switcher, progress, weeks ------------------------------------------------- */

.nx-switcher { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.nx-switcher label { display: grid; flex: 1 1 18rem; gap: 0.35rem; max-width: 36rem; }

.nx-progress { display: grid; gap: 0.4rem; }
.nx-progress__bar { height: 8px; overflow: hidden; background: var(--nx-paper-2); border: 1px solid var(--nx-rule); border-radius: var(--nx-r-xs); }
.nx-progress__fill { display: block; height: 100%; background: var(--nx-blue); }
.nx-progress__label { color: var(--nx-ink-2); font-family: var(--nx-font-mono); font-size: var(--nx-step--2); }

.nx-week { display: grid; gap: 0; }
.nx-week__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--nx-ink);
}

.nx-week__title { margin: 0; font-family: var(--nx-font-mono); font-size: var(--nx-step--1); letter-spacing: 0.06em; text-transform: uppercase; }

.nx-lecture-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--nx-rule);
}

.nx-lecture-row__icon { color: var(--nx-blue); font-size: 1.1rem; }
.nx-lecture-row.is-locked .nx-lecture-row__icon,
.nx-lecture-row.is-locked .nx-lecture-row__title { color: var(--nx-ink-3); }
.nx-lecture-row__title { margin: 0; font-size: var(--nx-step-0); font-weight: 600; }
.nx-lecture-row__meta { margin: 0.15rem 0 0; color: var(--nx-ink-3); font-size: var(--nx-step--1); }
.nx-lecture-row__state { color: var(--nx-ink-2); font-family: var(--nx-font-mono); font-size: var(--nx-step--2); text-align: right; }

@media (max-width: 560px) {
  .nx-lecture-row { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .nx-lecture-row__state { grid-column: 2; text-align: left; }
}

.nx-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--nx-slab); border-radius: var(--nx-r-sm); overflow: hidden; }
.nx-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* The YouTube player, with the strips YouTube draws over it cropped off: the
   title, channel, volume and settings along the top; "Copy link" and the
   YouTube button along the bottom. YouTube draws both strips a fixed height
   from the frame's edges, the same at every size. The frame is made taller
   than the video by twice --nx-band, so YouTube letterboxes the video with a
   black band that high above and below it; the frame is raised by one band,
   and the box -- still 16:9 -- shows the video and nothing of either band.
   The time, fullscreen button and seek bar sit just above the bottom strip,
   over the picture, and stay. Volume and speed go with the top strip; the
   device's own volume still works. */
.nx-player--crop { --nx-band: 64px; }
/* The box the crop is measured from. Inline it is the player; full screen it
   stays the video's own 16:9, centred on black. Left to fill a tall phone
   screen, the frame grows so tall that YouTube moves its title down, out of
   the band and into view. */
.nx-player__stage { position: absolute; inset: 0; overflow: hidden; }
.nx-player--crop iframe { inset: auto; top: calc(-1 * var(--nx-band)); left: 0; height: calc(100% + 2 * var(--nx-band)); }
/* Over the picture, clear of the controls along its foot: see player.js. */
.nx-player__shield { position: absolute; top: 0; left: 0; right: 0; bottom: var(--nx-band); padding: 0; border: 0; background: transparent; cursor: pointer; }
.nx-player__shield[hidden] { display: none; }
.nx-player__shield:focus-visible { outline: 3px solid var(--nx-blue); outline-offset: -3px; }

/* The page's own fullscreen button, where YouTube's was: the whole box goes
   full screen, crop and shield with it. The crop is in pixels from the frame's
   edges, so it holds at any screen shape. Where an element cannot go full
   screen (an iPhone), the box fills the window instead: .is-filled. */
.nx-player__fullscreen { position: absolute; right: 24px; bottom: 25px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(0, 0, 0, 0.55); cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.nx-player__fullscreen[hidden] { display: none; }
.nx-player:hover .nx-player__fullscreen, .nx-player__fullscreen:focus-visible, .nx-player.is-fullscreen .nx-player__fullscreen { opacity: 1; }
@media (hover: none) { .nx-player__fullscreen { opacity: 1; } }
.nx-player__fullscreen:focus-visible { outline: 3px solid var(--nx-blue); outline-offset: 2px; }
.nx-player__fullscreen svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nx-player__exit, .nx-player.is-fullscreen .nx-player__enter { display: none; }
.nx-player.is-fullscreen .nx-player__exit { display: block; }
.nx-player:fullscreen { border-radius: 0; background: #000; }
.nx-player.is-filled { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; background: #000; }
.nx-player:fullscreen .nx-player__stage, .nx-player.is-filled .nx-player__stage { inset: auto; top: 50%; left: 50%; width: min(100%, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
.nx-player.is-filled .nx-player__stage { width: min(100%, calc(100dvh * 16 / 9)); }

.nx-locked {
  display: grid;
  gap: 0.75rem;
  place-items: center;
  padding: clamp(2rem, 6vw, 4rem) 1.25rem;
  color: var(--nx-on-slab);
  background: var(--nx-slab);
  border-radius: var(--nx-r-sm);
  text-align: center;
}

.nx-locked i { color: var(--nx-blue-lit); font-size: 1.8rem; }
.nx-locked p { margin: 0; }

.nx-pager-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }

/* --- Panel: gallery thumbnails, grouped checkboxes -------------------------------------------------- */

.nx-gallery-row { display: flex; gap: 0.75rem; align-items: center; min-width: 0; }
.nx-gallery-row img { flex: 0 0 auto; width: 96px; height: 72px; object-fit: cover; border-radius: var(--nx-r-xs); }
.nx-gallery-preview { display: block; width: 100%; max-width: 32rem; height: auto; border-radius: var(--nx-r-sm); }

.nx-form__group { display: grid; gap: 0.4rem; margin: 0; padding: 0; border: 0; }
.nx-form__group legend { margin-bottom: 0.4rem; padding: 0; }

/* --- Portal: exams ------------------------------------------------------------------------------ */

.nx-exam-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--nx-rule);
}
.nx-exam-row__main { min-width: 0; }
.nx-exam-row__message { margin: 0.35rem 0 0; color: var(--nx-ink-2); font-size: var(--nx-step--1); }
.nx-exam-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.5rem; }

.nx-exam-notes { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--nx-ink-2); font-size: var(--nx-step--1); line-height: 1.5; }
.nx-exam-notes li + li { margin-top: 0.35rem; }

.nx-exam { display: grid; gap: 1.5rem; }
.nx-exam__bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--nx-slab);
  color: var(--nx-on-slab);
  border-radius: var(--nx-r-md);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--1);
}
.nx-exam__clock { display: inline-flex; align-items: center; gap: 0.45rem; font-size: var(--nx-step-1); font-weight: 500; }
.nx-exam.is-ending .nx-exam__bar { background: var(--nx-coral-wash); color: var(--nx-ink); outline: 1px solid var(--nx-coral); }
.nx-exam__saved { margin-left: auto; color: inherit; opacity: 0.8; }

.nx-exam__section { display: grid; gap: 0.75rem; }
.nx-exam__subject { padding-bottom: 0.5rem; border-bottom: 1px solid var(--nx-ink); }

.nx-exam__question {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  background: var(--nx-white);
  border: 1px solid var(--nx-rule);
  border-radius: var(--nx-r-lg);
  display: grid;
  gap: 0.5rem;
}
.nx-exam__question legend { float: left; width: 100%; margin-bottom: 0.5rem; padding: 0; font-weight: 600; line-height: 1.45; }
.nx-exam__number { margin-right: 0.25rem; color: var(--nx-blue); }
.nx-exam__option {
  clear: both;
  display: grid;
  grid-template-columns: 1.2rem 1.4rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--nx-rule);
  border-radius: var(--nx-r-md);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.nx-exam__option:hover { border-color: var(--nx-ink-3); }
.nx-exam__option:has(input:checked) { border-color: var(--nx-blue); background: var(--nx-blue-wash); }
.nx-exam__option input { width: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; accent-color: var(--nx-blue); }
.nx-exam__qstate { min-height: 1.2em; color: var(--nx-ink-3); font-family: var(--nx-font-mono); font-size: var(--nx-step--2); }
.nx-exam__submit { display: grid; gap: 0.75rem; justify-items: start; padding-top: 1rem; border-top: 1px solid var(--nx-rule); }

@media (max-width: 560px) {
  .nx-exam-row { grid-template-columns: minmax(0, 1fr); }
  .nx-exam-row__actions { justify-content: flex-start; }
  .nx-exam__saved { margin-left: 0; flex-basis: 100%; }
}

/* --- Jump row -------------------------------------------------------------------------------
   The actions on a long admin page, named at the top. The forms stay where they
   belong; this is so you can see they are there without scrolling to find out. */

.nx-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--nx-rule);
}

.nx-jump__label {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-ink-3);
}

.nx-jump__link {
  font-size: var(--nx-step--1);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--nx-rule-strong);
}

.nx-jump__link:hover,
.nx-jump__link:focus-visible { text-decoration-color: currentColor; }

/* Anchored headings should not land under the panel's sticky bar. */
.nx-app-grid [id] { scroll-margin-top: 5rem; }

/* --- Superuser full control on an enrolment ----------------------------------------------- */

.nx-override { margin-top: 2rem; border-top: 2px solid var(--nx-blue); }
.nx-override h3 { margin-top: 1.75rem; }

.nx-instalment-editor { display: grid; gap: 0.6rem; margin-top: 0.75rem; }

.nx-instalment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--nx-rule);
}

.nx-instalment-row__form {
  display: grid;
  grid-template-columns: 2.5rem minmax(6rem, 1fr) minmax(9rem, 1fr) minmax(7rem, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  flex: 1 1 32rem;
}

.nx-instalment-row__num { color: var(--nx-ink-3); }

@media (max-width: 40rem) {
  .nx-instalment-row__form { grid-template-columns: 1fr 1fr; }
}
