/* Everything is scoped to html[data-edr-on] so "Classic view" restores EduRec untouched. */

html[data-edr-on] {
  /* Colour tokens come from src/themes.js (one rule per theme). These are the
     theme-independent ones. */
  --edr-font: "Public Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --edr-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --edr-radius: 8px;
  --edr-radius-sm: 6px;
  --edr-inset: 18px; /* left/right padding inside a card: EduRec grid headers, cells, summaries */
  --edr-nav-w: 248px;
}

/* ---------- PeopleSoft restyle (light touch, class names from Fluid UI) ---------- */

html[data-edr-on] body {
  background: var(--edr-bg) !important;
  color: var(--edr-ink);
  font-family: var(--edr-font) !important;
}
html[data-edr-on] body,
html[data-edr-on] .ps_box-label, html[data-edr-on] .ps-label, html[data-edr-on] .ps-text,
html[data-edr-on] .ps_box-value, html[data-edr-on] .ps-link, html[data-edr-on] .ps-button,
html[data-edr-on] .ps_grid-cell, html[data-edr-on] td, html[data-edr-on] th, html[data-edr-on] input, html[data-edr-on] select {
  font-family: var(--edr-font) !important;
}
html[data-edr-on] a, html[data-edr-on] .ps-link { color: var(--edr-blue); }
html[data-edr-on] .ps_header,
html[data-edr-on] #PT_HEADER {
  background: var(--edr-surface) !important;
  border-bottom: 1px solid var(--edr-line) !important;
  box-shadow: none !important;
}
html[data-edr-on] .ps_pagetitle,
html[data-edr-on] .ps_pagetitle * {
  color: var(--edr-ink) !important;
  font-weight: 700 !important;
}
html[data-edr-on] .ps-button,
html[data-edr-on] input[type="button"],
html[data-edr-on] input[type="submit"] {
  border-radius: var(--edr-radius-sm) !important;
  border: 1px solid var(--edr-line) !important;
  background: var(--edr-surface) !important;
  color: var(--edr-ink) !important;
  box-shadow: none !important;
}
html[data-edr-on] .ps-button.psc_primary,
html[data-edr-on] .psc_primary .ps-button {
  background: var(--edr-navy) !important;
  border-color: var(--edr-navy) !important;
  color: var(--edr-on-primary) !important;
}
html[data-edr-on] table { border-collapse: collapse; }
html[data-edr-on] .ps_grid-row:hover > td,
html[data-edr-on] .ps_grid-row:hover > .ps_grid-cell { background: var(--edr-surface-2); }
html[data-edr-on] th,
html[data-edr-on] .ps_grid-col { color: var(--edr-muted); font-weight: 600; }
html[data-edr-on] td,
html[data-edr-on] .ps_grid-cell { border-color: var(--edr-line-2) !important; }

/* ---------- EduRec Fluid page frame ----------
   Every component page shares: #PT_WRAPPER > #PT_HEADER (back · title · icons)
   and #PT_MID_SECTION > #PT_SIDE (page list) + #PT_CONTENT > #PT_MAIN > .ps_apps_content. */

html[data-edr-on] #PT_WRAPPER *:not(img) { font-family: var(--edr-font) !important; }
html[data-edr-on] #PT_WRAPPER,
html[data-edr-on] #PT_MID_SECTION,
html[data-edr-on] #PT_CONTENT,
html[data-edr-on] #PT_MAIN,
html[data-edr-on] .ps_pagecontainer,
html[data-edr-on] .ps_pspagecontainer,
html[data-edr-on] .ps_apps_content { background: var(--edr-bg) !important; }

/* Dark themes: EduRec hard-codes dark-on-white, so recolour its text and clear its
   white fills. :where() keeps these at the lowest priority, so the reskin's own
   surface rules below still win. */
html[data-edr-on][data-edr-dark] body { background: var(--edr-bg) !important; color: var(--edr-ink) !important; }
html[data-edr-on][data-edr-dark] :where(body *:not(.edr-root, .edr-root *, img, svg, path)) {
  color: var(--edr-ink) !important; border-color: var(--edr-line) !important;
  background-color: transparent !important; background-image: none !important;
}
html[data-edr-on][data-edr-dark] :where(body a:not(.edr-root *), body .ps-link) { color: var(--edr-blue) !important; }
html[data-edr-on][data-edr-dark] :where(#PT_HEADER, .ps_header_bar, .ps_header_bar_cont, .ps_pagetitle_cont, #PT_SIDE, .ps_box-grid-flex, .ps_box-grid-list li.ps_grid-row, tr.ps_grid-row > td) {
  background-color: var(--edr-surface) !important;
}
html[data-edr-on][data-edr-dark] :where(.ps_grid-head-row th) { background-color: var(--edr-surface-2) !important; }
html[data-edr-on][data-edr-dark] :where(#PT_HEADER img, ul.psa_list-linkmenu img) { filter: invert(1) hue-rotate(180deg) brightness(1.1); }

/* EduRec draws dashed/dotted outlines on hover and on mouse focus (page-list rows,
   tabs, buttons; sometimes on the focused row's inner box). Remove them all; keep
   one solid ring for keyboard focus only. */
html[data-edr-on] *:hover,
html[data-edr-on] *:focus:not(:focus-visible),
html[data-edr-on] *:focus:not(:focus-visible) *,
html[data-edr-on] .psc_focus,
html[data-edr-on] .psc_focus * { outline: none !important; }
html[data-edr-on] .psc_button-transparent .ps-button:hover { border-style: solid !important; border-color: transparent !important; }
/* EduRec focuses the first row of a list on load, and the browser treats that as
   keyboard focus. Focus shows only once a key has been used (data-edr-kbd, keys.js). */
html[data-edr-on]:not([data-edr-kbd]) #PT_WRAPPER :focus-visible { outline: none !important; }
html[data-edr-on][data-edr-kbd] #PT_WRAPPER :focus-visible { outline: 2px solid var(--edr-blue) !important; outline-offset: 2px !important; }
/* An outline on a list row gets clipped by the list and ignores the card's
   radius, so rows show focus as their border. */
html[data-edr-on] #PT_WRAPPER li.ps_grid-row:focus-visible,
html[data-edr-on] #PT_WRAPPER li.ps_grid-row:focus { outline: none !important; }
html[data-edr-on][data-edr-kbd] #PT_WRAPPER li.ps_grid-row:not(.edr-coach-target):focus-visible { border-color: var(--edr-blue) !important; }

/* Header: white bar, left-aligned title, our sidebar replaces Home and NavBar. */
html[data-edr-on] .ps_header_bar,
html[data-edr-on] .ps_header_bar_cont,
html[data-edr-on] .ps_pagetitle_cont { background: var(--edr-surface) !important; background-image: none !important; }
html[data-edr-on] [id$="hdrdivPT_HOME"],
html[data-edr-on] [id$="hdrdivPT_NAVBAR"] { display: none !important; }
html[data-edr-on] #PT_HEADER .ps_header_button img,
html[data-edr-on] #PT_HEADER .ps_button_backnav img { filter: brightness(0) saturate(100%) invert(18%) sepia(43%) saturate(1500%) hue-rotate(195deg); }
/* Back and the reskin's Pages button share one shape: 36px, same padding, same type. */
html[data-edr-on] .ps_button_backnav .ps-button {
  display: inline-flex !important; align-items: center !important; height: 36px !important; min-height: 0 !important;
  padding: 0 14px 0 11px !important; box-sizing: border-box !important; line-height: 1 !important;
  background: var(--edr-surface) !important; border: 1px solid var(--edr-line) !important; border-radius: var(--edr-radius-sm) !important;
  box-shadow: none !important; color: var(--edr-selected-ink) !important;
}
html[data-edr-on] .ps_button_backnav .ps-button:hover { background: var(--edr-surface-2) !important; border-color: var(--edr-line-strong) !important; }
html[data-edr-on] .ps_button_backnav .ps-button img { display: none !important; }
/* EduRec labels Back with whichever app you came from; just say Back, with a drawn arrow. */
html[data-edr-on] .ps_button_backnav .ps-text {
  position: static !important; display: inline-flex !important; align-items: center; gap: 8px; font-size: 0 !important; color: var(--edr-selected-ink) !important;
}
html[data-edr-on] .ps_button_backnav .ps-text::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
html[data-edr-on] .ps_button_backnav .ps-text::after { content: "Back"; font-size: 14px; font-weight: 600; line-height: 1; color: var(--edr-selected-ink); }
html[data-edr-on] #PT_HEADER .ps_pagetitle,
html[data-edr-on] #PT_HEADER .ps_pagetitle .ps-text { font-size: 15px !important; font-weight: 600 !important; color: var(--edr-muted) !important; }

/* Page list (master list in the side panel). */
html[data-edr-on] #PT_SIDE,
html[data-edr-on] #PT_SIDE .pst_panel-content,
html[data-edr-on] #PT_SIDE .ps_box-grouplet,
html[data-edr-on] #PT_SIDE .ps_scrollable { background: var(--edr-surface) !important; }
html[data-edr-on] #PT_SIDE { border-right: 1px solid var(--edr-line) !important; box-shadow: none !important; }
html[data-edr-on] ul.psa_list-linkmenu { padding: 12px 10px !important; background: var(--edr-surface) !important; }
html[data-edr-on] ul.psa_list-linkmenu > li {
  border: 0 !important; border-radius: var(--edr-radius-sm) !important; margin: 1px 0 !important; background: transparent !important;
}
html[data-edr-on] ul.psa_list-linkmenu > li:hover { background: var(--edr-surface-2) !important; }
html[data-edr-on] ul.psa_list-linkmenu > li.psc_selected { background: var(--edr-tint) !important; }
html[data-edr-on] ul.psa_list-linkmenu .psa_list-linkitem,
html[data-edr-on] ul.psa_list-linkmenu .ps-link { background: transparent !important; border: 0 !important; }
html[data-edr-on] ul.psa_list-linkmenu .ps-link {
  display: flex !important; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px !important;
  color: var(--edr-ink-2) !important; text-decoration: none !important;
}
html[data-edr-on] ul.psa_list-linkmenu > li.psc_selected .ps-link { color: var(--edr-selected-ink) !important; }
html[data-edr-on] ul.psa_list-linkmenu .ps-link .ps-text { font-size: 14px !important; font-weight: 500 !important; color: inherit !important; }
html[data-edr-on] ul.psa_list-linkmenu > li.psc_selected .ps-text { font-weight: 600 !important; }
html[data-edr-on] ul.psa_list-linkmenu .ps-link img { display: none !important; }
/* EduRec pads each item's wrapper by ~15px, doubling the row height. */
html[data-edr-on] ul.psa_list-linkmenu .psa_vtab { padding: 0 !important; }
html[data-edr-on] ul.psa_list-linkmenu .psa_list-linkitem { height: auto !important; }

/* Content column. */
html[data-edr-on] .ps_apps_content { padding: 28px 32px 48px !important; box-sizing: border-box; }
html[data-edr-on] .ps_apps_content > * { max-width: 1100px; }
/* EduRec nests a page's content box inside the frame's; pad only the outer one. */
html[data-edr-on] .ps_apps_content .ps_apps_content { padding: 0 !important; }
@media (max-width: 599px) { html[data-edr-on] .ps_apps_content { padding: 16px 12px 40px !important; } }
html[data-edr-on] .psa_pagetitle .ps_pagetitle,
html[data-edr-on] .psa_pagetitle .ps_pagetitle .ps-text,
html[data-edr-on] h1#PANEL_TITLE,
html[data-edr-on] h1#PANEL_TITLE .ps-text { font-size: 26px !important; font-weight: 700 !important; color: var(--edr-ink) !important; letter-spacing: -0.01em; }

/* Grids become cards with calm tables. */
html[data-edr-on] .ps_box-grid-flex {
  background: var(--edr-surface) !important; border: 1px solid var(--edr-line) !important; border-radius: var(--edr-radius) !important;
  overflow: hidden; margin: 0 0 20px !important; max-width: 100% !important; box-shadow: none !important;
}
html[data-edr-on] .ps_box-grid-header { background: var(--edr-surface) !important; border: 0 !important; padding: 14px var(--edr-inset) 6px !important; }
html[data-edr-on] .ps_grid-title,
html[data-edr-on] .ps_grid-title .ps-text { font-size: 16px !important; font-weight: 700 !important; color: var(--edr-ink) !important; }
html[data-edr-on] .psc_rowcount .ps-text { font-size: 13px !important; color: var(--edr-muted) !important; }
/* The student's name above a page: EduRec's brown fails on dark and grey themes. */
html[data-edr-on] [id^="DERIVED_NAME_PERSON_NAME"] { color: var(--edr-ink) !important; }
html[data-edr-on] .ps_box-gridc, html[data-edr-on] .ps_box-gridc-right, html[data-edr-on] .ps_box-grid { overflow-x: auto; }
html[data-edr-on] table.ps_grid-flex { width: 100% !important; border-collapse: collapse !important; background: var(--edr-surface) !important; }
html[data-edr-on] .ps_grid-head-row th.ps_grid-col {
  background: var(--edr-surface-2) !important; border: 0 !important; border-bottom: 1px solid var(--edr-line) !important;
  padding: 10px var(--edr-inset) !important; text-align: left;
}
html[data-edr-on] .ps_grid-col-label,
html[data-edr-on] .ps_grid-col-label * { font-size: 13px !important; font-weight: 600 !important; color: var(--edr-muted) !important; text-decoration: none !important; }
html[data-edr-on] tr.ps_grid-row > td.ps_grid-cell {
  background: var(--edr-surface) !important; border: 0 !important; border-bottom: 1px solid var(--edr-line-2) !important;
  padding: 12px var(--edr-inset) !important; vertical-align: middle;
}
html[data-edr-on] tr.ps_grid-row:last-child > td.ps_grid-cell { border-bottom: 0 !important; }
html[data-edr-on] tr.ps_grid-row:hover > td.ps_grid-cell { background: var(--edr-surface-2) !important; }
html[data-edr-on] td.ps_grid-cell .ps_box-value,
html[data-edr-on] td.ps_grid-cell .ps-link,
html[data-edr-on] td.ps_grid-cell .ps-text { font-size: 14px !important; color: var(--edr-ink) !important; }
html[data-edr-on] td.ps_grid-cell .ps-link { color: var(--edr-blue) !important; }
html[data-edr-on] td.psc_num, html[data-edr-on] th.psc_num { text-align: right !important; font-variant-numeric: tabular-nums; }

/* List grids (term pickers, programme pickers) become a grid of cards. */
html[data-edr-on] #PT_MAIN .ps_box-grid-list { padding: 24px 32px !important; box-sizing: border-box; }
html[data-edr-on] .ps_apps_content .ps_box-grid-list { padding: 0 !important; }
html[data-edr-on] .ps_box-grid-list,
html[data-edr-on] .ps_box-grid-list .ps_box-grid,
html[data-edr-on] .ps_box-grid-list .ps_grid-list { background: transparent !important; border: 0 !important; box-shadow: none !important; max-height: none !important; }
/* A list's header bar is empty; painted, it reads as a white strip over the cards. */
html[data-edr-on] .ps_box-grid-list > .ps_box-grid-header { background: transparent !important; padding: 0 !important; }
html[data-edr-on] .ps_box-grid-list ul.ps_grid-body {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
  padding: 0 !important; margin: 0 !important; background: transparent !important;
}
html[data-edr-on] .ps_box-grid-list li.ps_grid-row {
  display: flex !important; flex-direction: column; gap: 4px; padding: 16px 18px !important; margin: 0 !important;
  background: var(--edr-surface) !important; border: 1px solid var(--edr-line) !important; border-radius: var(--edr-radius) !important;
  box-shadow: none !important; cursor: pointer;
}
html[data-edr-on] .ps_box-grid-list li.ps_grid-row:hover { border-color: var(--edr-navy) !important; background: var(--edr-surface-2) !important; }
html[data-edr-on] .ps_box-grid-list li.ps_grid-row .ps-link,
html[data-edr-on] .ps_box-grid-list li.ps_grid-row .ps-link .ps-text { font-size: 15px !important; font-weight: 600 !important; color: var(--edr-ink) !important; text-decoration: none !important; }
html[data-edr-on] .ps_box-grid-list li.ps_grid-row .ps_box-value { font-size: 13px !important; color: var(--edr-muted) !important; }
html[data-edr-on] .ps_box-grid-list li.ps_grid-row [id*="divINST"] { display: none !important; }

/* Notes and long text blocks: read as body copy, not bold banners. */
html[data-edr-on] #PT_MAIN .psc_label-none > .ps_box-value,
html[data-edr-on] #PT_MAIN .ps_box-longedit > .ps_box-value {
  font-weight: 400 !important; text-align: left !important; color: var(--edr-ink-2) !important; font-size: 14px !important; line-height: 1.5;
}

/* Label/value fields outside grids. */
html[data-edr-on] .ps_apps_content .ps_box-edit > .ps_box-label,
html[data-edr-on] .ps_apps_content .ps_box-label .ps-label { font-size: 13px !important; color: var(--edr-muted) !important; font-weight: 500 !important; }
html[data-edr-on] .ps_apps_content .ps_box-edit > .ps_box-value { font-size: 15px !important; color: var(--edr-ink) !important; }
/* Instruction walls read at a comfortable measure. */
html[data-edr-on] #PT_MAIN :is(.psc_label-none, .ps_box-longedit) > .ps_box-value { max-width: 72ch; }

/* ---------- Form controls (Fluid and classic) ----------
   Matched by element, not PeopleSoft class, so every page's fields get the same
   treatment. Only paint changes: EduRec's scripts still own layout and behaviour. */
html[data-edr-on] body :is(input:is([type="text"], [type="search"], [type="number"], [type="email"], [type="tel"], [type="password"], [type="date"], :not([type])), select, textarea):not(.edr-root *) {
  min-height: 40px; box-sizing: border-box; padding: 0 12px !important;
  background-color: var(--edr-surface) !important; color: var(--edr-ink) !important;
  border: 1px solid var(--edr-line-strong) !important; border-radius: var(--edr-radius-sm) !important; box-shadow: none !important;
  font: 400 14px/1.4 var(--edr-font) !important; caret-color: var(--edr-blue);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
html[data-edr-on] body textarea:not(.edr-root *) { padding: 10px 12px !important; line-height: 1.5 !important; }
/* Selects lose the OS chevron for one drawn from the theme's muted ink. */
html[data-edr-on] body select:not([multiple]):not(.edr-root *) {
  appearance: none; -webkit-appearance: none; padding-right: 36px !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--edr-muted) 50%), linear-gradient(135deg, var(--edr-muted) 50%, transparent 50%) !important;
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52% !important; background-size: 5px 5px !important; background-repeat: no-repeat !important;
}
html[data-edr-on] body :is(input, select, textarea):not(.edr-root *)::placeholder { color: var(--edr-muted); opacity: 1; }
html[data-edr-on] body :is(input, select, textarea):not(.edr-root *, :disabled, [readonly]):hover { border-color: var(--edr-ink-2) !important; }
html[data-edr-on] body :is(input, select, textarea):not(.edr-root *, [type="checkbox"], [type="radio"]):focus {
  outline: none !important; border-color: var(--edr-blue) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--edr-blue) 24%, transparent) !important;
}
html[data-edr-on] body :is(input, select, textarea):not(.edr-root *):is(:disabled, [readonly]) {
  background-color: var(--edr-surface-2) !important; color: var(--edr-ink-2) !important; border-color: var(--edr-line) !important;
}
html[data-edr-on] body :is(input, select, textarea):not(.edr-root *):disabled { cursor: not-allowed; }
html[data-edr-on] body :is(input, select, textarea):not(.edr-root *)[aria-invalid="true"] { border-color: var(--edr-warn) !important; }
html[data-edr-on] body input:is([type="checkbox"], [type="radio"]):not(.edr-root *) { width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: -4px; cursor: pointer; }
html[data-edr-on] body :is(input[type="checkbox"], input[type="radio"]):not(.edr-root *) + :is(label, .ps-label) { margin-right: 18px; color: var(--edr-ink) !important; font-size: 14px !important; cursor: pointer; }
html[data-edr-on] .ps_apps_content :is(.ps_box-edit, .ps_box-dropdown, .ps_box-longedit, .ps_box-date) > .ps_box-label { margin-bottom: 6px; }
/* A field in a fixed-width column (Term From/To) fits its column instead of running into the next one. */
html[data-edr-on] #PT_MAIN .psc_float-left:has(> :is(.ps_box-dropdown, .ps_box-date)) { width: auto !important; max-width: 100%; margin-right: 24px; }
/* A quarter-width column of instructions (MyInfo) is too narrow beside the sidebars: it takes the full line. */
html[data-edr-on] #PT_MAIN .psc_float-left.psc_width-25pct:has(> .ps_box-htmlarea) { float: none; width: auto !important; max-width: 72ch; }
/* A card placed in one of EduRec's flex rows (DCR's carousel) takes its own line instead of a narrow column. */
html[data-edr-on] .psc_carousel:has(> .edr-root) { flex-wrap: wrap; }
html[data-edr-on] .psc_carousel > .edr-root { flex: 0 0 100%; }
html[data-edr-on] .ps_apps_content :is(.ps_box-edit, .ps_box-dropdown, .ps_box-longedit, .ps_box-date, .ps_box-radio, .ps_box-checkbox) { margin-bottom: 16px; }

/* Buttons in page content and dialogs: one size, one weight, real states. */
html[data-edr-on] :is(#PT_MAIN, .ps_modal_container, .PSMODALTABLE) :is(.ps-button, input[type="button"], input[type="submit"]),
html[data-edr-on] .PSPUSHBUTTON {
  display: inline-flex !important; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px !important;
  font: 600 14px/1 var(--edr-font) !important; text-decoration: none !important; cursor: pointer;
  border-radius: var(--edr-radius-sm) !important; border: 1px solid var(--edr-line-strong) !important;
  background: var(--edr-surface) !important; color: var(--edr-ink) !important; box-shadow: none !important;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
}
html[data-edr-on] :is(#PT_MAIN, .ps_modal_container, .PSMODALTABLE) :is(.ps-button, input[type="button"], input[type="submit"]):hover,
html[data-edr-on] .PSPUSHBUTTON:hover { background: var(--edr-surface-2) !important; border-color: var(--edr-ink-2) !important; }
html[data-edr-on] :is(#PT_MAIN, .ps_modal_container, .PSMODALTABLE) :is(.ps-button.psc_primary, .psc_primary .ps-button) {
  background: var(--edr-navy) !important; border-color: var(--edr-navy) !important; color: var(--edr-on-primary) !important;
}
html[data-edr-on] :is(#PT_MAIN, .ps_modal_container, .PSMODALTABLE) :is(.ps-button.psc_primary, .psc_primary .ps-button):hover { background: var(--edr-navy-ink) !important; border-color: var(--edr-navy-ink) !important; }
html[data-edr-on] :is(#PT_MAIN, .ps_modal_container, .PSMODALTABLE) :is(.ps-button, input[type="button"], input[type="submit"]):active,
html[data-edr-on] .PSPUSHBUTTON:active { transform: scale(.98); }
html[data-edr-on] :is(.ps-button, input[type="button"], input[type="submit"], .PSPUSHBUTTON):is(:disabled, .psc_disabled, [aria-disabled="true"]) { opacity: .5; cursor: not-allowed; transform: none; }
html[data-edr-on] .ps_apps_content .ps_box-button { display: inline-flex; margin: 0 8px 8px 0; }

/* Dialogs: a raised surface over a dimmed page. The dark-theme reset clears EduRec's
   fills, so the panel and its mask must set their own. */
html[data-edr-on] :is(#pt_modalMask, .ps_masking) { background: rgb(var(--edr-shadow-rgb)) !important; opacity: .45 !important; }
html[data-edr-on] :is(.ps_modal_container, .PSMODALTABLE) {
  background: var(--edr-surface) !important; color: var(--edr-ink) !important;
  border: 1px solid var(--edr-line) !important; border-radius: var(--edr-radius) !important;
  box-shadow: 0 24px 70px rgb(var(--edr-shadow-rgb) / .35) !important;
}
html[data-edr-on] :is(.ps_modal_header, .PSMODALTITLE) {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px !important;
  background: transparent !important; background-image: none !important; border: 0 !important;
}
html[data-edr-on] :is(.ps_modal_title, .PSMODALTITLE), html[data-edr-on] :is(.ps_modal_title, .PSMODALTITLE) * {
  font: 700 17px/1.3 var(--edr-font) !important; color: var(--edr-ink) !important;
}
html[data-edr-on] .ps_modal_close { color: var(--edr-muted) !important; text-decoration: none !important; font-size: 20px; line-height: 1; }
html[data-edr-on] .ps_modal_close:hover { color: var(--edr-ink) !important; }
html[data-edr-on] :is(.ps_modal_content, .PSMODALCONTENT) { padding: 0 20px 20px !important; background: transparent !important; color: var(--edr-ink-2) !important; }
html[data-edr-on] #alertmsg, html[data-edr-on] #alertmsg * { font: 400 15px/1.55 var(--edr-font) !important; color: var(--edr-ink) !important; }
html[data-edr-on] :is(.ps_modal_content, .PSMODALCONTENT) #alertmsg { margin-bottom: 16px; }
/* A message on the page itself (not eligible, closed, errors) gets a quiet panel. */
html[data-edr-on] #PT_MAIN #alertmsg {
  max-width: 72ch; margin: 8px 0 16px; padding: 14px 16px;
  background: var(--edr-surface-2) !important; border: 1px solid var(--edr-line) !important; border-radius: var(--edr-radius-sm) !important;
}

/* ---------- Classic pages (legacy iframes: audit report, Global education) ---------- */
html[data-edr-on] .PAPAGETITLE { font: 700 22px/1.3 var(--edr-font) !important; color: var(--edr-ink) !important; letter-spacing: -0.01em; margin-bottom: 12px; }
html[data-edr-on] :is(.PSEDITBOXLABEL, .PSDROPDOWNLABEL, .PSCHECKBOXLABEL, .PSRADIOBUTTONLABEL) { font-size: 13px !important; font-weight: 500 !important; color: var(--edr-muted) !important; }
html[data-edr-on] :is(.PSEDITBOX_DISPONLY, .PSTEXT, .PSLONGEDITBOX, .PSDROPDOWNLIST_DISPONLY) { font-size: 14px !important; color: var(--edr-ink) !important; }
html[data-edr-on] :is(.PSHYPERLINK, .PSHYPERLINK a) { color: var(--edr-blue) !important; }
html[data-edr-on] :is(.PSLEVEL1GRIDNAVIGATIONBAR, .PSLEVEL2GRIDNAVIGATIONBAR, .PSLEVEL3GRIDNAVIGATIONBAR) {
  padding: 10px 12px !important; background: var(--edr-surface) !important; background-image: none !important;
  border: 0 !important; border-bottom: 1px solid var(--edr-line) !important;
  font-size: 13px !important; font-weight: 600 !important; color: var(--edr-ink) !important; font-variant-numeric: tabular-nums;
}
html[data-edr-on] :is(th, td):is(.PSLEVEL1GRIDCOLUMNHDR, .PSLEVEL2GRIDCOLUMNHDR, .PSLEVEL1SSGRIDCOLUMNHDR) { padding: 8px 12px !important; text-align: left !important; font-size: 13px !important; }
/* The heading link inside the cell carries the same class; as a wrapped inline box its padding and background covered the line above. */
html[data-edr-on] :is(.PSLEVEL1GRIDCOLUMNHDR, .PSLEVEL2GRIDCOLUMNHDR, .PSLEVEL1SSGRIDCOLUMNHDR) :is(.PSLEVEL1GRIDCOLUMNHDR, .PSLEVEL2GRIDCOLUMNHDR, .PSLEVEL1SSGRIDCOLUMNHDR) { padding: 0 !important; background: none !important; line-height: 1.35 !important; }
html[data-edr-on] :is(.PSLEVEL1GRIDODDROW, .PSLEVEL1GRIDEVENROW, .PSLEVEL2GRIDODDROW, .PSLEVEL2GRIDEVENROW) {
  padding: 9px 12px !important; font-size: 14px !important; border-bottom: 1px solid var(--edr-line-2) !important;
}
html[data-edr-on] tr:last-child > :is(.PSLEVEL1GRIDODDROW, .PSLEVEL1GRIDEVENROW, .PSLEVEL2GRIDODDROW, .PSLEVEL2GRIDEVENROW) { border-bottom: 0 !important; }
html[data-edr-on] :is(.PSLEVEL1GRIDWBO, .PSLEVEL1GRID, .PSGROUPBOXWBO) { border: 1px solid var(--edr-line) !important; border-radius: var(--edr-radius) !important; border-collapse: separate !important; border-spacing: 0; overflow: hidden; }

html[data-edr-on] a { text-underline-offset: 2px; }

/* ---------- Layout on EduRec pages (classes from src/layout.js) ---------- */
/* Filters (All Terms, Term From/To, GO) sit on one row, the button level with the fields. */
html[data-edr-on] .ps_apps_content .edr-filterbar { display: flex !important; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 4px 0 24px !important; }
html[data-edr-on] .ps_apps_content .edr-filterbar > * { margin: 0 !important; }
html[data-edr-on] .ps_apps_content .edr-filterbar > :is(.ps_box-checkbox, .ps_box-radio) { display: flex; align-items: center; min-height: 40px; }
/* Long instructions show their opening lines; the rest is one click away. */
html[data-edr-on] .edr-fold:not(.is-open) {
  max-height: 7.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent);
}
html[data-edr-on] .edr-fold > p:first-child { margin-top: 0; }
.edr-root.edr-fold-toggle {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin: 2px 0 16px; padding: 0;
  border: 0; background: none; color: var(--edr-blue); font: 600 14px var(--edr-font); cursor: pointer;
}
.edr-root.edr-fold-toggle:hover { color: var(--edr-selected-ink); text-decoration: underline; text-underline-offset: 2px; }
.edr-fold-toggle svg { transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.edr-fold-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
@media print {
  html[data-edr-on] .edr-fold:not(.is-open) { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .edr-fold-toggle { display: none !important; }
}
/* Wide classic grids (Global education's 13 columns) scroll inside their border
   instead of widening the page. The rows keep table layout inside tbody. */
html[data-edr-on] table.PSLEVEL1GRIDWBO { display: block; max-width: 100%; overflow-x: auto; }
html[data-edr-on] table.PSLEVEL1GRIDWBO > tbody { display: table; width: 100%; border-collapse: separate; border-spacing: 0; }

/* Shift EduRec right of the sidebar on wide screens. The sidebar lives on <html>,
   outside <body>; the transform makes <body> the containing block for EduRec's own
   fixed/absolute headers and panels, so they move over with it instead of hiding
   under the sidebar. */
@media (min-width: 900px) {
  html[data-edr-on][data-edr-top] body {
    margin-left: var(--edr-nav-w) !important;
    width: calc(100% - var(--edr-nav-w)) !important;
    max-width: calc(100vw - var(--edr-nav-w)) !important;
    min-height: 100vh;
    position: relative !important;
    transform: translateZ(0);
    box-sizing: border-box;
  }
}

/* Until the sidebar mounts (document_idle), paint its silhouette so the page
   doesn't jump sideways or flash stock EduRec on every navigation. The real
   sidebar sits on top of this at a higher z-index. */
@media (min-width: 900px) {
  html[data-edr-on][data-edr-top]::before {
    content: ""; position: fixed; top: 0; left: 0; bottom: 0; z-index: 2147482999; width: var(--edr-nav-w); box-sizing: border-box;
    background: linear-gradient(var(--edr-brand-bg) 0 68px, var(--edr-surface) 68px); border-right: 1px solid var(--edr-line);
    pointer-events: none;
  }
  html[data-edr-on][data-edr-top][data-edr-collapsed]::before { background: linear-gradient(var(--edr-brand-bg) 0 108px, var(--edr-surface) 108px); }
}

/* Same-origin page changes crossfade instead of cutting to white. */
@view-transition { navigation: auto; }
html[data-edr-on]:not(.edr-painting)::view-transition-old(root),
html[data-edr-on]:not(.edr-painting)::view-transition-new(root) { animation-duration: 160ms; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* Homepage: hide everything EduRec renders; the Overview replaces it. */
html[data-edr-home] body > *:not(.edr-root) { display: none !important; }
html[data-edr-home] body { overflow: auto !important; height: auto !important; }

/* ---------- Extension components ---------- */

.edr-root, .edr-root * { box-sizing: border-box; }
.edr-root {
  font-family: var(--edr-font, system-ui, sans-serif);
  color: var(--edr-ink, #16202E);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.edr-root a { color: var(--edr-blue); text-decoration: none; }
.edr-root a:hover { color: var(--edr-selected-ink); text-decoration: underline; }
/* Links styled as buttons keep the button's colours, not the link blue. */
.edr-root a.edr-btn, .edr-root a.edr-btn:hover { color: var(--edr-on-primary); text-decoration: none; }
.edr-root a.edr-btn.is-ghost, .edr-root a.edr-btn.is-ghost:hover { color: var(--edr-ink-2); }
/* EduRec's stylesheet draws dotted outlines on hover/focus; only keep a real
   keyboard focus ring on the reskin's own elements. */
.edr-root, .edr-root *, .edr-root *:hover, .edr-root *:focus:not(:focus-visible) { outline: none !important; }
.edr-root a:focus-visible, .edr-root button:focus-visible, .edr-root input:focus-visible {
  outline: 2px solid var(--edr-blue) !important; outline-offset: 2px;
}

/* Sidebar: full (248px) or a 64px icon rail. */
html[data-edr-collapsed] { --edr-nav-w: 64px; }
.edr-shell {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 2147483000;
  width: var(--edr-nav-w); background: var(--edr-surface);
  border-right: 1px solid var(--edr-line); display: flex; flex-direction: column;
  /* Intentional: one fixed column, so animating its width is cheap. EduRec's page
     itself never animates layout; it slides via transform (see toggleNav). */
  transition: width 240ms var(--ease-out);
}
.edr-brand {
  display: flex; align-items: center; gap: 8px; min-height: 68px; padding: 0 10px 0 14px;
  background: var(--edr-brand-bg); color: var(--edr-brand-ink);
}
.edr-brand-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: var(--edr-brand-ink) !important; text-decoration: none !important; }
.edr-brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgb(0 0 0 / .22); color: var(--edr-brand-ink);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.edr-brand-mark svg rect:nth-child(2) { transform-origin: 8px 32px; transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1); }
/* The mark's own sidebar folds with the real one. */
html[data-edr-collapsed] .edr-brand-mark svg rect:nth-child(2) { transform: scaleX(.6); }
.edr-brand-link:hover .edr-brand-mark { transform: translateY(-1px); }
.edr-brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; white-space: nowrap; }
.edr-brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.edr-icon-btn {
  width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--edr-radius-sm); background: transparent; color: var(--edr-brand-sub); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.edr-icon-btn:hover { background: var(--edr-brand-hover); color: var(--edr-brand-ink); }
.edr-icon-btn:active { background: var(--edr-brand-hover); }
.edr-root .edr-icon-btn:focus-visible { outline-color: var(--edr-brand-ink); }
.edr-shell-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 14px 12px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--edr-line-strong) transparent; }
.edr-search-btn {
  display: flex; align-items: center; gap: 10px; min-height: 44px; width: 100%; padding: 0 12px;
  border: 1px solid var(--edr-line); border-radius: var(--edr-radius-sm); background: var(--edr-surface-2); color: var(--edr-muted);
  font: inherit; font-size: 14px; cursor: pointer; text-align: left; white-space: nowrap;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.edr-search-btn:hover { border-color: var(--edr-line-strong); background: var(--edr-surface); }
.edr-search-btn .edr-search-label { flex: 1; }
.edr-root kbd {
  font-family: var(--edr-mono); font-size: 11px; line-height: 1; padding: 3px 5px; color: var(--edr-ink-2);
  border: 1px solid var(--edr-line); border-bottom-width: 2px; border-radius: 4px; background: var(--edr-surface);
}
.edr-nav { display: flex; flex-direction: column; gap: 2px; }
.edr-nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
  border-radius: var(--edr-radius-sm); color: var(--edr-ink-2) !important; font-size: 14px; font-weight: 500; white-space: nowrap;
  text-decoration: none !important; transition: background-color 150ms ease, color 150ms ease;
}
.edr-nav-item svg { flex: none; }
.edr-nav-item:hover { background: var(--edr-surface-2); }
.edr-nav-item:active { background: var(--edr-surface-3); }
.edr-nav-item svg, .edr-link-btn svg { transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), color 150ms ease; }
.edr-nav-item:active svg, .edr-link-btn:active svg { transform: scale(.88); }

/* Gliding highlight (EDR.glide): one surface travels between items instead of
   each item lighting up on its own. Items keep their own active/selected tint. */
.edr-has-glide { position: relative !important; isolation: isolate; }
.edr-glide {
  position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; box-sizing: border-box;
  /* A neutral ink wash, so hovering never reads as the selected (tinted) item. */
  border-radius: var(--edr-radius-sm); background: color-mix(in srgb, var(--edr-ink) 6%, transparent);
  opacity: 0; transition: opacity 180ms ease;
}
.edr-glide.is-on { opacity: 1; }
.edr-glide.is-tint { background: var(--edr-tint); }
.edr-has-glide > .edr-nav-item:not(.is-active):hover,
.edr-has-glide > .edr-link-btn:hover,
.edr-has-glide .edr-pal-item.is-active { background: transparent; }
.edr-has-glide > .edr-nav-item:hover { color: var(--edr-ink) !important; }
.edr-has-glide > .edr-link-btn:hover svg { color: var(--edr-ink); }
html[data-edr-on] ul.psa_list-linkmenu.edr-has-glide > li:not(.psc_selected):hover { background: transparent !important; }
html[data-edr-on] ul.psa_list-linkmenu.edr-has-glide > li:not(.psc_selected):hover .ps-link { color: var(--edr-ink) !important; }
html[data-edr-theme="terminal"] .edr-glide { border-radius: 0; }

/* Theme changes cross-fade (EDR.paintTheme). */
html.edr-painting::view-transition-old(root),
html.edr-painting::view-transition-new(root) { animation-duration: 320ms; animation-timing-function: ease; }
.edr-nav-item.is-active { background: var(--edr-tint); color: var(--edr-selected-ink) !important; font-weight: 600; }
.edr-shell-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--edr-line); }
.edr-link-btn {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border: 0; background: none;
  font: inherit; font-size: 14px; color: var(--edr-ink-2) !important; cursor: pointer; text-align: left; white-space: nowrap;
  text-decoration: none !important; border-radius: var(--edr-radius-sm); transition: background-color 150ms ease, color 150ms ease;
}
.edr-link-btn svg { flex: none; color: var(--edr-muted); }
.edr-link-btn:hover { background: var(--edr-surface-2); }
.edr-fineprint { margin: 6px 12px 0; font-size: 12px; color: var(--edr-muted); }
.edr-label { transition: opacity 160ms ease; }

/* Collapsed rail: icons only, labels fade, tooltips on hover and keyboard focus. */
html[data-edr-collapsed] .edr-shell .edr-label,
html[data-edr-collapsed] .edr-brand-text { opacity: 0; pointer-events: none; }
html[data-edr-collapsed] .edr-shell .edr-fineprint { display: none; }
html[data-edr-collapsed] .edr-brand { flex-direction: column; justify-content: center; gap: 6px; padding: 12px 0; min-height: 108px; }
html[data-edr-collapsed] .edr-brand-link { flex: none; }
html[data-edr-collapsed] .edr-brand-text { position: absolute; }
html[data-edr-collapsed] .edr-shell-body { padding: 14px 10px; }
html[data-edr-collapsed] .edr-search-btn { justify-content: center; padding: 0; }
html[data-edr-collapsed] .edr-search-btn kbd { display: none; }
html[data-edr-collapsed] .edr-nav-item,
html[data-edr-collapsed] .edr-link-btn { justify-content: center; padding: 0; }
html[data-edr-collapsed] .edr-nav-item .edr-label,
html[data-edr-collapsed] .edr-link-btn .edr-label,
html[data-edr-collapsed] .edr-search-btn .edr-label { position: absolute; width: 1px; overflow: hidden; }
html[data-edr-collapsed] .edr-shell [data-tip]:hover::after,
html[data-edr-collapsed] .edr-shell [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  padding: 6px 10px; border-radius: var(--edr-radius-sm); background: var(--edr-inverse-bg); color: var(--edr-inverse-ink); font-size: 13px; font-weight: 500;
  white-space: nowrap; pointer-events: none; z-index: 2; box-shadow: 0 4px 14px rgb(var(--edr-shadow-rgb) / .18);
  animation: edr-tip 140ms ease-out both;
}
html[data-edr-collapsed] .edr-shell-body { overflow: visible; }
@keyframes edr-tip { from { opacity: 0; transform: translate(-4px, -50%); } }

.edr-menu-toggle { display: none; }
@media (max-width: 899px) {
  .edr-shell { width: 248px !important; transform: translateX(-100%); transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 10px 40px rgb(var(--edr-shadow-rgb) / .2); }
  html[data-edr-nav-open] .edr-shell { transform: none; }
  .edr-collapse-btn { display: none; }
  html[data-edr-collapsed] .edr-shell .edr-label,
  html[data-edr-collapsed] .edr-brand-text { opacity: 1; position: static; width: auto; }
  .edr-menu-toggle {
    display: flex; align-items: center; justify-content: center; position: fixed; z-index: 2147483001;
    left: 12px; bottom: 16px; width: 48px; height: 48px; border-radius: 24px; border: 0;
    background: var(--edr-navy); color: var(--edr-on-primary); cursor: pointer; box-shadow: 0 4px 14px rgb(var(--edr-shadow-rgb) / .25);
  }
}

.edr-restore {
  position: fixed; z-index: 2147483000; right: 16px; bottom: 16px; min-height: 40px; padding: 0 14px;
  border: 0; border-radius: var(--edr-radius-sm); background: #123A6B; color: #FFFFFF; font: 600 14px system-ui, sans-serif; cursor: pointer;
}

/* EduRec page-list toggle, placed in EduRec's header next to Back. */
.edr-side-toggle {
  display: inline-flex; align-items: center; align-self: center; gap: 8px; height: 36px; margin: 0 0 0 8px; padding: 0 14px 0 11px; box-sizing: border-box; line-height: 1;
  border: 1px solid var(--edr-line, var(--edr-line)); border-radius: var(--edr-radius-sm); background: var(--edr-surface); color: var(--edr-navy, var(--edr-navy));
  font: 600 14px var(--edr-font, system-ui, sans-serif); cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.edr-side-toggle:hover { background: var(--edr-surface-2); border-color: var(--edr-line-strong); }
.edr-side-toggle[aria-pressed="false"] { background: var(--edr-tint, var(--edr-tint)); border-color: transparent; }
html[data-edr-side-collapsed] #PT_SIDE { display: none !important; }
html[data-edr-side-collapsed] #PT_CONTENT { margin-left: 0 !important; left: 0 !important; width: 100% !important; }
#PT_CONTENT.edr-settle { animation: edr-settle 280ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes edr-settle { from { opacity: .55; transform: translateX(-10px); } }

/* Search palette */
.edr-pal-overlay {
  position: fixed; inset: 0; z-index: 2147483600; background: rgb(var(--edr-shadow-rgb) / .45);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  animation: edr-fade 160ms ease-out both;
}
.edr-pal {
  width: 100%; max-width: 640px; background: var(--edr-surface); border-radius: 10px; overflow: hidden;
  box-shadow: 0 24px 70px rgb(var(--edr-shadow-rgb) / .35);
  animation: edr-rise 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes edr-fade { from { opacity: 0; } }
@keyframes edr-rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.edr-pal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--edr-line-2); color: var(--edr-ink); }
.edr-pal-input { flex: 1; border: 0; outline: none; font: inherit; font-size: 18px; color: var(--edr-ink); background: transparent; min-height: 32px; caret-color: var(--edr-blue); }
/* EduRec styles every input (white fill, focus ring); the palette's sits on the dialog. */
html[data-edr-on] .edr-root .edr-pal-input, html[data-edr-on] .edr-root .edr-pal-input:is(:focus, :hover) {
  background: transparent !important; color: var(--edr-ink) !important; border: 0 !important; box-shadow: none !important;
  outline: none !important; padding: 0 !important; height: auto !important; font: inherit !important; font-size: 18px !important;
}
.edr-pal-input::-webkit-search-cancel-button { display: none; }
.edr-pal-input::placeholder { color: var(--edr-muted); opacity: 1; }
.edr-pal-list { list-style: none; margin: 0; padding: 8px; max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.edr-pal-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px;
  border-radius: var(--edr-radius-sm); color: var(--edr-ink) !important; text-decoration: none !important;
  transition: background-color 90ms ease;
}
.edr-pal-item.is-active { background: var(--edr-tint); }
.edr-pal-item.is-active :is(.edr-pal-label, .edr-pal-hint) { color: var(--edr-selected-ink); }
.edr-pal-label { font-weight: 600; font-size: 15px; }
.edr-pal-hint { font-size: 13px; color: var(--edr-muted); }
.edr-pal-empty { padding: 28px 24px; text-align: center; color: var(--edr-muted); font-size: 14px; }
.edr-pal-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 18px; border-top: 1px solid var(--edr-line-2); font-size: 12px; color: var(--edr-muted); }
.edr-pal-foot kbd { margin-right: 3px; }

/* Overview page */
.edr-page { max-width: 1120px; margin: 0 auto; padding: 36px 40px 64px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 899px) { .edr-page { padding: 24px 16px 96px; } }
.edr-page-head { display: flex; flex-direction: column; gap: 6px; }
.edr-h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--edr-ink); }
.edr-h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--edr-ink); }
.edr-h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--edr-ink); }
.edr-muted { margin: 0; color: var(--edr-muted); font-size: 14px; }
.edr-small { font-size: 12px; }
.edr-mono { font-family: var(--edr-mono); font-weight: 500; }
/* Summary cards: three equal columns on wide screens so they line up; one column on narrow. */
.edr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (min-width: 980px) { .edr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* The one card surface. Anything inside a card is a section of it (spacing and
   hairlines), never a second bordered or filled box. */
.edr-card, .edr-setup {
  background: var(--edr-surface); border: 1px solid var(--edr-line); border-radius: var(--edr-radius);
  padding: 20px 22px;
}
.edr-card { display: flex; flex-direction: column; gap: 10px; }
.edr-card-head { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.edr-card-link { font-size: 14px; font-weight: 600; }
.edr-big { margin: 4px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-height: 48px; font-size: 36px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.edr-big-unit { font-size: 14px; font-weight: 500; color: var(--edr-muted); }
.edr-updated { margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--edr-line-2); font-size: 12px; color: var(--edr-muted); }
/* Empty cards: copy at the top, action pinned to the bottom, so cards with
   longer copy keep their buttons on the same line as their neighbours. */
.edr-empty { flex: 1; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.edr-empty p { margin: 0; font-size: 14px; color: var(--edr-ink-2); }
.edr-empty > .edr-btn { margin-top: auto; align-self: flex-start; }
.edr-bar { height: 8px; border-radius: 4px; background: var(--edr-line-2); overflow: hidden; }
.edr-bar > span { display: block; height: 100%; background: var(--edr-blue); }
.edr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.edr-list > li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--edr-line-2); font-size: 14px; flex-wrap: wrap; }
.edr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.edr-chip { padding: 5px 9px; border-radius: 4px; background: var(--edr-surface-3); font-size: 13px; }
.edr-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.edr-tag.is-warn { background: var(--edr-warn-bg); color: var(--edr-warn); }
.edr-tag.is-ok { background: var(--edr-tint); color: var(--edr-blue-ink); }

/* Summaries on EduRec pages land inside EduRec's own box, which the restyle
   already draws as a card. There the summary is that card's opening section:
   same inset as EduRec's grid header and cells, a hairline above EduRec's rows. */
.edr-inline {
  margin: 0; padding: 18px var(--edr-inset) 20px; display: flex; flex-direction: column; gap: 12px;
  border-bottom: 1px solid var(--edr-line);
}
/* No EduRec box around it: the summary is the only surface, so it draws one. */
.edr-inline:not(:is(.ps_box-grid-flex, .PSGROUPBOXWBO, .PSLEVEL1GRIDWBO, .PSLEVEL1GRID) *) {
  margin: 0 0 20px; background: var(--edr-surface); border: 1px solid var(--edr-line); border-radius: var(--edr-radius);
}
.edr-inline-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.edr-badge { font-size: 12px; font-weight: 600; color: var(--edr-selected-ink); background: var(--edr-tint); padding: 2px 8px; border-radius: 4px; }
.edr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.edr-stats { display: flex; flex-wrap: wrap; gap: 28px; }
.edr-stat { display: flex; flex-direction: column; gap: 2px; }
.edr-stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.edr-stat-label { font-size: 13px; color: var(--edr-muted); }
.edr-reqs { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.edr-req { display: flex; flex-direction: column; gap: 6px; }
.edr-req-label { font-size: 14px; font-weight: 600; }

/* ---------- Overview extras ---------- */
.edr-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.edr-setup {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  animation: edr-fade 200ms ease-out both;
}
.edr-setup-copy { display: flex; flex-direction: column; gap: 6px; flex: 1 1 360px; }
.edr-setup-copy .edr-muted { max-width: 62ch; }
.edr-setup-actions { display: flex; align-items: center; gap: 8px; }

.edr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--edr-navy); border-radius: var(--edr-radius-sm); background: var(--edr-navy); color: var(--edr-on-primary);
  font: 600 14px var(--edr-font); cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
}
.edr-btn:hover { background: var(--edr-navy-ink); border-color: var(--edr-navy-ink); }
.edr-btn:active { transform: scale(.98); }
.edr-btn.is-small { min-height: 36px; padding: 0 14px; }
.edr-btn.is-ghost { background: transparent; border-color: var(--edr-line); color: var(--edr-ink-2); }
.edr-btn.is-ghost:hover { background: var(--edr-surface-2); border-color: var(--edr-line-strong); }
.edr-icon-btn.is-dark { color: var(--edr-muted); }
.edr-icon-btn.is-dark:hover { background: var(--edr-surface-3); color: var(--edr-ink); }

/* Setup wizard progress, shown on every page while it runs. */

.edr-toast {
  position: fixed; z-index: 2147483500; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 18px;
  border-radius: var(--edr-radius); background: var(--edr-navy, var(--edr-navy)); color: var(--edr-on-primary); font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px rgb(var(--edr-shadow-rgb) / .3); animation: edr-rise 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 300ms ease, transform 300ms ease;
}
.edr-toast.is-leaving { opacity: 0; transform: translate(-50%, 6px); }

@keyframes edr-pop { from { transform: scale(.4); opacity: 0; } }

.edr-done-line { margin: 0; font-size: 14px; font-weight: 600; color: var(--edr-blue-ink); }
.edr-list-label { flex: 1 1 180px; min-width: 0; }
.edr-list > li .edr-tag { align-self: center; }
.edr-card-link { display: inline-flex; align-items: center; min-height: 32px; }
.edr-big, .edr-stat-value, .edr-updated, .edr-tag { font-variant-numeric: tabular-nums; }

/* Focal motion: progress fills to its value when a summary first appears. */
.edr-bar > span { transform-origin: left center; }
.edr-page .edr-bar > span,
.edr-inline.is-new .edr-bar > span { animation: edr-fill 900ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 120ms; }
.edr-grid > :nth-child(2) .edr-bar > span { animation-delay: 200ms; }
.edr-reqs > li:nth-child(1) .edr-bar > span { animation-delay: 240ms; }
.edr-reqs > li:nth-child(2) .edr-bar > span { animation-delay: 300ms; }
.edr-reqs > li:nth-child(n+3) .edr-bar > span { animation-delay: 360ms; }
@keyframes edr-fill { from { transform: scaleX(0); } }

/* A summary arriving on an EduRec page unrolls from its top edge. */
.edr-inline.is-new { animation: edr-unroll 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes edr-unroll { from { clip-path: inset(0 0 100% 0); opacity: .4; } to { clip-path: inset(0); } }
.edr-badge { display: inline-flex; align-items: center; gap: 6px; transition: background-color 200ms ease, color 200ms ease; }
.edr-badge.is-saved { background: var(--edr-navy); color: var(--edr-on-primary); animation: edr-pop 320ms cubic-bezier(0.16, 1, 0.3, 1); }

/* ---------- Browser surfaces ---------- */
html[data-edr-on] ::selection { background: var(--edr-selection); color: var(--edr-ink); }
html[data-edr-on] { scrollbar-color: var(--edr-line-strong) transparent; accent-color: var(--edr-navy); }
html[data-edr-on] #PT_WRAPPER a:focus-visible,
html[data-edr-on] #PT_WRAPPER .ps-button:focus-visible,
html[data-edr-on] #PT_WRAPPER li.ps_grid-row:focus-within { outline: 2px solid var(--edr-blue) !important; outline-offset: 2px; }
html[data-edr-on] #PT_WRAPPER input, html[data-edr-on] #PT_WRAPPER textarea { caret-color: var(--edr-blue); }
html[data-edr-on] td.ps_grid-cell { font-variant-numeric: tabular-nums; }

/* Reduced motion: keep state changes (colour, opacity), drop movement. */
@media (prefers-reduced-motion: reduce) {
  .edr-shell { transition: none !important; }
  .edr-brand-mark, .edr-brand-mark svg rect, .edr-nav-item svg, .edr-link-btn svg { transition: none !important; }
  .edr-pal, .edr-coach, .edr-toast, .edr-badge.is-saved, #PT_CONTENT.edr-settle { animation: edr-fade 160ms ease-out both !important; }
  .edr-coach-target { animation: none !important; }
  .edr-page .edr-bar > span, .edr-inline.is-new .edr-bar > span, .edr-inline.is-new { animation: edr-fade 200ms ease-out both !important; }
}

/* ---------- Palette modes, theme swatches, cheat sheet ---------- */
.edr-pal-prefix { font-family: var(--edr-mono); font-size: 20px; font-weight: 600; color: var(--edr-selected-ink); width: 18px; text-align: center; }
.edr-pal-item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.edr-swatch { display: inline-flex; flex: none; border-radius: 999px; overflow: hidden; box-shadow: 0 0 0 1px var(--edr-line); }
.edr-swatch > span { width: 12px; height: 18px; }
.edr-pal-item .edr-pal-label { flex: 1; }
.edr-help-overlay {
  position: fixed; inset: 0; z-index: 2147483600; background: rgb(var(--edr-shadow-rgb) / .45);
  display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; overflow-y: auto;
  animation: edr-fade 160ms ease-out both;
}
.edr-help {
  width: 100%; max-width: 760px; background: var(--edr-surface); color: var(--edr-ink); border-radius: var(--edr-radius);
  box-shadow: 0 24px 70px rgb(var(--edr-shadow-rgb) / .35); padding: 20px 24px 24px;
  animation: edr-rise 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.edr-help-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.edr-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 32px; }
.edr-help-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; align-items: center; }
.edr-help-list dt { display: flex; gap: 4px; justify-content: flex-end; min-width: 64px; }
.edr-help-list dd { margin: 0; font-size: 14px; color: var(--edr-ink-2); }

/* Terminal theme: a prompt and a cursor, nothing louder. */
html[data-edr-theme="terminal"] .edr-h1::before { content: "> "; color: var(--edr-muted); }
html[data-edr-theme="terminal"] .edr-h1::after {
  content: ""; display: inline-block; width: .55em; height: .9em; margin-left: .15em; vertical-align: -0.08em;
  background: var(--edr-selected-ink); animation: edr-blink 1.1s steps(1) infinite;
}
@keyframes edr-blink { 50% { opacity: 0; } }
html[data-edr-theme="terminal"] .edr-root { letter-spacing: 0; }

/* Comic: inked panels with a hard drop shadow. */
html[data-edr-theme="comic"] :is(.edr-card, .edr-setup) { border-width: 2px; box-shadow: 4px 4px 0 var(--edr-ink); }
/* Retro 95: raised bevels. */
html[data-edr-theme="retro95"] :is(.edr-card, .edr-setup) {
  border: 2px solid; border-color: #FFFFFF #404040 #404040 #FFFFFF; box-shadow: inset -1px -1px 0 #808080;
}
/* Broadsheet: a double rule under the page title. */
html[data-edr-theme="broadsheet"] .edr-h1 { border-bottom: 3px double var(--edr-ink); padding-bottom: 6px; }
/* High contrast: heavier card edges and a focus ring that can't be missed. */
html[data-edr-theme="contrast"] :is(.edr-card, .edr-setup) { border-width: 2px; }
html[data-edr-on][data-edr-theme="contrast"] :focus-visible { outline: 3px solid #0000CC !important; outline-offset: 2px !important; }

/* Printing EduRec pages (e.g. the audit's printer-friendly view): no shell. */
@media print {
  .edr-shell, .edr-menu-toggle, .edr-coach, .edr-toast, .edr-pal-overlay, .edr-help-overlay, .edr-side-toggle { display: none !important; }
  html[data-edr-on][data-edr-top] body { margin-left: 0 !important; width: auto !important; max-width: none !important; transform: none !important; }
}

/* Windows high-contrast / forced colours: let the system palette win and keep focus visible. */
@media (forced-colors: active) {
  .edr-root *:focus-visible { outline: 2px solid CanvasText !important; }
  .edr-bar > span, .edr-check-mark { background: Highlight !important; forced-color-adjust: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-edr-theme="terminal"] .edr-h1::after { animation: none; }
}

/* Header row: Back and Pages centred on one line. */
html[data-edr-on] [id$="hdrdivPT_NAV_CONT"] { display: flex !important; align-items: center !important; gap: 0; padding-left: 4px; }

/* ---------- Quick links ---------- */
.edr-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.edr-quick-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 11px; box-sizing: border-box;
  border: 1px solid var(--edr-line); border-radius: 999px; background: var(--edr-surface);
  color: var(--edr-ink-2) !important; font-size: 14px; font-weight: 500; text-decoration: none !important;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.edr-quick-link svg { color: var(--edr-muted); transition: color 150ms ease; }
.edr-quick-link:hover { background: var(--edr-tint); border-color: transparent; color: var(--edr-selected-ink) !important; }
.edr-quick-link:hover svg { color: var(--edr-selected-ink); }
html[data-edr-theme="terminal"] .edr-quick-link { border-radius: 0; }

/* ---------- Up next ---------- */
.edr-slot { display: contents; }
.edr-upnext-what { margin: 0; font-size: 16px; font-weight: 600; color: var(--edr-ink); }

/* ---------- This week (NUSMods-style: days as rows, hours across) ---------- */
.edr-week { gap: 14px; }
.edr-week-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.edr-week-actions { display: flex; gap: 8px; }
.edr-week-actions .edr-btn svg { margin-left: 2px; }
.edr-week-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.edr-week-grid { min-width: 760px; display: flex; flex-direction: column; }
.edr-week-row, .edr-week-hours { display: grid; grid-template-columns: 64px 1fr; align-items: stretch; }
.edr-week-row { min-height: 58px; border-top: 1px solid var(--edr-line-2); }
.edr-week-row.is-today { background: color-mix(in srgb, var(--edr-tint) 55%, transparent); border-radius: var(--edr-radius-sm); }
.edr-week-day { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding-left: 8px; font-size: 13px; color: var(--edr-muted); }
.edr-week-day strong { color: var(--edr-ink); font-weight: 600; }
.edr-week-row.is-today .edr-week-day strong { color: var(--edr-selected-ink); }
.edr-week-track {
  position: relative; min-height: 58px;
  background-image: repeating-linear-gradient(to right, var(--edr-line-2) 0 1px, transparent 1px 100%);
}
.edr-week-hours .edr-week-track { min-height: 22px; background: none; }
.edr-week-hour { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--edr-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.edr-week-block {
  position: absolute; top: 6px; bottom: 6px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 4px 8px; border-radius: var(--edr-radius-sm); overflow: hidden; box-sizing: border-box;
  background: color-mix(in srgb, var(--c) 16%, var(--edr-surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  color: var(--edr-ink); font-size: 12px; line-height: 1.25; white-space: nowrap;
}
.edr-week-block .edr-mono { font-weight: 600; font-size: 12px; }
.edr-week-block span:last-child { color: var(--edr-ink-2); overflow: hidden; text-overflow: ellipsis; }
.edr-week-block.is-past { opacity: .5; }
.edr-week-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--edr-orange); border-radius: 1px; }
.edr-week-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 4px; background: var(--edr-orange); }

/* ---------- Courses this term: one column per course, colour-matched to the grid ---------- */
.edr-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 24px; margin: 6px 0 0; padding: 0; list-style: none; }
.edr-course { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 4px; border-top: 1px solid var(--edr-line-2); }
.edr-course-head { display: flex; flex-direction: column; gap: 2px; }
.edr-course-code { display: inline-flex; align-items: center; gap: 8px; font-family: var(--edr-mono); font-weight: 700; font-size: 14px; color: var(--edr-ink); }
.edr-course-code::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.edr-course-title { font-size: 13px; color: var(--edr-muted); line-height: 1.3; }
.edr-course-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.edr-course-lessons li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; color: var(--edr-ink-2); }
.edr-course-lessons strong { font-weight: 600; color: var(--edr-ink); }
.edr-course-lessons .edr-course-when { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.edr-course-lessons .edr-course-room { grid-column: 1 / -1; font-size: 12px; color: var(--edr-muted); }

/* ---------- Classic PeopleSoft pages (Global education, some reports) ---------- */
html[data-edr-on] :is(.PSLEVEL1GRIDLABEL, .PSLEVEL2GRIDLABEL, .PSGROUPBOXLABEL),
html[data-edr-on] :is(.PSLEVEL1GRIDLABEL, .PSLEVEL2GRIDLABEL, .PSGROUPBOXLABEL) :is(a, span) {
  background: var(--edr-surface-2) !important; background-image: none !important; color: var(--edr-ink) !important;
  border-color: var(--edr-line) !important; font-weight: 600 !important;
}
html[data-edr-on] :is(.PSLEVEL1GRIDCOLUMNHDR, .PSLEVEL2GRIDCOLUMNHDR, .PSLEVEL1SSGRIDCOLUMNHDR),
html[data-edr-on] :is(.PSLEVEL1GRIDCOLUMNHDR, .PSLEVEL2GRIDCOLUMNHDR, .PSLEVEL1SSGRIDCOLUMNHDR) a {
  background: var(--edr-surface-3) !important; background-image: none !important; color: var(--edr-muted) !important;
  border-color: var(--edr-line) !important; font-weight: 600 !important;
}
html[data-edr-on] :is(.PSLEVEL1GRIDODDROW, .PSLEVEL1GRIDEVENROW, .PSLEVEL2GRIDODDROW, .PSLEVEL2GRIDEVENROW) {
  background: var(--edr-surface) !important; color: var(--edr-ink-2) !important; border-color: var(--edr-line-2) !important;
}
html[data-edr-on] :is(.PSLEVEL1GRIDWBO, .PSLEVEL1GRID, .PSGROUPBOXWBO) { border-color: var(--edr-line) !important; background: var(--edr-surface) !important; }
html[data-edr-on] :is(.PSACTIVETAB, .PSTABACTIVE) { background: var(--edr-tint) !important; color: var(--edr-selected-ink) !important; border-color: var(--edr-line) !important; }
html[data-edr-on] :is(.PSINACTIVETAB, .PSTABINACTIVE) { background: var(--edr-surface) !important; color: var(--edr-ink-2) !important; border-color: var(--edr-line) !important; }

/* Re-renders after the first paint don't replay motion; a card whose summary
   just arrived comes into focus instead. */
#edr-overview[data-settled] .edr-bar > span { animation: none; }
#edr-overview[data-settled] .is-arriving { animation: edr-arrive 520ms cubic-bezier(0.16, 1, 0.3, 1) both; }
#edr-overview[data-settled] .is-arriving .edr-bar > span { animation: edr-fill 900ms cubic-bezier(0.16, 1, 0.3, 1) 160ms both; }
@keyframes edr-arrive { from { opacity: 0; transform: translateY(6px); filter: blur(6px); } }
@media (prefers-reduced-motion: reduce) {
  #edr-overview[data-settled] .is-arriving { animation: edr-fade 200ms ease-out both; }
}

/* ---------- Guided setup: Overview checklist ---------- */
.edr-checklist { position: relative; align-items: flex-start; container-type: inline-size; }
.edr-setup-close { position: absolute; top: 10px; right: 10px; }
.edr-checklist .edr-setup-copy { padding-right: 32px; }
.edr-checklist-steps { list-style: none; margin: 0; padding: 0; flex: 1 1 100%; display: grid; grid-template-columns: 1fr; gap: 0 24px; }
/* Three steps: all in a row, or stacked, so none is left alone on a row. */
@container (min-width: 620px) { .edr-checklist-steps { grid-template-columns: repeat(3, 1fr); } }
.edr-checklist-steps li {
  /* Second row holds the button, pinned to the bottom so every step's button lines up. */
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 14px 12px; align-items: start;
  padding: 16px 0 4px; border-top: 1px solid var(--edr-line-2);
}
.edr-check-mark {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--edr-line-strong); color: var(--edr-muted); font-variant-numeric: tabular-nums;
}
.is-next > .edr-check-mark { border-color: var(--edr-navy); color: var(--edr-selected-ink); }
.is-done > .edr-check-mark { background: var(--edr-navy); border-color: var(--edr-navy); color: var(--edr-on-primary); }
.edr-check-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--edr-muted); line-height: 1.35; }
.edr-check-text strong { font-size: 14px; color: var(--edr-ink); font-weight: 600; }
.edr-checklist-steps li > .edr-btn, .edr-check-state { grid-column: 2; grid-row: 2; justify-self: start; }
.edr-check-state { font-size: 13px; font-weight: 600; color: var(--edr-selected-ink); min-height: 36px; display: inline-flex; align-items: center; }

/* ---------- Guided setup: coach card on EduRec pages ---------- */
.edr-coach {
  position: fixed; z-index: 2147483500; right: 20px; bottom: 20px; width: min(340px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px;
  background: var(--edr-surface); color: var(--edr-ink); border: 1px solid var(--edr-line); border-radius: var(--edr-radius);
  box-shadow: 0 14px 40px rgb(var(--edr-shadow-rgb) / .22);
  animation: edr-rise 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 180ms ease, transform 180ms ease;
}
.edr-coach.is-leaving { opacity: 0; transform: translateY(6px); }
.edr-coach-head { display: flex; justify-content: space-between; align-items: center; margin: -4px -6px 0 0; }
.edr-coach-step { font-size: 12px; font-weight: 600; color: var(--edr-muted); }
.edr-coach-title { font-size: 16px; font-weight: 700; }
.edr-coach-text { margin: 0; font-size: 14px; color: var(--edr-ink-2); }
.edr-coach-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.edr-coach-actions:empty { display: none; }
.edr-coach.is-done .edr-coach-title { color: var(--edr-selected-ink); }
/* The thing to click next: an accent border and tint drawn inside its row or
   card, with a small label in its bottom corner (titles run along the top). Nothing sits outside the element,
   because EduRec's list and grid containers clip overflow. EduRec's own
   element, so overrides need !important. */
html[data-edr-on] body .edr-coach-target.edr-coach-target.edr-coach-target {
  position: relative !important;
  border-color: var(--edr-blue) !important;
  box-shadow: inset 0 0 0 1px var(--edr-blue) !important;
  background-color: color-mix(in srgb, var(--edr-blue) 6%, var(--edr-surface)) !important;
  transition: box-shadow 200ms ease, border-color 200ms ease, background-color 200ms ease;
}
html[data-edr-on] body .edr-coach-target.edr-coach-target[data-edr-hint]::after {
  content: attr(data-edr-hint); position: absolute; bottom: 8px; right: 8px; z-index: 2; pointer-events: none;
  padding: 2px 8px; border-radius: 999px; background: var(--edr-blue); color: #fff;
  font: 600 11px/16px var(--edr-font); letter-spacing: .01em; white-space: nowrap;
  animation: edr-pop 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (max-width: 599px) { .edr-coach { right: 16px; left: 16px; width: auto; bottom: 80px; } }

/* ---------- Page views (src/views.js; docs/research/04-page-designs.md) ---------- */
/* EduRec blocks a view replaces stay in place, hidden until "Show EduRec's version".
   data-edr-peek lifts the hiding for the instant the enhancers read the page. */
html[data-edr-on]:not([data-edr-peek]) .edr-orig:not(.is-shown) { display: none !important; }
html[data-edr-on][data-edr-pending] #PT_MAIN { visibility: hidden; }
html[data-edr-on] .edr-orig.is-shown { margin-top: 16px !important; }

/* Answer view: the page's one surface. Head, rows, foot; sections, not boxes. */
.edr-view {
  container-type: inline-size;
  margin: 0 0 20px; background: var(--edr-surface); border: 1px solid var(--edr-line); border-radius: var(--edr-radius);
  display: flex; flex-direction: column;
  /* Classic pages' wide grids widen the whole page; the view stays screen-wide. */
  max-width: calc(100vw - 32px);
}
.edr-view-head { padding: 20px var(--edr-inset) 18px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--edr-line); }
.edr-view-title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--edr-ink); text-wrap: balance; }
.edr-view-lede { margin: 0; max-width: 64ch; font-size: 15px; line-height: 1.5; color: var(--edr-ink-2); }
.edr-view-lede strong { color: var(--edr-ink); font-weight: 700; }
.edr-lede-num { font-size: 28px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.edr-view-foot { padding: 14px var(--edr-inset) 16px; border-top: 1px solid var(--edr-line); display: flex; flex-direction: column; gap: 4px; }
.edr-view-foot p { margin: 0; max-width: 72ch; font-size: 13px; line-height: 1.5; color: var(--edr-muted); }
.edr-orig-toggle, .edr-reveal {
  align-self: flex-start; min-height: 32px; margin-top: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 13px var(--edr-font); color: var(--edr-blue);
}
.edr-orig-toggle:hover, .edr-reveal:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Rows: aligned columns when the view is wide, stacked under 600px of its own width. */
.edr-rows { list-style: none; margin: 0; padding: 0; }
.edr-rows > li { padding: 14px var(--edr-inset); border-top: 1px solid var(--edr-line-2); display: grid; align-items: center; gap: 6px 16px; }
.edr-rows > li:first-child { border-top: 0; }
.edr-code { font-size: 13px; color: var(--edr-ink); }
.edr-exam-course { margin: 0; font-size: 15px; line-height: 1.4; color: var(--edr-ink); }
.edr-exam-course > span:last-child { color: var(--edr-ink-2); }
.edr-exam-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.edr-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.edr-course { grid-template-columns: minmax(0, 1fr) auto 3.5rem; }
.edr-grade {
  justify-self: end; min-width: 2.75rem; height: 28px; padding: 0 8px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--edr-surface-3); color: var(--edr-ink); font: 700 14px var(--edr-mono); font-variant-numeric: tabular-nums;
}
.edr-grade.is-good { background: var(--edr-tint); color: var(--edr-selected-ink); }
.edr-grade.is-bad { background: var(--edr-warn-bg); color: var(--edr-warn); }
.edr-swap { display: inline-flex; align-items: center; gap: 8px; color: var(--edr-muted); }
.edr-swap s { font: 500 14px var(--edr-mono); color: var(--edr-muted); }
.edr-rows > li.edr-course:has(.edr-swap) { grid-template-columns: minmax(0, 1fr) auto; }

/* Exams: date block, course, facts, status. */
.edr-exam { grid-template-columns: 3.5rem minmax(0, 1fr) auto 4.5rem; }
.edr-datebox {
  width: 3.5rem; padding: 6px 0; border-radius: var(--edr-radius-sm); text-align: center;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  background: var(--edr-tint); color: var(--edr-selected-ink);
}
.edr-datebox span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.edr-datebox strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.edr-datebox.is-tba, .edr-exam[data-when="past"] .edr-datebox { background: transparent; color: var(--edr-muted); box-shadow: inset 0 0 0 1px var(--edr-line); }
.edr-datebox.is-tba strong { font-size: 14px; }
.edr-exam[data-when="past"] .edr-exam-course, .edr-exam[data-when="past"] .edr-exam-course > span:last-child { color: var(--edr-muted); }
.edr-facts { margin: 0; display: grid; grid-template-columns: 8.5rem 6.5rem 2.5rem; gap: 2px 16px; }
.edr-facts dt { font-size: 12px; color: var(--edr-muted); }
.edr-facts dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--edr-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.edr-exam .edr-tag { justify-self: end; }
.edr-tag.is-quiet { background: transparent; color: var(--edr-muted); box-shadow: inset 0 0 0 1px var(--edr-line); }

@container (max-width: 599px) {
  .edr-rows > li.edr-exam { grid-template-columns: 3.5rem minmax(0, 1fr); align-items: start; }
  .edr-exam .edr-facts, .edr-exam .edr-tag { grid-column: 2; justify-self: start; }
  .edr-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .edr-course { grid-template-columns: minmax(0, 1fr) auto; }
  .edr-course > .edr-num { grid-row: 2; grid-column: 1; }
  .edr-course > .edr-grade { grid-row: 1 / span 2; grid-column: 2; }
}

/* Academic Records: programme plans, term courses, transfer credit, classes. */
.edr-view-sub { margin: 0; padding: 16px var(--edr-inset) 6px; border-top: 1px solid var(--edr-line); font-size: 14px; font-weight: 700; color: var(--edr-ink); }
.edr-rows > li.edr-course:has(> .edr-tag:last-child):not(:has(> .edr-num)) { grid-template-columns: minmax(0, 1fr) auto; }
.edr-tags { justify-self: end; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.edr-rows > li.edr-enrol, .edr-rows > li.edr-credit { grid-template-columns: minmax(0, 1fr) 4.5rem minmax(3.5rem, auto); }
.edr-enrol.is-out .edr-exam-course, .edr-enrol.is-out .edr-exam-course > span:last-child, .edr-enrol.is-out .edr-num { color: var(--edr-muted); }
.edr-enrol.is-out .edr-code { text-decoration: line-through; text-decoration-color: var(--edr-muted); }
.edr-rows > li.edr-meet { grid-template-columns: 3.5rem minmax(0, 1fr) auto; }
.edr-facts.edr-facts-2 { grid-template-columns: 5.5rem 7rem; }
.edr-meet[data-when="past"] .edr-datebox { background: transparent; color: var(--edr-muted); box-shadow: inset 0 0 0 1px var(--edr-line); }
.edr-meet[data-when="past"] .edr-exam-course, .edr-meet[data-when="past"] .edr-exam-course > span:last-child { color: var(--edr-muted); }
.edr-earlier { border-top: 1px solid var(--edr-line); }
.edr-earlier > summary {
  min-height: 44px; padding: 0 var(--edr-inset); display: flex; align-items: center; cursor: pointer;
  font: 600 13px var(--edr-font); color: var(--edr-blue);
}
.edr-earlier > summary:hover { text-decoration: underline; text-underline-offset: 2px; }
.edr-earlier > .edr-rows > li:first-child { border-top: 1px solid var(--edr-line-2); }
.edr-rows > li.edr-weekly { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.edr-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.edr-slots > li { display: grid; grid-template-columns: 12rem 8rem minmax(0, 1fr); gap: 2px 16px; font-size: 14px; line-height: 1.45; color: var(--edr-ink-2); font-variant-numeric: tabular-nums; }
.edr-slots strong { font-weight: 600; color: var(--edr-ink); white-space: nowrap; }
.edr-slots > li > :only-child { grid-column: 1 / -1; }
.edr-dead > .edr-view-foot { align-self: stretch; margin-top: 12px; padding: 12px 0 0; }

@container (max-width: 599px) {
  .edr-rows > li.edr-enrol, .edr-rows > li.edr-credit { grid-template-columns: minmax(0, 1fr) auto; }
  .edr-enrol > .edr-num, .edr-credit > .edr-num { grid-row: 2; grid-column: 1; }
  .edr-enrol > .edr-tags, .edr-credit > .edr-tags { grid-row: 1 / span 2; grid-column: 2; }
  .edr-rows > li.edr-meet { grid-template-columns: 3.5rem minmax(0, 1fr); align-items: start; }
  .edr-meet .edr-facts { grid-column: 2; }
  .edr-slots > li { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 0; }
}

/* Personal Info: a profile of facts, and record lists with EduRec's Edit and Add. */
.edr-profile { padding: 18px var(--edr-inset) 20px; display: flex; align-items: flex-start; gap: 24px; }
.edr-photo { width: 96px; height: 128px; flex: none; object-fit: cover; border-radius: var(--edr-radius-sm); background: var(--edr-surface-2); box-shadow: inset 0 0 0 1px var(--edr-line); }
.edr-profile-facts { flex: 1; min-width: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 14px 24px; }
.edr-profile-facts dt { font-size: 12px; color: var(--edr-muted); }
.edr-profile-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--edr-ink); overflow-wrap: anywhere; }
.edr-secret { gap: 10px; align-items: baseline; justify-content: flex-start; }
.edr-secret .edr-reveal { min-height: 24px; margin: 0; }
.edr-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: var(--edr-inset); border-top: 1px solid var(--edr-line); }
.edr-view-head + .edr-rec-head { border-top: 0; }
.edr-rec-head .edr-view-sub { border-top: 0; padding-bottom: 10px; }
.edr-rec-head > span:empty + .edr-btn { margin: 12px 0 2px; }
.edr-rows > li.edr-rec { grid-template-columns: minmax(0, 1fr) auto; }
.edr-rec .edr-exam-course { overflow-wrap: anywhere; }
.edr-addr { display: flex; flex-direction: column; }
.edr-rec-empty { margin: 0; padding: 4px var(--edr-inset) 16px; font-size: 14px; }

@container (max-width: 599px) {
  .edr-profile { flex-direction: column; gap: 16px; }
  .edr-photo { width: 72px; height: 96px; }
  .edr-profile-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
}

/* Dead end: what's unavailable, why, and the way out. */
.edr-dead {
  margin: 0 auto 20px 0; text-align: left; padding: 28px var(--edr-inset) 24px; max-width: 640px;
  background: var(--edr-surface); border: 1px solid var(--edr-line); border-radius: var(--edr-radius);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.edr-dead-icon {
  width: 44px; height: 44px; margin-bottom: 6px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: var(--edr-tint); color: var(--edr-selected-ink);
}
.edr-dead-body { margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.5; color: var(--edr-ink-2); }
.edr-dead-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.edr-dead-orig { margin-top: 12px; font-size: 13px; color: var(--edr-muted); }
.edr-dead-orig summary { cursor: pointer; font-weight: 600; color: var(--edr-blue); min-height: 28px; display: inline-flex; align-items: center; }
.edr-dead-orig p { margin: 6px 0 0; max-width: 72ch; line-height: 1.5; color: var(--edr-ink-2); }

/* Form intro: one line on the task, the rules that matter, then EduRec's form. */
.edr-task { margin: 0 0 20px; max-width: min(72ch, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; }
.edr-task-lede { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 500; color: var(--edr-ink); text-wrap: pretty; }
.edr-task-points { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.5; color: var(--edr-ink-2); }
.edr-task-points li::marker { color: var(--edr-muted); }

/* Action rows (layout.js): a group of only buttons sits left, level with the content. */
html[data-edr-on] .ps_apps_content .edr-actions { display: flex !important; flex-wrap: wrap; justify-content: flex-start !important; gap: 10px; margin: 8px 0 24px !important; text-align: left !important; }
html[data-edr-on] .ps_apps_content .edr-actions > * { margin: 0 !important; float: none !important; width: auto !important; }
html[data-edr-on] .ps_apps_content .edr-actions > .edr-actions { display: contents !important; }

@media (prefers-reduced-motion: no-preference) {
  .edr-view.is-new, .edr-dead.is-new, .edr-task.is-new { animation: edr-unroll 260ms cubic-bezier(0.16, 1, 0.3, 1) both; }
}
