/* irsc-brand:start */
/* irsc-brand 1.2.1 (b2f1b28) - generated by irsc-brand/scripts/sync.py; do not edit */

/*
 * IRSC design tokens. Source of truth: irsc-brand/css/irsc-tokens.css.
 * Apps receive a copy through scripts/sync.py; edit here, never in an app.
 *
 * Brand colors come from the IRSC brand guide. Everything under "UI tints"
 * is derived from those colors for interface states; check every text or
 * control pairing with scripts/check_contrast.py before changing a value.
 *
 * Themes: light is the default. <html data-theme="dark"> forces dark, and
 * <html data-theme="auto"> follows the visitor's system setting. Pages ship
 * with data-theme="light"; js/irsc-theme.js swaps in the visitor's saved
 * choice from the theme switch before the first paint. The dark tokens apply
 * on screen only, so every page prints with the light tokens.
 */

/* Metronic Slab Pro is licensed. These faces only use copies installed on the
   visitor's computer; add licensed woff2 files here to serve it to everyone. */
@font-face {
  font-family: "Metronic Slab Pro";
  font-weight: 300;
  src: local("Metronic Slab Pro Light"), local("MetronicSlabPro-Light");
}
@font-face {
  font-family: "Metronic Slab Pro";
  font-weight: 400;
  src: local("Metronic Slab Pro"), local("Metronic Slab Pro Regular"), local("MetronicSlabPro-Regular");
}
@font-face {
  font-family: "Metronic Slab Pro";
  font-weight: 600;
  src: local("Metronic Slab Pro SemiBold"), local("Metronic Slab Pro Semibold"), local("MetronicSlabPro-SemiBold");
}

:root {
  /* Brand palette (IRSC brand guide) */
  --irsc-blue: #003da5;   /* River Blue, PMS 293C (primary) */
  --irsc-yellow: #fedb00; /* Peregrine Yellow, PMS 108C (primary) */
  --irsc-navy: #062551;   /* PMS 655C (secondary) */
  --irsc-gray: #cfd2d3;   /* PMS 427C (secondary) */
  --irsc-black: #000000;
  --irsc-white: #ffffff;

  /* Type. Headings use Metronic Slab Pro; body copy uses the brand's web fonts. */
  --irsc-font-display: "Metronic Slab Pro", Rockwell, "Roboto Slab", "Trebuchet MS", Verdana, Arial, sans-serif;
  --irsc-font-body: "Trebuchet MS", Verdana, Arial, "Liberation Sans", sans-serif;
  --irsc-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --irsc-weight-light: 300;
  --irsc-weight-regular: 400;
  --irsc-weight-semibold: 600;

  --irsc-text-xs: 0.75rem;
  --irsc-text-sm: 0.875rem;
  --irsc-text-md: 1rem;
  --irsc-text-lg: 1.125rem;
  --irsc-text-xl: 1.375rem;
  --irsc-text-2xl: 1.75rem;
  --irsc-text-3xl: 2.25rem;
  --irsc-leading-tight: 1.2;
  --irsc-leading: 1.55;
  --irsc-measure: 70ch;

  /* Space, shape, depth, motion */
  --irsc-space-1: 0.25rem;
  --irsc-space-2: 0.5rem;
  --irsc-space-3: 0.75rem;
  --irsc-space-4: 1rem;
  --irsc-space-5: 1.5rem;
  --irsc-space-6: 2rem;
  --irsc-space-7: 3rem;
  --irsc-space-8: 4rem;
  --irsc-radius-sm: 4px;
  --irsc-radius-md: 8px;
  --irsc-radius-lg: 12px;
  --irsc-radius-pill: 999px;
  --irsc-control-height: 2.75rem; /* 44px touch target */
  --irsc-header-rule: 4px;        /* Peregrine Yellow rule under the header */
  --irsc-focus-width: 3px;
  --irsc-ease: cubic-bezier(0.2, 0, 0, 1);
  --irsc-duration: 150ms;

  /* UI tints and semantic roles: light theme */
  --irsc-bg: #f5f6f6;              /* page: PMS 427C at 20% */
  --irsc-surface: #ffffff;         /* cards, panels, inputs */
  --irsc-surface-sunken: #ecedee;  /* wells, table headers: PMS 427C at 40% */
  --irsc-text: #000000;
  --irsc-text-muted: #4a5157;
  --irsc-heading: #062551;
  --irsc-border: #cfd2d3;          /* decorative dividers only */
  --irsc-border-strong: #6b7278;   /* input and control outlines (3:1 or better) */
  --irsc-accent: #003da5;          /* primary buttons, selected states */
  --irsc-accent-hover: #062551;
  --irsc-on-accent: #ffffff;
  --irsc-accent-soft: #e6ecf6;     /* River Blue at 10%: selected rows, info */
  --irsc-link: #003da5;
  --irsc-link-hover: #062551;
  --irsc-highlight: #fedb00;       /* never as text or a line on light surfaces */
  --irsc-on-highlight: #000000;
  --irsc-highlight-soft: #fff8cc;  /* Peregrine Yellow at 20%: notices */
  --irsc-focus: #003da5;
  --irsc-focus-halo: #ffffff;
  --irsc-header-bg: #062551;
  --irsc-header-text: #ffffff;
  --irsc-header-muted: #c9d2e0;
  --irsc-header-accent: #fedb00;
  --irsc-header-focus: #fedb00;
  --irsc-danger: #b42318;
  --irsc-danger-soft: #fdecea;
  --irsc-success: #1a6b3a;
  --irsc-success-soft: #e7f4ec;
  --irsc-shadow-1: 0 1px 2px rgb(6 37 81 / 0.08), 0 1px 3px rgb(6 37 81 / 0.06);
  --irsc-shadow-2: 0 4px 12px rgb(6 37 81 / 0.12), 0 2px 4px rgb(6 37 81 / 0.08);
  color-scheme: light;
}

/* Dark theme, on screen only so pages print light. Keep this block and the
   auto block below identical. */
@media screen {
  :root[data-theme="dark"] {
    --irsc-bg: #031229;
    --irsc-surface: #062551;
    --irsc-surface-sunken: #04193a;
    --irsc-text: #ffffff;
    --irsc-text-muted: #bcc6d6;
    --irsc-heading: #ffffff;
    --irsc-border: #23406d;
    --irsc-border-strong: #8a9ab3;
    --irsc-accent: #fedb00;
    --irsc-accent-hover: #ffe75c;
    --irsc-on-accent: #062551;
    --irsc-accent-soft: #0e3470;
    --irsc-link: #a9c4f5;
    --irsc-link-hover: #fedb00;
    --irsc-highlight: #fedb00;
    --irsc-on-highlight: #000000;
    --irsc-highlight-soft: #3d3400;
    --irsc-focus: #fedb00;
    --irsc-focus-halo: #031229;
    --irsc-header-bg: #000000;
    --irsc-header-text: #ffffff;
    --irsc-header-muted: #c9d2e0;
    --irsc-header-accent: #fedb00;
    --irsc-header-focus: #fedb00;
    --irsc-danger: #ff9b91;
    --irsc-danger-soft: #4a1410;
    --irsc-success: #7fdc9f;
    --irsc-success-soft: #0f3a22;
    --irsc-shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --irsc-shadow-2: 0 4px 12px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

@media screen and (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --irsc-bg: #031229;
    --irsc-surface: #062551;
    --irsc-surface-sunken: #04193a;
    --irsc-text: #ffffff;
    --irsc-text-muted: #bcc6d6;
    --irsc-heading: #ffffff;
    --irsc-border: #23406d;
    --irsc-border-strong: #8a9ab3;
    --irsc-accent: #fedb00;
    --irsc-accent-hover: #ffe75c;
    --irsc-on-accent: #062551;
    --irsc-accent-soft: #0e3470;
    --irsc-link: #a9c4f5;
    --irsc-link-hover: #fedb00;
    --irsc-highlight: #fedb00;
    --irsc-on-highlight: #000000;
    --irsc-highlight-soft: #3d3400;
    --irsc-focus: #fedb00;
    --irsc-focus-halo: #031229;
    --irsc-header-bg: #000000;
    --irsc-header-text: #ffffff;
    --irsc-header-muted: #c9d2e0;
    --irsc-header-accent: #fedb00;
    --irsc-header-focus: #fedb00;
    --irsc-danger: #ff9b91;
    --irsc-danger-soft: #4a1410;
    --irsc-success: #7fdc9f;
    --irsc-success-soft: #0f3a22;
    --irsc-shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --irsc-shadow-2: 0 4px 12px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

/*
 * IRSC base: element defaults built only from irsc-tokens.css.
 *
 * Element rules sit inside :where() so they carry zero specificity; any rule
 * an app writes, even a bare element selector, wins without !important.
 * The utility classes and the print rules at the end use plain selectors on
 * purpose so an app's element rules cannot undo them.
 */

/* Box model */
:where(*),
::before,
::after {
  box-sizing: border-box;
}

:where(html) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Page */
:where(body) {
  margin: 0;
  background: var(--irsc-bg);
  color: var(--irsc-text);
  font-family: var(--irsc-font-body);
  font-size: 1rem;
  line-height: var(--irsc-leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: Metronic Slab Pro semibold where installed, brand fallbacks elsewhere */
:where(h1, h2, h3, h4) {
  margin: 0 0 var(--irsc-space-3);
  color: var(--irsc-heading);
  font-family: var(--irsc-font-display);
  font-weight: var(--irsc-weight-semibold);
  line-height: var(--irsc-leading-tight);
  text-wrap: balance;
}

:where(h1) {
  font-size: var(--irsc-text-3xl);
}

:where(h2) {
  font-size: var(--irsc-text-2xl);
}

:where(h3) {
  font-size: var(--irsc-text-xl);
}

:where(h4) {
  font-size: var(--irsc-text-lg);
}

/* Give a heading room when it follows running content */
:where(p, ul, ol, dl, blockquote, pre, table, figure) + :where(h2, h3, h4) {
  margin-top: var(--irsc-space-6);
}

:where(small) {
  font-size: var(--irsc-text-sm);
}

/* Links */
:where(a) {
  color: var(--irsc-link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:where(a:hover) {
  color: var(--irsc-link-hover);
  text-decoration-thickness: 2px;
}

/* Focus: a ring in the focus color with a halo on both sides, so it reads
   on light, dark and brand-colored backgrounds alike. */
:where(:focus-visible) {
  outline: var(--irsc-focus-width) solid var(--irsc-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 calc(var(--irsc-focus-width) + 4px) var(--irsc-focus-halo);
}

/* The header and toasts sit on the header color, where River Blue vanishes (1.6:1) */
:where(.irsc-header :focus-visible, .irsc-toast :focus-visible) {
  outline-color: var(--irsc-header-focus);
  box-shadow: 0 0 0 calc(var(--irsc-focus-width) + 4px) var(--irsc-header-bg);
}

::selection {
  background: var(--irsc-highlight);
  color: var(--irsc-on-highlight);
}

/* Media */
:where(img, svg, video, canvas, picture) {
  max-width: 100%;
}

:where(img, video) {
  height: auto;
}

/* Tables */
:where(table) {
  border-collapse: collapse;
  border-spacing: 0;
}

:where(th) {
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  text-align: start;
}

/* Form controls take the page font instead of the browser's. Color is left to
   the browser (or a component) so an unstyled control never inherits light
   text from a dark header, toast or app onto its light default background. */
:where(button, input, select, textarea) {
  font: inherit;
}

:where(button, [role="button"], label[for], select, summary) {
  cursor: pointer;
}

:where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--irsc-accent);
}

/* Code */
:where(code, kbd, samp, pre) {
  font-family: var(--irsc-font-mono);
  font-size: 0.9em;
}

:where(pre) {
  overflow-x: auto;
  padding: var(--irsc-space-4);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
}

:where(hr) {
  height: 0;
  margin: var(--irsc-space-6) 0;
  border: 0;
  border-top: 1px solid var(--irsc-border);
}

/* Utilities */

/* Skip link: off screen until a keyboard user tabs to it */
.irsc-skip-link {
  position: absolute;
  top: var(--irsc-space-3);
  left: var(--irsc-space-3);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2) var(--irsc-space-4);
  border-radius: var(--irsc-radius-sm);
  background: var(--irsc-highlight);
  color: var(--irsc-on-highlight);
  font-weight: var(--irsc-weight-semibold);
  text-decoration: underline;
  transform: translateY(calc(-100% - var(--irsc-space-4)));
}

.irsc-skip-link:focus {
  transform: none;
}

/* Visually hidden, still read by screen readers */
.irsc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

/* Motion: honor the visitor's reduced-motion setting everywhere */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Windows high contrast and other forced-color modes drop box shadows and
   backgrounds, so focus and control edges must come from outlines and borders. */
@media (forced-colors: active) {
  :where(:focus-visible),
  :where(.irsc-header :focus-visible, .irsc-toast :focus-visible) {
    outline: var(--irsc-focus-width) solid Highlight;
    box-shadow: none;
  }

  :where(hr) {
    border-top-color: CanvasText;
  }

  /* Its yellow fill is dropped, so give the skip link a visible edge */
  .irsc-skip-link {
    border: 2px solid CanvasText;
  }
}

/* Print: the dark tokens are screen-only, so pages print with the light theme
   and River Blue links. Browsers drop fills on paper by default, so the header
   prints dark on white, buttons and marks keep the fill their label needs (a
   highlight badge would otherwise print as a yellow hairline), and screen-only
   controls are left out. */
@media print {
  :root {
    --irsc-header-bg: var(--irsc-surface);
    --irsc-header-text: var(--irsc-text);
    --irsc-header-muted: var(--irsc-text-muted);
    --irsc-header-accent: var(--irsc-text);
  }

  .irsc-btn,
  .irsc-badge--highlight,
  .irsc-pagination [aria-current="page"],
  .irsc-notice::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* A primary button in the header is filled with the header accent, black here */
  .irsc-header .irsc-btn {
    --irsc-on-accent: var(--irsc-surface);
  }

  .irsc-skip-link,
  .irsc-theme-switch,
  .irsc-toast-region {
    display: none !important;
  }
}

/*
 * IRSC components. Every class starts with .irsc- and every color, size and
 * font comes from irsc-tokens.css. Mobile first: the base rules fit a 360px
 * screen and wider layouts are added with min-width media queries.
 */

/* ---------- Layout ---------- */

/* Container: centered page column with side padding */
.irsc-container {
  width: 100%;
  max-width: var(--irsc-container-max, 72rem);
  margin-inline: auto;
  padding-inline: var(--irsc-space-4);
}

@media (min-width: 48rem) {
  .irsc-container {
    padding-inline: var(--irsc-space-6);
  }
}

/* Stack: vertical rhythm between siblings; set --irsc-stack-gap to change it */
.irsc-stack {
  display: flex;
  flex-direction: column;
  gap: var(--irsc-stack-gap, var(--irsc-space-4));
}

.irsc-stack--sm {
  --irsc-stack-gap: var(--irsc-space-2);
}

.irsc-stack--lg {
  --irsc-stack-gap: var(--irsc-space-6);
}

/* Cluster: a wrapping row, for button groups and badge lists */
.irsc-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-cluster-gap, var(--irsc-space-3));
}

/* ---------- Header ---------- */

/* Header: navy bar, Peregrine Yellow rule, text wordmark, nav, actions.
   River Blue is 1.6:1 on the header, so a primary button in it turns
   Peregrine Yellow with black text (white on hover). Nothing is reordered:
   the parts wrap in source order (wordmark, nav, actions), so Tab follows
   what the eye reads at every width. */
.irsc-header {
  --irsc-accent: var(--irsc-header-accent);
  --irsc-accent-hover: var(--irsc-header-text);
  --irsc-on-accent: var(--irsc-on-highlight);
  background: var(--irsc-header-bg);
  color: var(--irsc-header-text);
  border-bottom: var(--irsc-header-rule) solid var(--irsc-header-accent);
}

.irsc-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-5);
  padding-block: var(--irsc-space-3);
}

/* Plain links and headings on the header color (header, toast) use its text
   color; the page's River Blue links and navy headings would vanish there. */
.irsc-header :where(a),
.irsc-toast :where(a) {
  color: var(--irsc-header-text);
}

.irsc-header :where(h1, h2, h3, h4),
.irsc-toast :where(h1, h2, h3, h4) {
  color: inherit;
}

/* Wordmark: "Indian River State College" eyebrow over the app name (no logo) */
.irsc-wordmark {
  display: inline-flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: none;
  padding-block: var(--irsc-space-1);
  border-radius: var(--irsc-radius-sm);
  color: var(--irsc-header-text);
  text-decoration: none;
}

.irsc-wordmark:hover {
  color: var(--irsc-header-text);
}

.irsc-wordmark__eyebrow {
  color: var(--irsc-header-muted);
  font-family: var(--irsc-font-body);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.irsc-wordmark__name {
  font-family: var(--irsc-font-display);
  font-size: var(--irsc-text-xl);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.1;
}

/* Header actions: theme switch, sign-in state. They come last and hug the
   right edge on whichever row they land, and so does each row they wrap onto. */
.irsc-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--irsc-space-3);
  margin-left: auto;
  color: var(--irsc-header-muted);
  font-size: var(--irsc-text-sm);
  white-space: nowrap;
}

/* Plain links among the actions (Help, Sign out) get a full 44px target */
.irsc-header__actions :where(a:not(.irsc-btn)) {
  display: inline-flex;
  align-items: center;
  min-height: var(--irsc-control-height);
}

/* Nav: beside the wordmark when it fits, otherwise on the next row with its
   first link lined up under the wordmark. Links wrap rather than scroll out
   of sight. */
.irsc-nav {
  margin-inline: calc(var(--irsc-space-3) * -1);
}

.irsc-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.irsc-nav a {
  display: flex;
  align-items: center;
  min-height: var(--irsc-control-height);
  padding-inline: var(--irsc-space-3);
  border-radius: var(--irsc-radius-sm);
  color: var(--irsc-header-muted);
  font-weight: var(--irsc-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
}

.irsc-nav a:hover {
  color: var(--irsc-header-text);
  text-decoration: underline 1px var(--irsc-header-muted);
  text-underline-offset: 0.45em;
}

/* Current page: white text with a Peregrine Yellow underline marker */
.irsc-nav a[aria-current]:not([aria-current="false"]) {
  color: var(--irsc-header-text);
  text-decoration: underline 3px var(--irsc-header-accent);
  text-underline-offset: 0.45em;
}

/* Links sit edge to edge, so draw the focus ring inside */
.irsc-nav a:focus-visible {
  outline-offset: calc(var(--irsc-focus-width) * -1);
  box-shadow: none;
}

@media (min-width: 60rem) {
  .irsc-header__inner {
    flex-wrap: nowrap;
    min-height: 4.5rem;
    padding-block: 0;
  }

  /* A squeezed nav wraps to a second line before the wordmark or actions shrink */
  .irsc-nav {
    margin-inline: 0;
  }

  .irsc-header__actions {
    flex: none;
    flex-wrap: nowrap;
  }
}

/* ---------- Theme switch ---------- */

/* Theme switch: Light / Dark / Auto, remembered per browser by js/irsc-theme.js.
   Put it in .irsc-header__actions or on any page surface:
   <div class="irsc-theme-switch" role="group" aria-label="Color theme" data-irsc-theme-switch>
     <button type="button" data-irsc-theme-value="light" aria-pressed="true">Light</button>
     <button type="button" data-irsc-theme-value="dark" aria-pressed="false">Dark</button>
     <button type="button" data-irsc-theme-value="auto" aria-pressed="false">Auto</button>
   </div> */
.irsc-theme-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--irsc-theme-switch-edge, var(--irsc-border-strong));
  border-radius: var(--irsc-radius-pill);
}

/* 36px segments; the ::after reaches the group's edge for a 44px touch target */
.irsc-theme-switch button {
  position: relative;
  min-height: 2.25rem;
  margin: 0;
  padding: 0 var(--irsc-space-3);
  border: 0;
  border-radius: var(--irsc-radius-pill);
  background: transparent;
  color: var(--irsc-theme-switch-text, var(--irsc-text-muted));
  font-family: var(--irsc-font-body);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.irsc-theme-switch button::after {
  content: "";
  position: absolute;
  inset-block: min(0px, calc((100% - var(--irsc-control-height)) / 2));
  inset-inline: min(0px, calc((100% - var(--irsc-control-height)) / 2));
}

.irsc-theme-switch button:hover {
  color: var(--irsc-theme-switch-hover, var(--irsc-text));
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Selected: the accent fill. River Blue with white text on a light page, Peregrine
   Yellow with navy text on a dark one, and yellow with black text in the header. */
.irsc-theme-switch [aria-pressed="true"],
.irsc-theme-switch [aria-pressed="true"]:hover {
  background: var(--irsc-accent);
  color: var(--irsc-on-accent);
  text-decoration: none;
}

/* Segments sit edge to edge, so the focus ring goes inside, clear of the edge
   so it still reads on a filled segment. The selected segment is filled with
   the focus color, so its ring takes the label color. */
.irsc-theme-switch button:focus-visible {
  outline-offset: calc(var(--irsc-focus-width) * -1 - 2px);
  box-shadow: none;
}

.irsc-theme-switch [aria-pressed="true"]:focus-visible {
  outline-color: currentColor;
}

.irsc-header .irsc-theme-switch {
  --irsc-theme-switch-edge: var(--irsc-header-muted);
  --irsc-theme-switch-text: var(--irsc-header-muted);
  --irsc-theme-switch-hover: var(--irsc-header-text);
}

/* ---------- Buttons ---------- */

/* Button: River Blue primary (yellow with navy text in dark mode) */
.irsc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--irsc-space-2);
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2) var(--irsc-space-5);
  border: 2px solid var(--irsc-accent);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-accent);
  color: var(--irsc-on-accent);
  font-family: var(--irsc-font-body);
  font-size: var(--irsc-text-md);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--irsc-duration) var(--irsc-ease),
    border-color var(--irsc-duration) var(--irsc-ease),
    color var(--irsc-duration) var(--irsc-ease);
}

.irsc-btn:hover {
  border-color: var(--irsc-accent-hover);
  background: var(--irsc-accent-hover);
  color: var(--irsc-on-accent);
}

/* Secondary: outlined, for the second action in a group */
.irsc-btn--secondary {
  border-color: var(--irsc-border-strong);
  background: var(--irsc-surface);
  color: var(--irsc-text);
}

.irsc-btn--secondary:hover {
  border-color: var(--irsc-accent);
  background: var(--irsc-accent-soft);
  color: var(--irsc-text);
}

/* Ghost: text-only, for low-emphasis actions such as Cancel */
.irsc-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--irsc-link);
}

.irsc-btn--ghost:hover {
  border-color: transparent;
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
}

/* Danger: outlined in red, fills on hover; for destructive actions */
.irsc-btn--danger {
  border-color: var(--irsc-danger);
  background: var(--irsc-surface);
  color: var(--irsc-danger);
}

.irsc-btn--danger:hover {
  border-color: var(--irsc-danger);
  background: var(--irsc-danger);
  color: var(--irsc-surface);
}

/* Small: dense toolbars and table rows. 32px to the eye; the ::after
   extends the touch target to 44px without changing the layout. */
.irsc-btn--sm {
  position: relative;
  min-height: 2rem;
  padding: var(--irsc-space-1) var(--irsc-space-3);
  border-radius: var(--irsc-radius-sm);
  font-size: var(--irsc-text-sm);
}

.irsc-btn--sm::after {
  content: "";
  position: absolute;
  inset-block: min(0px, calc((100% - var(--irsc-control-height)) / 2));
  inset-inline: min(0px, calc((100% - var(--irsc-control-height)) / 2));
}

/* Disabled: muted and inert; applies to <button disabled> and aria-disabled links */
.irsc-btn:disabled,
.irsc-btn[aria-disabled="true"] {
  border-color: var(--irsc-border);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text-muted);
  cursor: not-allowed;
}

/* Secondary and ghost buttons on the header color (header, toast) */
.irsc-header .irsc-btn--secondary,
.irsc-header .irsc-btn--ghost,
.irsc-toast .irsc-btn--secondary,
.irsc-toast .irsc-btn--ghost {
  border-color: var(--irsc-header-muted);
  background: transparent;
  color: var(--irsc-header-text);
}

.irsc-header .irsc-btn--ghost,
.irsc-toast .irsc-btn--ghost {
  border-color: transparent;
}

.irsc-header .irsc-btn--secondary:hover,
.irsc-header .irsc-btn--ghost:hover,
.irsc-toast .irsc-btn--secondary:hover,
.irsc-toast .irsc-btn--ghost:hover {
  border-color: var(--irsc-header-text);
  background: transparent;
  color: var(--irsc-header-text);
}

/* ---------- Forms ---------- */

/* Field: label, optional hint, optional error, control; link them with aria-describedby */
.irsc-field {
  display: flex;
  flex-direction: column;
  gap: var(--irsc-space-1);
  min-width: 0;
}

.irsc-label,
.irsc-field > label {
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

/* "(optional)" or "(required)" after a label */
.irsc-label__note {
  color: var(--irsc-text-muted);
  font-weight: var(--irsc-weight-regular);
}

/* Hint: help text under the label */
.irsc-hint {
  margin: 0;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

/* Error: what went wrong and how to fix it, shown above the control */
.irsc-error {
  margin: 0;
  color: var(--irsc-danger);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
}

/* Text inputs, selects, textareas: class them, or put them inside .irsc-field */
.irsc-input,
.irsc-select,
.irsc-textarea,
.irsc-field :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="submit"], [type="button"], [type="reset"], [type="hidden"]), select, textarea) {
  display: block;
  width: 100%;
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2) var(--irsc-space-3);
  border: 1px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-sm);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  font: inherit;
  transition: border-color var(--irsc-duration) var(--irsc-ease);
}

.irsc-textarea,
.irsc-field textarea {
  min-height: 7rem;
  resize: vertical;
}

/* Placeholder: muted text at full opacity so it keeps 4.5:1 (Firefox fades it) */
.irsc-input::placeholder,
.irsc-textarea::placeholder,
.irsc-field :where(input, textarea)::placeholder {
  color: var(--irsc-text-muted);
  opacity: 1;
}

.irsc-input:hover,
.irsc-select:hover,
.irsc-textarea:hover,
.irsc-field :where(input, select, textarea):hover {
  border-color: var(--irsc-text);
}

.irsc-input:focus-visible,
.irsc-select:focus-visible,
.irsc-textarea:focus-visible,
.irsc-field :where(input, select, textarea):focus-visible {
  border-color: var(--irsc-accent);
}

/* Invalid: red edge, doubled with an inset line so it is not color alone */
.irsc-input[aria-invalid="true"],
.irsc-select[aria-invalid="true"],
.irsc-textarea[aria-invalid="true"],
.irsc-field :where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--irsc-danger);
  box-shadow: inset 0 0 0 1px var(--irsc-danger);
}

.irsc-field--invalid {
  padding-left: var(--irsc-space-4);
  border-left: 4px solid var(--irsc-danger);
}

.irsc-input:disabled,
.irsc-select:disabled,
.irsc-textarea:disabled,
.irsc-field :where(input, select, textarea):disabled {
  border-color: var(--irsc-border);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text-muted);
  cursor: not-allowed;
}

/* Checkbox and radio rows: native controls tinted with accent-color */
.irsc-check {
  display: flex;
  align-items: flex-start;
  gap: var(--irsc-space-3);
  min-height: var(--irsc-control-height);
  padding-block: var(--irsc-space-2);
  cursor: pointer;
}

.irsc-check input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  accent-color: var(--irsc-accent);
  cursor: pointer;
}

/* Fieldset: groups radios, checkboxes or related fields under a legend */
.irsc-fieldset {
  min-width: 0;
  margin: 0;
  padding: var(--irsc-space-4);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-md);
}

.irsc-fieldset > legend {
  padding-inline: var(--irsc-space-2);
  color: var(--irsc-heading);
  font-family: var(--irsc-font-display);
  font-size: var(--irsc-text-lg);
  font-weight: var(--irsc-weight-semibold);
}

/* Error summary: top of the form after a failed submit; give it tabindex="-1" and focus it */
.irsc-error-summary {
  padding: var(--irsc-space-4) var(--irsc-space-5);
  border: 2px solid var(--irsc-danger);
  border-left-width: 6px;
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface);
  color: var(--irsc-text);
}

.irsc-error-summary > :first-child {
  margin-top: 0;
  color: var(--irsc-danger);
  font-size: var(--irsc-text-lg);
}

.irsc-error-summary ul {
  margin: var(--irsc-space-2) 0 0;
  padding-left: var(--irsc-space-5);
}

.irsc-error-summary a {
  color: var(--irsc-danger);
  font-weight: var(--irsc-weight-semibold);
}

.irsc-error-summary a:hover {
  color: var(--irsc-text);
}

/* ---------- Surfaces ---------- */

/* Card: white panel on the gray page */
.irsc-card {
  padding: var(--irsc-space-5);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  box-shadow: var(--irsc-shadow-1);
}

.irsc-card > :last-child {
  margin-bottom: 0;
}

/* Notice: inline message with a left rule and a status mark; --info is the default */
.irsc-notice {
  position: relative;
  padding: var(--irsc-space-4) var(--irsc-space-4) var(--irsc-space-4) calc(var(--irsc-space-4) * 2 + 1.5rem);
  border-left: 4px solid var(--irsc-notice-rule, var(--irsc-accent));
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-notice-bg, var(--irsc-accent-soft));
  color: var(--irsc-text);
}

.irsc-notice::before {
  content: "i";
  content: "i" / "";
  position: absolute;
  top: var(--irsc-space-4);
  left: var(--irsc-space-4);
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-notice-mark-bg, var(--irsc-accent));
  color: var(--irsc-notice-mark-text, var(--irsc-on-accent));
  font-family: var(--irsc-font-display);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1;
}

.irsc-notice :where(p, ul, ol) {
  margin: var(--irsc-space-2) 0 0;
}

.irsc-notice > :first-child,
.irsc-notice__title + * {
  margin-top: 0;
}

.irsc-notice > :last-child {
  margin-bottom: 0;
}

/* Notice title: one short line above the message */
.irsc-notice__title {
  display: block;
  margin-bottom: var(--irsc-space-1);
  color: var(--irsc-notice-title, var(--irsc-text));
  font-weight: var(--irsc-weight-semibold);
}

.irsc-notice--success {
  --irsc-notice-bg: var(--irsc-success-soft);
  --irsc-notice-rule: var(--irsc-success);
  --irsc-notice-mark-bg: var(--irsc-success);
  --irsc-notice-mark-text: var(--irsc-surface);
  --irsc-notice-title: var(--irsc-success);
}

.irsc-notice--success::before {
  content: "\2713";
  content: "\2713" / "";
}

/* Warning: pale yellow with a black (white in dark) rule; yellow never as a line on light */
.irsc-notice--warning {
  --irsc-notice-bg: var(--irsc-highlight-soft);
  --irsc-notice-rule: var(--irsc-text);
  --irsc-notice-mark-bg: var(--irsc-highlight);
  --irsc-notice-mark-text: var(--irsc-on-highlight);
}

.irsc-notice--warning::before,
.irsc-notice--danger::before {
  content: "!";
  content: "!" / "";
}

.irsc-notice--danger {
  --irsc-notice-bg: var(--irsc-danger-soft);
  --irsc-notice-rule: var(--irsc-danger);
  --irsc-notice-mark-bg: var(--irsc-danger);
  --irsc-notice-mark-text: var(--irsc-surface);
  --irsc-notice-title: var(--irsc-danger);
}

/* Badge: short status label */
.irsc-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-1);
  padding: 0.125rem var(--irsc-space-2);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

/* Accent: River Blue tint; stays distinct from the yellow highlight in dark mode */
.irsc-badge--accent {
  border-color: var(--irsc-link);
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
}

/* Highlight: Peregrine Yellow with black text, for "New" and "Action needed" */
.irsc-badge--highlight {
  border-color: var(--irsc-highlight);
  background: var(--irsc-highlight);
  color: var(--irsc-on-highlight);
}

.irsc-badge--success {
  border-color: var(--irsc-success-soft);
  background: var(--irsc-success-soft);
  color: var(--irsc-success);
}

.irsc-badge--danger {
  border-color: var(--irsc-danger-soft);
  background: var(--irsc-danger-soft);
  color: var(--irsc-danger);
}

/* ---------- Data ---------- */

/* Table wrap: scrolls wide tables sideways; add tabindex="0" role="region" aria-label */
.irsc-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
}

/* Table: sunken header row, divided body rows, accent-soft selection */
.irsc-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--irsc-text);
  font-size: var(--irsc-text-sm);
}

.irsc-table caption {
  padding: var(--irsc-space-3) var(--irsc-space-4);
  color: var(--irsc-text-muted);
  text-align: start;
}

.irsc-table th,
.irsc-table td {
  padding: var(--irsc-space-3) var(--irsc-space-4);
  border-bottom: 1px solid var(--irsc-border);
  text-align: start;
  vertical-align: top;
}

.irsc-table thead th {
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  white-space: nowrap;
}

.irsc-table tbody th {
  background: transparent;
}

.irsc-table tbody tr:last-child > * {
  border-bottom: 0;
}

.irsc-table tbody tr:hover > * {
  background: var(--irsc-bg);
}

/* Selected row: class it, or use aria-selected inside role="grid" */
.irsc-table tbody tr.irsc-is-selected > *,
.irsc-table tbody tr[aria-selected="true"] > * {
  background: var(--irsc-accent-soft);
}

/* Numeric column: right aligned, even digit widths */
.irsc-table .irsc-num {
  font-variant-numeric: tabular-nums;
  text-align: end;
}

/* Pagination: page links in a row; mark the current page with aria-current="page" */
.irsc-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--irsc-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.irsc-pagination a,
.irsc-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--irsc-control-height);
  min-height: var(--irsc-control-height);
  padding-inline: var(--irsc-space-3);
  border: 1px solid transparent;
  border-radius: var(--irsc-radius-md);
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  text-decoration: none;
}

.irsc-pagination a:hover {
  border-color: var(--irsc-border-strong);
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
}

.irsc-pagination a[aria-current="page"] {
  border-color: var(--irsc-accent);
  background: var(--irsc-accent);
  color: var(--irsc-on-accent);
}

.irsc-pagination span,
.irsc-pagination a[aria-disabled="true"] {
  color: var(--irsc-text-muted);
  pointer-events: none;
}

/* ---------- Navigation ---------- */

/* Tabs: role="tablist" row; the selected tab gets an accent bar */
.irsc-tabs__list {
  display: flex;
  gap: var(--irsc-space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--irsc-border);
  scrollbar-width: thin;
}

.irsc-tabs [role="tab"] {
  position: relative;
  flex: none;
  min-height: var(--irsc-control-height);
  margin: 0;
  padding: var(--irsc-space-2) var(--irsc-space-4);
  border: 0;
  border-radius: var(--irsc-radius-sm) var(--irsc-radius-sm) 0 0;
  background: transparent;
  color: var(--irsc-text-muted);
  font: inherit;
  font-weight: var(--irsc-weight-semibold);
  white-space: nowrap;
  cursor: pointer;
}

.irsc-tabs [role="tab"]:hover {
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
}

.irsc-tabs [role="tab"][aria-selected="true"] {
  color: var(--irsc-heading);
  text-decoration: underline 3px var(--irsc-accent);
  text-underline-offset: 0.6em;
}

.irsc-tabs [role="tab"]:focus-visible {
  outline-offset: calc(var(--irsc-focus-width) * -1);
  box-shadow: none;
}

.irsc-tabs [role="tabpanel"] {
  padding-top: var(--irsc-space-5);
}

/* Breadcrumb: ordered list of ancestors; last item has aria-current="page" */
.irsc-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
  list-style: none;
}

.irsc-breadcrumb li + li::before {
  content: "/";
  content: "/" / "";
  margin-inline: var(--irsc-space-2);
  color: var(--irsc-text-muted);
}

.irsc-breadcrumb a {
  color: var(--irsc-link);
}

.irsc-breadcrumb [aria-current="page"] {
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

/* ---------- Overlays ---------- */

/* Dialog: native <dialog> opened with showModal(); header, body and footer parts */
.irsc-dialog {
  width: min(32rem, calc(100vw - var(--irsc-space-4) * 2));
  max-height: calc(100dvh - var(--irsc-space-6) * 2);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  box-shadow: var(--irsc-shadow-2);
}

/* Header color at 60%: navy in light, black in dark, so a navy dark-theme
   dialog still stands out. Older browsers don't pass custom properties to
   ::backdrop, hence the fallback. */
.irsc-dialog::backdrop {
  background: color-mix(in srgb, var(--irsc-header-bg, #062551) 60%, transparent);
}

.irsc-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--irsc-space-3);
  padding: var(--irsc-space-5) var(--irsc-space-5) 0;
}

.irsc-dialog__header > :first-child {
  margin: 0;
  font-size: var(--irsc-text-xl);
}

.irsc-dialog__body {
  padding: var(--irsc-space-3) var(--irsc-space-5) var(--irsc-space-5);
}

.irsc-dialog__body > :first-child {
  margin-top: 0;
}

.irsc-dialog__body > :last-child {
  margin-bottom: 0;
}

.irsc-dialog__footer {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: var(--irsc-space-3);
  padding: var(--irsc-space-4) var(--irsc-space-5);
  border-top: 1px solid var(--irsc-border);
  background: var(--irsc-surface-sunken);
}

/* Toast region: fixed stack at the bottom; put role="status" on it */
.irsc-toast-region {
  position: fixed;
  right: var(--irsc-space-4);
  bottom: var(--irsc-space-4);
  left: var(--irsc-space-4);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--irsc-space-2);
  pointer-events: none;
}

@media (min-width: 48rem) {
  .irsc-toast-region {
    left: auto;
    align-items: flex-end;
  }
}

/* Toast: brief confirmation on the header's navy with a yellow edge */
.irsc-toast {
  display: flex;
  align-items: center;
  gap: var(--irsc-space-3);
  width: 100%;
  max-width: 24rem;
  padding: var(--irsc-space-3) var(--irsc-space-4);
  border-left: 4px solid var(--irsc-header-accent);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-header-bg);
  color: var(--irsc-header-text);
  box-shadow: var(--irsc-shadow-2);
  pointer-events: auto;
  animation: irsc-toast-in 200ms var(--irsc-ease);
}

@keyframes irsc-toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

/* Empty state: centered message and next step when a list has nothing in it */
.irsc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--irsc-space-3);
  padding: var(--irsc-space-7) var(--irsc-space-5);
  border: 1px dashed var(--irsc-border-strong);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  color: var(--irsc-text-muted);
  text-align: center;
}

.irsc-empty__icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
}

.irsc-empty :where(h2, h3, h4) {
  margin: 0;
  color: var(--irsc-heading);
}

.irsc-empty p {
  max-width: 40ch;
  margin: 0;
}

/* ---------- Footer ---------- */

/* Footer: quiet closing band with college name and app links */
.irsc-footer {
  margin-top: var(--irsc-space-8);
  padding-block: var(--irsc-space-6);
  border-top: 1px solid var(--irsc-border);
  background: var(--irsc-surface);
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

.irsc-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--irsc-space-3) var(--irsc-space-5);
}

.irsc-footer a {
  color: var(--irsc-link);
}

/* ---------- Forced colors ---------- */

/* Keep component edges and markers visible when the system replaces colors */
@media (forced-colors: active) {
  .irsc-btn,
  .irsc-badge,
  .irsc-card,
  .irsc-notice,
  .irsc-toast,
  .irsc-empty,
  .irsc-table-wrap {
    border: 1px solid CanvasText;
  }

  .irsc-notice::before {
    forced-color-adjust: none;
    background: CanvasText;
    color: Canvas;
  }

  .irsc-pagination a[aria-current="page"] {
    border: 2px solid Highlight;
  }

  /* The accent fill is dropped, so the selected theme gets the system
     highlight plus an underline */
  .irsc-theme-switch [aria-pressed="true"],
  .irsc-theme-switch [aria-pressed="true"]:hover {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
    text-decoration: underline 2px;
    text-underline-offset: 0.3em;
  }

  .irsc-btn:disabled,
  .irsc-btn[aria-disabled="true"] {
    border-color: GrayText;
    color: GrayText;
  }

  /* The selected-row tint is dropped, so mark the row with a system-color edge */
  .irsc-table tbody tr.irsc-is-selected > *,
  .irsc-table tbody tr[aria-selected="true"] > * {
    border-block: 2px solid Highlight;
  }
}
/* irsc-brand:end */

/* ==========================================================================
   IRSC Forms: the app's own rules, on top of the irsc-brand bundle above.
   Every color, font and size comes from an --irsc-* token, so the dark
   theme follows automatically. Class names the templates, builder.js and
   htmx rely on (#builder, #results, #summary, .combo-item, .active ...)
   are kept; only their look changed.
   ========================================================================== */

/* ---------- Page ---------- */

html,
body {
  min-height: 100%;
}

/* Elements hidden with the hidden attribute stay hidden even if a class sets display */
[hidden] {
  display: none !important;
}

/* The skip link moves focus to <main>; don't ring the whole page */
#main:focus {
  outline: none;
  box-shadow: none;
}

h1 {
  font-size: var(--irsc-text-2xl);
}

@media (min-width: 48rem) {
  h1 {
    font-size: var(--irsc-text-3xl);
  }
}

code {
  overflow-wrap: anywhere;
}

/* Page column: forms read best narrow; results and summaries get more room */
.stage {
  width: min(48rem, 100% - 2 * var(--irsc-space-4));
  margin: var(--irsc-space-6) auto var(--irsc-space-8);
}

.wide {
  width: min(70rem, 100% - 2 * var(--irsc-space-4));
}

/* Leave room under the last question for the floating add button */
#builder {
  padding-bottom: var(--irsc-space-7);
}

.muted {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

.error {
  color: var(--irsc-danger);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
}

.ok {
  color: var(--irsc-success);
  font-weight: var(--irsc-weight-semibold);
}

/* ---------- Header ---------- */

/* Signed-in address: shortened with an ellipsis rather than pushing the header wide */
.irsc-header__actions {
  min-width: 0;
  max-width: 100%;
}

/* The address and Sign out wrap as one unit, never split across rows */
.account {
  display: flex;
  align-items: center;
  gap: var(--irsc-space-3);
  min-width: 0;
}

/* The role sits under the address, so it needs no width of its own */
.who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.who > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.who-role {
  font-size: var(--irsc-text-xs);
}

.header-form {
  display: inline-flex;
  margin: 0;
}

/* Wide screens: the address shortens before the nav wraps to a second row */
@media (min-width: 60rem) {
  .irsc-header__actions {
    flex-shrink: 1;
  }

  .irsc-nav {
    flex: none;
  }
}

/* ---------- Toolbars and headings ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-3);
  margin: 0 0 var(--irsc-space-5);
}

.toolbar form {
  margin: 0;
}

.toolbar .irsc-btn:not(.irsc-btn--sm) {
  padding-inline: var(--irsc-space-4);
}

.toolbar-title {
  flex: 1 1 auto;
  margin: 0;
}

.list-heading {
  margin: var(--irsc-space-7) 0 var(--irsc-space-2);
  font-size: var(--irsc-text-xl);
}

.page-lede {
  max-width: var(--irsc-measure);
  margin: 0 0 var(--irsc-space-5);
}

/* ---------- Cards ---------- */

/* Same surface as .irsc-card: white panel, hairline border, shadow-1 */
.hero-card,
.q-card,
.panel {
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  box-shadow: var(--irsc-shadow-1);
}

.hero-card {
  overflow: hidden;
  margin-bottom: var(--irsc-space-4);
}

/* Accent edge across the top of the form's title card */
.hero-bar {
  height: 6px;
  background: var(--irsc-accent);
}

.hero-bar--success {
  background: var(--irsc-success);
}

.hero-body,
.q-body {
  padding: var(--irsc-space-4);
}

@media (min-width: 48rem) {
  .hero-body,
  .q-body {
    padding: var(--irsc-space-5) var(--irsc-space-6);
  }
}

.hero-body > :last-child,
.q-body > :last-child {
  margin-bottom: 0;
}

.hero-body h1 {
  margin: 0 0 var(--irsc-space-2);
}

.hero-lede {
  max-width: var(--irsc-measure);
  color: var(--irsc-text-muted);
}

.q-card {
  margin: var(--irsc-space-3) 0;
  /* Room above a question when an error-summary link scrolls to it */
  scroll-margin-top: var(--irsc-space-4);
}

.hero-card h2,
.q-card h2 {
  margin: 0 0 var(--irsc-space-2);
  font-size: var(--irsc-text-xl);
}

/* Section headings inside a form: River Blue tint with an accent rule */
.q-card.section-title {
  border-left: 4px solid var(--irsc-accent);
  background: var(--irsc-accent-soft);
}

/* Success check on the "Response recorded" card */
.done-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--irsc-space-3);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-success);
  color: var(--irsc-surface);
  font-size: var(--irsc-text-2xl);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1;
}

.done-mark::before {
  content: "\2713";
  content: "\2713" / "";
}

/* ---------- Fields ---------- */

/* Every text control matches .irsc-input: 44px tall, strong outline, surface fill.
   Wrapped in :where() so a class such as .title-input can restyle one. */
:where(
  input:not([type]),
  input[type="text"],
  input[type="email"],
  input[type="date"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  textarea,
  select
) {
  display: block;
  width: 100%;
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2) var(--irsc-space-3);
  border: 1px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-sm);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  font: inherit;
  transition: border-color var(--irsc-duration) var(--irsc-ease);
}

:where(textarea) {
  min-height: 7rem;
  resize: vertical;
}

:where(input, textarea)::placeholder {
  color: var(--irsc-text-muted);
  opacity: 1;
}

:where(input, select, textarea):hover {
  border-color: var(--irsc-text);
}

:where(input, select, textarea):focus-visible {
  border-color: var(--irsc-accent);
}

/* A date field's calendar button is a Tab stop inside the input, where only
   :focus-within matches, so draw the same ring there too */
input[type="date"]:focus-within {
  border-color: var(--irsc-accent);
  outline: var(--irsc-focus-width) solid var(--irsc-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 calc(var(--irsc-focus-width) + 4px) var(--irsc-focus-halo);
}

:where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--irsc-danger);
  box-shadow: inset 0 0 0 1px var(--irsc-danger);
}

:where(input, select, textarea):disabled {
  border-color: var(--irsc-border);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text-muted);
  cursor: not-allowed;
}

:where(input[type="checkbox"], input[type="radio"]) {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--irsc-accent);
}

/* A control inside its own label ("Term", "Whole department ...") */
.stack-label {
  display: block;
  margin-top: var(--irsc-space-4);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

.stack-label > :is(select, input, textarea) {
  max-width: 100%;
  margin-top: var(--irsc-space-1);
  font-weight: var(--irsc-weight-regular);
}

/* Label beside its control on wide screens, above it on phones ("Org chart") */
.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  margin-top: var(--irsc-space-4);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

.field-row > select {
  flex: 1 1 16rem;
  width: auto;
  min-width: 0;
  font-weight: var(--irsc-weight-regular);
}

/* ---------- Filling a form (student-facing) ---------- */

/* Question text: the label or legend of each question */
.q-title {
  display: block;
  margin: 0 0 var(--irsc-space-2);
  padding: 0;
  color: var(--irsc-text);
  font-size: var(--irsc-text-lg);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.35;
}

.q-req {
  color: var(--irsc-danger);
}

.q-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Same red edge .irsc-field--invalid gives a text field (the reset above removed it) */
.q-fieldset.irsc-field--invalid {
  padding-left: var(--irsc-space-4);
  border-left: 4px solid var(--irsc-danger);
}

.q-fieldset > .irsc-hint,
.q-fieldset > .irsc-error {
  margin-bottom: var(--irsc-space-2);
}

.q-comment {
  margin-top: var(--irsc-space-4);
}

/* Choice rows: the whole row is the tap target; the checked row is tinted */
.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--irsc-space-3);
  min-height: var(--irsc-control-height);
  margin: var(--irsc-space-2) 0;
  padding: 0.625rem var(--irsc-space-3);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  line-height: 1.4;
  cursor: pointer;
  transition:
    background-color var(--irsc-duration) var(--irsc-ease),
    border-color var(--irsc-duration) var(--irsc-ease);
}

.choice input {
  flex: none;
  margin-top: 0.05rem;
}

.choice:hover {
  border-color: var(--irsc-border-strong);
}

.choice:has(input:checked) {
  border-color: var(--irsc-accent);
  background: var(--irsc-accent-soft);
}

/* Linear scale: a row of numbered boxes; wraps to a second row for long scales */
.scale {
  display: flex;
  flex-wrap: wrap;
  gap: var(--irsc-space-2);
  margin-top: var(--irsc-space-2);
}

.scale label {
  display: flex;
  flex: 1 0 3rem;
  flex-direction: column;
  align-items: center;
  gap: var(--irsc-space-1);
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  cursor: pointer;
  transition:
    background-color var(--irsc-duration) var(--irsc-ease),
    border-color var(--irsc-duration) var(--irsc-ease);
}

.scale label:hover {
  border-color: var(--irsc-border-strong);
}

.scale label:has(input:checked) {
  border-color: var(--irsc-accent);
  background: var(--irsc-accent-soft);
}

.scale-ends {
  margin-top: var(--irsc-space-2);
}

/* Submit row: a full-width button on phones, a normal one on wide screens */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-3);
  margin-top: var(--irsc-space-5);
}

.form-submit {
  width: 100%;
  min-height: 3rem;
  font-size: var(--irsc-text-lg);
}

@media (min-width: 30rem) {
  .form-submit {
    width: auto;
    min-width: 12rem;
  }
}

.fill-summary {
  margin: var(--irsc-space-4) 0;
}

/* Intro: how long it takes and who sees what */
.fill-facts {
  margin: var(--irsc-space-3) 0 0;
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

.fill-privacy {
  margin: var(--irsc-space-1) 0 0;
}

/* "7 of 16 answered", pinned under the page top while scrolling (app.js shows it) */
.fill-progress {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: var(--irsc-space-3);
  margin: 0 0 var(--irsc-space-2);
  padding: var(--irsc-space-2) 0;
  background: var(--irsc-bg);
  color: var(--irsc-text);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
}

.fill-progress__text {
  flex: none;
  min-width: 8.5rem;
}

.fill-progress__bar {
  flex: 1 1 auto;
  margin: 0;
}

.fill-progress--done .fill-progress__text {
  color: var(--irsc-success);
}

/* Room for the pinned progress bar when an error link scrolls to a question */
.fill .q-card,
.likert__row {
  scroll-margin-top: 4rem;
}

/* Parts: a heading in the form starts one, with "Part 1 of 2" above it */
.fill-section {
  margin: var(--irsc-space-7) 0 var(--irsc-space-3);
}

.fill-section__eyebrow {
  margin: 0 0 var(--irsc-space-1);
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fill-section h2 {
  margin: 0;
  font-size: var(--irsc-text-xl);
}

.fill-section h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: var(--irsc-space-2);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-accent);
}

.fill-section .muted {
  margin: var(--irsc-space-2) 0 0;
}

/* Short answer lists (Too slow / About right / Too fast) side by side */
.choices-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--irsc-space-2);
}

.choices-inline .choice {
  flex: 0 1 auto;
  margin: 0;
}

/* Agreement grid: on phones each statement gets a wrapping row of answer buttons; on wide
   screens statements run down the side and the answers across the top. Every radio keeps
   its own label, so the column heads are only for the eye (aria-hidden). */
.likert__head {
  display: none;
}

.likert__row {
  padding: var(--irsc-space-5) 0;
  border-bottom: 1px solid var(--irsc-border);
}

.likert__head + .likert__row {
  padding-top: 0;
}

.likert__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.likert__row--invalid {
  padding-left: var(--irsc-space-3);
  border-left: 4px solid var(--irsc-danger);
}

.likert__statement p {
  margin: 0 0 var(--irsc-space-3);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.4;
}

.likert__options {
  display: flex;
  flex-direction: column;
  gap: var(--irsc-space-2);
  max-width: 28rem;
}

.likert__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--irsc-space-3);
  min-height: 3rem;
  padding: var(--irsc-space-2) var(--irsc-space-4);
  border: 1px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--irsc-duration) var(--irsc-ease),
    border-color var(--irsc-duration) var(--irsc-ease);
}

/* The radio stays in the page for keyboards and screen readers; the pill shows its state */
.likert__option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.likert__option:hover {
  border-color: var(--irsc-accent);
}

.likert__option:has(input:checked) {
  border-color: var(--irsc-accent);
  background: var(--irsc-accent);
  color: var(--irsc-on-accent);
}

/* The round marker: an empty ring, then a dot once chosen */
.likert__option::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--irsc-border-strong);
  border-radius: 50%;
  background: var(--irsc-surface);
}

.likert__option:has(input:checked)::before {
  border-color: var(--irsc-on-accent);
  background: var(--irsc-on-accent);
  box-shadow: inset 0 0 0 3px var(--irsc-accent);
}

/* N/A sits a little apart from the scale */
.likert--na .likert__option:last-child {
  margin-top: var(--irsc-space-2);
}

.likert__option:has(input:focus-visible) {
  outline: var(--irsc-focus-width) solid var(--irsc-focus);
  outline-offset: 2px;
}

.likert--cols-3 { --likert-cols: 3; }
.likert--cols-4 { --likert-cols: 4; }
.likert--cols-5 { --likert-cols: 5; }
.likert--cols-6 { --likert-cols: 6; }
.likert--cols-7 { --likert-cols: 7; }
.likert--cols-8 { --likert-cols: 8; }

@media (min-width: 50rem) {
  .likert__head,
  .likert__row {
    display: grid;
    grid-template-columns: minmax(0, 3.4fr) repeat(var(--likert-cols), minmax(2.75rem, 1fr));
    align-items: center;
    column-gap: var(--irsc-space-1);
  }

  /* The column heads stay in view under the progress bar while the grid scrolls past */
  .likert__head {
    position: sticky;
    top: 2.5rem;
    z-index: 5;
    padding: var(--irsc-space-2) 0;
    border-bottom: 1px solid var(--irsc-border-strong);
    background: var(--irsc-surface);
    color: var(--irsc-text-muted);
    font-size: var(--irsc-text-xs);
    font-weight: var(--irsc-weight-semibold);
    line-height: 1.25;
    text-align: center;
  }

  .likert__row,
  .likert__head + .likert__row,
  .likert__row:last-child {
    padding: var(--irsc-space-2);
    border-bottom: 0;
    border-radius: var(--irsc-radius-sm);
  }

  .likert__row:nth-child(odd) {
    background: var(--irsc-surface-sunken);
  }

  .likert__row--invalid {
    border-left: 4px solid var(--irsc-danger);
  }

  .likert__statement p {
    margin: 0;
    font-weight: var(--irsc-weight-regular);
  }

  .likert__statement .irsc-error {
    margin-top: var(--irsc-space-1);
  }

  .likert__options {
    display: contents;
  }

  .likert__option,
  .likert__option:has(input:checked) {
    justify-content: center;
    gap: 0;
    min-height: var(--irsc-control-height);
    padding: 0;
    border: 0;
    border-radius: var(--irsc-radius-sm);
    background: transparent;
    color: inherit;
  }

  .likert__option::before {
    display: none;
  }

  .likert__option:hover {
    background: var(--irsc-accent-soft);
  }

  .likert__option:has(input:focus-visible) {
    outline: none;
  }

  .likert__option input {
    position: static;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 1;
    cursor: pointer;
  }

  /* The column head says it; the label stays for screen readers */
  .likert__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* N/A is set apart from the scale by a little space */
  .likert--na .likert__head > span:last-child,
  .likert--na .likert__option:last-child {
    margin-top: 0;
    margin-left: var(--irsc-space-3);
  }
}

/* Submit: its own panel at the end */
.fill-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-3) var(--irsc-space-4);
  margin-top: var(--irsc-space-6);
  padding: var(--irsc-space-5);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-1);
}

.fill-submit .muted {
  margin: 0;
}

/* ---------- Form builder ---------- */

/* Form title: a large inline-edit field with an underline edge (3:1 on the card) */
.title-input {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: var(--irsc-space-1) var(--irsc-space-2);
  border: 0;
  border-bottom: 2px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-sm) var(--irsc-radius-sm) 0 0;
  background: transparent;
  color: var(--irsc-heading);
  font-family: var(--irsc-font-display);
  font-size: var(--irsc-text-xl);
  font-weight: var(--irsc-weight-semibold);
  line-height: var(--irsc-leading-tight);
}

@media (min-width: 48rem) {
  .title-input {
    font-size: var(--irsc-text-2xl);
  }
}

.title-input:hover {
  border-bottom-color: var(--irsc-text);
}

.title-input:focus-visible {
  border-bottom-color: var(--irsc-accent);
}

.hero-body .ghost-input {
  margin-top: var(--irsc-space-3);
}

.q-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--irsc-space-3);
}

.q-head .ghost-input {
  flex: 1 1 16rem;
  width: auto;
  min-width: 0;
}

.q-head .type-select {
  flex: 1 1 11rem;
  width: auto;
  min-width: 0;
}

@media (min-width: 48rem) {
  .q-head .type-select {
    flex: 0 0 12rem;
  }
}

/* Editor area under the question: options, scale bounds, previews */
.q-head + div {
  margin-top: var(--irsc-space-3);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2);
  margin: var(--irsc-space-2) 0;
}

.option-row input {
  flex: 1 1 10rem;
  width: auto;
  min-width: 0;
}

.option-row input[type="number"] {
  flex: 0 0 5.5rem;
}

.option-actions {
  margin-top: var(--irsc-space-2);
}

/* "×" remove-option button: a larger glyph so it reads at a glance */
.option-remove {
  font-size: var(--irsc-text-lg);
}

.q-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--irsc-space-1) var(--irsc-space-4);
  margin-top: var(--irsc-space-4);
  padding-top: var(--irsc-space-2);
  border-top: 1px solid var(--irsc-border);
  color: var(--irsc-text);
  font-size: var(--irsc-text-sm);
}

.q-foot label {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-2);
  min-height: var(--irsc-control-height);
  cursor: pointer;
}

/* Switches row on the title card: no divider */
.q-foot--plain {
  justify-content: flex-start;
  margin-top: var(--irsc-space-2);
  border-top: 0;
}

/* Form bar, in the editor and on Responses: back link, then the actions (save state,
   Preview, Send, Save, ⋮), then Questions | Responses tabs. It stays at the top while
   the page scrolls, so Save and Send are always in reach. */
.form-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 var(--irsc-space-5);
  padding-top: var(--irsc-space-2);
  border-bottom: 1px solid var(--irsc-border);
  background: var(--irsc-bg);
}

.form-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-3);
}

.form-bar__back {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-1);
  min-height: var(--irsc-control-height);
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  text-decoration: none;
}

.form-bar__back:hover {
  color: var(--irsc-link-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.form-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--irsc-space-2);
  margin-left: auto;
}

.form-bar .irsc-btn {
  gap: var(--irsc-space-1);
}

.btn-icon {
  display: inline-flex;
}

.btn-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-menu__dots .btn-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  stroke: none;
}

.save-state {
  margin-right: var(--irsc-space-2);
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
  white-space: nowrap;
}

.save-state--dirty {
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

/* Tabs: the current one is underlined in the accent, sitting on the bar's bottom line */
.form-tabs {
  display: flex;
  gap: var(--irsc-space-5);
  margin-top: var(--irsc-space-1);
}

.form-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-2);
  min-height: var(--irsc-control-height);
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--irsc-text-muted);
  font-weight: var(--irsc-weight-semibold);
  text-decoration: none;
}

.form-tab:hover {
  color: var(--irsc-text);
}

.form-tab[aria-current="page"] {
  border-bottom-color: var(--irsc-accent);
  color: var(--irsc-heading);
}

.form-tab__count {
  padding: 0 var(--irsc-space-2);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
  font-size: var(--irsc-text-sm);
}

.editor-message {
  margin: calc(var(--irsc-space-3) * -1) 0 var(--irsc-space-4);
}

/* "+ Add question" sits under the last question, as wide as the cards */
.add-question {
  width: 100%;
  margin: 0 0 var(--irsc-space-6);
}

/* ---------- Audience picker ---------- */

.audience-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  margin-bottom: var(--irsc-space-2);
}

.audience-head h2 {
  margin: 0;
}

.audience-head .muted {
  margin: 0;
}

.combo {
  margin-top: var(--irsc-space-4);
}

.combo label {
  display: block;
  margin-bottom: var(--irsc-space-1);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

.combo-field {
  position: relative;
}

.combo-list {
  position: absolute;
  top: calc(100% + var(--irsc-space-1));
  right: 0;
  left: 0;
  z-index: 8;
  max-height: 20rem;
  overflow: auto;
  border: 1px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-2);
}

.combo-item {
  display: flex;
  justify-content: space-between;
  gap: var(--irsc-space-3);
  width: 100%;
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2) var(--irsc-space-4);
  border: 0;
  border-bottom: 1px solid var(--irsc-border);
  background: transparent;
  color: var(--irsc-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Active option: tint plus an accent bar, so it isn't shown by color alone */
.combo-item.active,
.combo-item:hover {
  background: var(--irsc-accent-soft);
  box-shadow: inset 4px 0 0 var(--irsc-accent);
}

.combo-title {
  font-weight: var(--irsc-weight-semibold);
}

.combo-meta {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
  white-space: nowrap;
}

.combo-empty,
.combo-more {
  padding: var(--irsc-space-3) var(--irsc-space-4);
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

/* Search match: Peregrine Yellow behind black text (never yellow text) */
.combo mark {
  padding: 0 1px;
  border-radius: 2px;
  background: var(--irsc-highlight);
  color: var(--irsc-on-highlight);
}

.combo-note {
  margin: var(--irsc-space-2) 0 0;
}

/* Chosen sections: removable pills, 32px to the eye with a 44px touch target */
.chips {
  display: flex;
  flex-wrap: wrap;
  /* 12px: each chip's touch area reaches 6px past it, so wrapped rows never overlap */
  gap: var(--irsc-space-3);
  margin-top: var(--irsc-space-3);
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: var(--irsc-space-1) var(--irsc-space-3);
  border: 1px solid var(--irsc-link);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
  font: inherit;
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
  cursor: pointer;
}

.chip::after {
  content: "";
  position: absolute;
  inset-block: min(0px, calc((100% - var(--irsc-control-height)) / 2));
  inset-inline: 0;
}

.chip:hover {
  border-color: var(--irsc-link-hover);
  background: var(--irsc-surface);
  color: var(--irsc-link-hover);
}

.roster-bar {
  margin: var(--irsc-space-3) 0 0;
}

/* ---------- Lists of forms and classes ---------- */

.list {
  display: grid;
  gap: var(--irsc-space-3);
}

/* A student's classes on an evaluation (fill_classes.html and the thank-you page) */
.class-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.class-row--done {
  background: var(--irsc-surface-sunken);
  box-shadow: none;
}

.class-row--done > strong {
  color: var(--irsc-text-muted);
}

.fill-thanks {
  max-width: var(--irsc-measure);
  margin: var(--irsc-space-3) 0 0;
}

.fill-instructors {
  margin: var(--irsc-space-1) 0 0;
  color: var(--irsc-text-muted);
  font-weight: var(--irsc-weight-semibold);
}

.rates {
  margin: var(--irsc-space-5) 0 var(--irsc-space-6);
}

.card-link {
  display: block;
  padding: var(--irsc-space-4) var(--irsc-space-5);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  box-shadow: var(--irsc-shadow-1);
}

.card-link > strong {
  display: block;
  color: var(--irsc-heading);
  font-family: var(--irsc-font-display);
  font-size: var(--irsc-text-lg);
  font-weight: var(--irsc-weight-semibold);
  line-height: var(--irsc-leading-tight);
}

.card-link > .muted {
  display: block;
  margin-top: var(--irsc-space-1);
}

/* Linked cards: the title reads as a link; the card lifts on hover */
a.card-link {
  text-decoration: none;
  transition:
    border-color var(--irsc-duration) var(--irsc-ease),
    box-shadow var(--irsc-duration) var(--irsc-ease);
}

a.card-link > strong {
  color: var(--irsc-link);
  text-decoration: underline 1px;
  text-underline-offset: 0.2em;
}

a.card-link:hover {
  border-color: var(--irsc-accent);
  box-shadow: var(--irsc-shadow-2);
}

a.card-link:hover > strong {
  color: var(--irsc-link-hover);
  text-decoration-thickness: 2px;
}

/* Theme switch as two icons, sun (Light) and moon (Dark), with no Auto. Square
   36px segments; the bundle's ::after still makes each a 44px touch target. */
.theme-icons button {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  padding: 0;
}

.theme-icons svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* My forms rows: a checkbox at the far left, the card link, and a ⋮ menu at the
   top right. Checkbox and menu sit beside the link, not inside it, so the card
   stays one link and they stay real controls. */
.form-row {
  position: relative;
}

.form-row > .card-link {
  padding-right: calc(var(--irsc-control-height) + var(--irsc-space-4));
  padding-left: calc(var(--irsc-control-height) + var(--irsc-space-3));
}

/* A 44px tap target around a checkbox */
.check-cell {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--irsc-control-height);
  height: var(--irsc-control-height);
}

.check-cell input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
}

.row-check {
  position: absolute;
  top: var(--irsc-space-2);
  left: calc(var(--irsc-space-2) + 1px);
  z-index: 1;
}

.form-row > .row-menu {
  position: absolute;
  top: var(--irsc-space-2);
  right: var(--irsc-space-2);
}

/* Bulk bar over the list: Select all lines up with the row checkboxes */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-3);
  margin-bottom: var(--irsc-space-2);
}

.bulk-all {
  display: inline-flex;
  align-items: center;
  margin-left: calc(var(--irsc-space-2) + 1px);
  padding-right: var(--irsc-space-2);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
}

/* Drop-down menus (<details class="action-menu">): the ⋮ on a row, Actions on the bulk bar */
.action-menu {
  position: relative;
}

.action-menu > summary {
  list-style: none;
}

.action-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu__toggle {
  gap: var(--irsc-space-1);
}

.action-menu__dots {
  display: grid;
  place-items: center;
  width: var(--irsc-control-height);
  height: var(--irsc-control-height);
  border-radius: var(--irsc-radius-md);
  color: var(--irsc-text-muted);
}

.action-menu svg {
  flex: none;
}

.action-menu__dots svg {
  fill: currentColor;
}

.action-menu__dots:hover,
.action-menu[open] > .action-menu__dots {
  background: var(--irsc-accent-soft);
  color: var(--irsc-text);
}

.action-menu__list {
  position: absolute;
  top: calc(100% + var(--irsc-space-1));
  right: 0;
  z-index: 5;
  width: max-content;
  min-width: 10rem;
  padding: var(--irsc-space-1);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-2);
}

.bulk-bar .action-menu__list {
  right: auto;
  left: 0;
}

.action-menu__sep {
  margin: var(--irsc-space-1) 0;
  border: 0;
  border-top: 1px solid var(--irsc-border);
}

.action-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--irsc-control-height);
  padding: var(--irsc-space-2) var(--irsc-space-3);
  border: 0;
  border-radius: var(--irsc-radius-sm);
  background: transparent;
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.action-menu__item:hover {
  background: var(--irsc-accent-soft);
}

.action-menu__item--danger {
  color: var(--irsc-danger);
}

.action-menu__item--danger:hover {
  background: var(--irsc-danger-soft);
}

.class-card {
  margin-top: var(--irsc-space-3);
  box-shadow: none;
}

/* Response-rate bar: a <progress>, so the width needs no inline style */
.rate-bar {
  display: block;
  width: 100%;
  height: 0.5rem;
  margin-top: var(--irsc-space-3);
  overflow: hidden;
  border: 0;
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-border);
  color: var(--irsc-accent);
  appearance: none;
}

.rate-bar::-webkit-progress-bar {
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-border);
}

.rate-bar::-webkit-progress-value {
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-accent);
}

.rate-bar::-moz-progress-bar {
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-accent);
}

.rate-bar--inline {
  min-width: 4rem;
  margin: 0.4rem 0 0;
}

/* Browsers drop background fills on paper by default, and the bar is nothing but fills */
@media print {
  .rate-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- Results and summaries ---------- */

.block-q {
  margin-top: var(--irsc-space-4);
}

.block-q__title {
  margin: 0 0 var(--irsc-space-2);
}

.block-q .irsc-table-wrap {
  border-radius: var(--irsc-radius-md);
}

.block-table td {
  padding-block: var(--irsc-space-2);
}

.block-table .col-label {
  width: 55%;
}

.block-table .col-count {
  width: 10%;
}

.block-comments {
  margin: var(--irsc-space-2) 0 0;
  padding-left: var(--irsc-space-5);
}

.block-note {
  margin: var(--irsc-space-3) 0 0;
}

/* Answer sheet disclosure */
.sheet {
  margin-top: var(--irsc-space-5);
}

.sheet > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-2);
  min-height: var(--irsc-control-height);
  padding-inline: var(--irsc-space-3);
  border: 1px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  list-style: none;
}

.sheet > summary::-webkit-details-marker {
  display: none;
}

/* Chevron drawn with borders: points right when closed, down when open */
.sheet > summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-inline: 0.125rem 0.25rem;
  border-right: 2px solid var(--irsc-link);
  border-bottom: 2px solid var(--irsc-link);
  transform: rotate(-45deg);
  transition: transform var(--irsc-duration) var(--irsc-ease);
}

.sheet > .q-card {
  margin-top: var(--irsc-space-3);
}

.sheet[open] > summary::before {
  transform: translateY(-0.125rem) rotate(45deg);
}

/* Keep timestamps and addresses on one line; the wrapper scrolls sideways */
.sheet .irsc-table td:nth-child(-n + 2),
.history-table td:not(:last-child) {
  white-space: nowrap;
}

/* Question titles are long: let answer-sheet headers wrap instead of
   stretching one column across the page (the bundle keeps headers on one line) */
.sheet .irsc-table thead th {
  min-width: 10rem;
  max-width: 22rem;
  vertical-align: bottom;
  white-space: normal;
}

.sheet > summary:hover {
  border-color: var(--irsc-accent);
  background: var(--irsc-accent-soft);
}

.sheet[open] > summary {
  margin-bottom: var(--irsc-space-3);
}

/* ---------- Send ---------- */

/* Who each form goes to, in plain words; a form that cannot go is marked */
.send-targets {
  margin: 0 0 var(--irsc-space-5);
  padding: 0;
  list-style: none;
}

.send-targets li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  padding: var(--irsc-space-2) 0;
  border-bottom: 1px solid var(--irsc-border);
  color: var(--irsc-text-muted);
}

.send-targets li:first-child {
  padding-top: 0;
}

.send-targets strong {
  color: var(--irsc-heading);
}

.send-target--problem > span:not(.error) {
  color: var(--irsc-danger);
}

.send-who {
  margin: 0 0 var(--irsc-space-4);
  padding: 0;
  border: 0;
}

.send-who legend {
  margin-bottom: var(--irsc-space-1);
  padding: 0;
  color: var(--irsc-heading);
  font-weight: var(--irsc-weight-semibold);
}

/* Other addresses: a link until it is wanted, then one line */
.send-extra {
  margin-bottom: var(--irsc-space-5);
}

.send-extra__open {
  min-height: var(--irsc-control-height);
  padding: 0;
  border: 0;
  background: none;
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.send-extra__open:hover {
  color: var(--irsc-link-hover);
}

.send-extra input {
  max-width: 32rem;
}

.send-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-3) var(--irsc-space-5);
}

.send-note {
  margin: var(--irsc-space-4) 0 0;
  font-size: var(--irsc-text-sm);
}

.sent-headline {
  display: flex;
  align-items: center;
  gap: var(--irsc-space-2);
}

.sent-headline svg {
  flex: none;
  color: var(--irsc-success);
}

.sent-lines {
  margin-top: var(--irsc-space-4);
}

/* Answer sheet rows open one person's answers */
.sheet-hint {
  margin: var(--irsc-space-3) 0 var(--irsc-space-2);
}

.sheet-row {
  cursor: pointer;
}

.sheet-row:hover > td {
  background: var(--irsc-accent-soft);
}

/* One person's response */
.response-pager {
  display: flex;
  align-items: center;
  gap: var(--irsc-space-2);
  margin-left: auto;
}

.response-who {
  overflow-wrap: anywhere;
}

.answer-heading {
  margin: var(--irsc-space-6) 0 var(--irsc-space-1);
  font-size: var(--irsc-text-lg);
}

.answer-heading:first-child {
  margin-top: 0;
}

.answer {
  padding: var(--irsc-space-3) 0;
  border-bottom: 1px solid var(--irsc-border);
}

.answer:last-child {
  border-bottom: 0;
}

.answer__q {
  margin: 0 0 var(--irsc-space-1);
  color: var(--irsc-text-muted);
  font-weight: var(--irsc-weight-semibold);
}

.answer__a {
  margin: 0;
  color: var(--irsc-text);
  font-size: var(--irsc-text-lg);
  overflow-wrap: anywhere;
}

.answer__a .muted {
  font-size: var(--irsc-text-sm);
}

.answer__comment {
  margin: var(--irsc-space-2) 0 0;
  overflow-wrap: anywhere;
}

/* ---------- Summary tab (results dashboard) ---------- */

/* Agreement colors: a diverging pair, red for disagree and blue for agree, with a gray
   middle. Each arm steps by OKLCH lightness to match the other and was checked with the
   dataviz validator (monotone arms, colorblind-safe across the pair). Dark mode takes its
   own lighter steps, more-is-lighter, so the bars read on the navy cards. */
:root {
  --viz-1: #8b040d;
  --viz-2: #e4857b;
  --viz-3: #d4d3ce;
  --viz-4: #6da7ec;
  --viz-5: #003da5;
}

@media screen {
  :root[data-theme="dark"] {
    --viz-1: #ea9a91;
    --viz-2: #d7584f;
    --viz-3: #58606e;
    --viz-4: #3987e5;
    --viz-5: #86b6ef;
  }
}

@media screen and (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --viz-1: #ea9a91;
    --viz-2: #d7584f;
    --viz-3: #58606e;
    --viz-4: #3987e5;
    --viz-5: #86b6ef;
  }
}

/* The Summary page reads like an infographic: big figures first, then a colored tile per
   statement, then the detail one click away. Tile and highlight colors are the agreement
   tones; the text on each tone is white or ink, whichever clears 4.5:1 (checked in both
   themes). */
:root {
  --viz-ink-1: #ffffff;
  --viz-ink-2: #031229;
  --viz-ink-3: #031229;
  --viz-ink-4: #031229;
  --viz-ink-5: #ffffff;
}

@media screen {
  :root[data-theme="dark"] {
    --viz-ink-1: #031229;
    --viz-ink-2: #031229;
    --viz-ink-3: #ffffff;
    --viz-ink-4: #031229;
    --viz-ink-5: #031229;
  }
}

@media screen and (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --viz-ink-1: #031229;
    --viz-ink-2: #031229;
    --viz-ink-3: #ffffff;
    --viz-ink-4: #031229;
    --viz-ink-5: #031229;
  }
}

.tone-1 { background: var(--viz-1); color: var(--viz-ink-1); }
.tone-2 { background: var(--viz-2); color: var(--viz-ink-2); }
.tone-3 { background: var(--viz-3); color: var(--viz-ink-3); }
.tone-4 { background: var(--viz-4); color: var(--viz-ink-4); }
.tone-5 { background: var(--viz-5); color: var(--viz-ink-5); }
.stroke-1 { stroke: var(--viz-1); }
.stroke-2 { stroke: var(--viz-2); }
.stroke-3 { stroke: var(--viz-3); }
.stroke-4 { stroke: var(--viz-4); }
.stroke-5 { stroke: var(--viz-5); }

.stage.dash {
  width: min(80rem, 100% - 2 * var(--irsc-space-4));
  margin-top: var(--irsc-space-4);
}

.dash .form-bar {
  margin-bottom: var(--irsc-space-3);
}

/* The form bar in one row on wide pages: back, tabs, actions */
.form-bar--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 var(--irsc-space-5);
  padding-top: var(--irsc-space-1);
}

.form-bar--row .form-bar__back {
  align-self: center;
}

.form-bar--row .form-tabs {
  margin-top: 0;
}

.form-bar--row .form-bar__actions {
  align-self: center;
  padding: var(--irsc-space-1) 0;
}

@media (max-width: 49.99rem) {
  /* Phones: the back link and actions share the first line, tabs sit under them on the rule */
  .form-bar--row .form-tabs {
    order: 3;
    flex-basis: 100%;
  }
}

/* Headline: title and filter, then the figures */
.dash-hero {
  display: grid;
  gap: var(--irsc-space-3);
  margin-bottom: var(--irsc-space-3);
}

@media (min-width: 60rem) {
  .dash-hero {
    grid-template-columns: minmax(14rem, 1fr) minmax(0, 2.6fr);
    align-items: center;
  }
}

.dash-head {
  display: grid;
  gap: var(--irsc-space-1);
  min-width: 0;
}

.dash-title {
  margin: 0;
  overflow: hidden;
  font-size: var(--irsc-text-lg);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-early {
  justify-self: start;
  margin: 0;
  padding: 0 var(--irsc-space-2);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-surface-sunken);
  color: var(--irsc-text);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.8;
}

.dash-filter {
  display: flex;
  align-items: center;
  gap: var(--irsc-space-2);
  min-width: 0;
  color: var(--irsc-text-muted);
  font-weight: var(--irsc-weight-semibold);
}

.dash-filter select {
  width: 100%;
  min-width: 0;
  max-width: 22rem;
}

.figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: var(--irsc-space-2);
}

.fig {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: var(--irsc-space-1);
  min-width: 0;
  padding: var(--irsc-space-2) var(--irsc-space-3);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-1);
  text-align: center;
}

.fig p {
  margin: 0;
}

.fig__visual {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: end;
  width: 100%;
  min-height: 3.75rem;
}

.fig__value {
  color: var(--irsc-heading);
  font-family: var(--irsc-font-body);
  font-size: 1.75rem;
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.fig__unit {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

.fig__label {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.3;
}

.fig__meter {
  width: 80%;
  height: 0.375rem;
  margin-top: var(--irsc-space-1);
}

/* Half-circle gauge with the number on its base; ring with the number inside */
.gauge {
  width: 7rem;
  height: auto;
}

.gauge__track,
.gauge__fill,
.ring__track,
.ring__fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.gauge__track,
.ring__track {
  stroke: var(--irsc-surface-sunken);
}

.ring__fill {
  stroke: var(--viz-5);
}

.fig__visual--gauge .fig__value {
  position: absolute;
  bottom: -0.1rem;
}

.fig__visual--ring {
  place-items: center;
}

.ring {
  width: 4rem;
  height: 4rem;
}

.ring__track,
.ring__fill {
  stroke-width: 8;
}

.fig__visual--ring .fig__value {
  position: absolute;
  font-size: 1.05rem;
}

/* A small warning triangle beside the "to watch" count when it is above zero */
.fig__alert {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: var(--irsc-space-1);
  border-right: 0.5rem solid transparent;
  border-bottom: 0.85rem solid var(--viz-1);
  border-left: 0.5rem solid transparent;
  vertical-align: 0.15em;
}

/* Two columns on wide screens: the statements on the left, everything else on the right */
.dash-grid {
  display: grid;
  gap: var(--irsc-space-3);
  align-items: start;
}

.dash-main,
.dash-side {
  display: grid;
  gap: var(--irsc-space-3);
  align-content: start;
  min-width: 0;
}

@media (min-width: 60rem) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  }

  .dash-grid--plain {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-grid--plain .dash-side {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  }
}

.dash-panel {
  min-width: 0;
  padding: 0.625rem var(--irsc-space-4) var(--irsc-space-3);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-1);
}

.dash-panel__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--irsc-space-1) var(--irsc-space-3);
}

.dash-panel__title {
  margin: 0;
  font-size: var(--irsc-text-lg);
}

.dash-panel__note {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
}

/* A question title: two lines at most; hover shows the rest */
.dash-q {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: var(--irsc-text-base);
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.dash-n {
  margin: 0.125rem 0 var(--irsc-space-2);
  font-size: var(--irsc-text-sm);
}

/* Top strength / Needs attention */
.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--irsc-space-3);
}

.highlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "eyebrow score" "text score";
  align-items: center;
  gap: 0.125rem var(--irsc-space-3);
  padding: var(--irsc-space-2) var(--irsc-space-3) var(--irsc-space-2) var(--irsc-space-4);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-1);
  color: var(--irsc-text);
  text-decoration: none;
}

.highlight:hover {
  border-color: var(--irsc-accent);
}

.highlight__eyebrow {
  grid-area: eyebrow;
  display: flex;
  align-items: center;
  gap: var(--irsc-space-1);
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.highlight__icon {
  width: 0.75rem;
  height: 0.75rem;
}

.highlight__icon--star {
  background: var(--viz-5);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.highlight__icon--flag {
  background: var(--viz-1);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.highlight__text {
  grid-area: text;
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.highlight__score {
  grid-area: score;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: var(--irsc-text-lg);
  font-weight: var(--irsc-weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* Color key for the tiles */
.tone-key {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
}

.tone-key > span:first-child {
  margin-right: var(--irsc-space-1);
}

.tone-key__swatch {
  width: 1rem;
  height: 0.625rem;
}

.tone-key__swatch:nth-child(2) {
  border-radius: 3px 0 0 3px;
}

.tone-key__swatch:nth-child(6) {
  border-radius: 0 3px 3px 0;
}

.tone-key__swatch + span:not(.tone-key__swatch) {
  margin-left: var(--irsc-space-1);
}

.tone-key__words {
  margin-left: var(--irsc-space-2);
  font-weight: var(--irsc-weight-regular);
}

/* Parts and their statement tiles */
.part {
  margin-top: var(--irsc-space-2);
}

.part__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--irsc-space-2);
  margin: 0 0 var(--irsc-space-1);
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.part__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part__avg {
  flex: none;
  letter-spacing: 0;
  text-transform: none;
}

.part__avg strong {
  color: var(--irsc-heading);
  font-size: var(--irsc-text-sm);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
  gap: var(--irsc-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: grid;
  align-content: start;
  gap: 0.125rem;
  height: 100%;
  min-height: 3.9rem;
  padding: 0.375rem var(--irsc-space-2);
  border-radius: var(--irsc-radius-md);
  text-decoration: none;
  transition: transform var(--irsc-duration) var(--irsc-ease), box-shadow var(--irsc-duration) var(--irsc-ease);
}

.tile:hover {
  box-shadow: var(--irsc-shadow-2);
  transform: translateY(-1px);
}

.tile__score {
  font-size: 1.25rem;
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* How far along 1..5 the average sits: tiles in the same color band still differ */
.tile__meter {
  display: block;
  align-self: end;
  width: 100%;
  height: 0.25rem;
  margin-top: 0.125rem;
  fill: currentColor;
}

.tile__meter-track {
  opacity: 0.25;
}

.tile__text {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--irsc-text-xs);
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* The detail: the diverging agree/disagree chart, one click away */
.dash-detail {
  margin-top: var(--irsc-space-3);
  font-size: var(--irsc-text-sm);
}

.dash-detail > summary {
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  cursor: pointer;
}

.dash-detail > .lk-legend {
  margin: var(--irsc-space-2) 0 var(--irsc-space-1);
}

.lk-row--flash {
  animation: lk-flash 1.6s var(--irsc-ease);
}

@keyframes lk-flash {
  0%,
  40% {
    background: var(--irsc-accent-soft);
  }

  100% {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .lk-row--flash {
    transition: none;
    animation: none;
  }
}

/* Agreement chart rows (inside the detail) */
.lk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  margin: 0;
  padding: 0;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  list-style: none;
}

.lk-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-1);
}

.lk-swatch {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 2px;
}

.lk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "statement statement" "bar mean";
  align-items: center;
  gap: 0.125rem var(--irsc-space-2);
  padding: 0.125rem 0;
  border-bottom: 1px solid var(--irsc-border);
  scroll-margin-top: 5rem;
}

.lk-statement {
  grid-area: statement;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--irsc-text);
  font-size: var(--irsc-text-sm);
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.lk-bar {
  grid-area: bar;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: var(--irsc-space-1);
}

.lk-bar svg {
  display: block;
  width: 100%;
  height: 0.75rem;
  overflow: visible;
}

.lk-seg {
  stroke: var(--irsc-surface);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.lk-1 { fill: var(--viz-1); background: var(--viz-1); }
.lk-2 { fill: var(--viz-2); background: var(--viz-2); }
.lk-3 { fill: var(--viz-3); background: var(--viz-3); }
.lk-4 { fill: var(--viz-4); background: var(--viz-4); }
.lk-5 { fill: var(--viz-5); background: var(--viz-5); }

.lk-zero {
  stroke: var(--irsc-text-muted);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.lk-end {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lk-end--agree {
  color: var(--irsc-text);
  font-weight: var(--irsc-weight-semibold);
  text-align: left;
}

.lk-mean {
  grid-area: mean;
  min-width: 2.25rem;
  margin: 0;
  color: var(--irsc-heading);
  font-size: var(--irsc-text-sm);
  font-weight: var(--irsc-weight-semibold);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lk-row--head {
  display: none;
}

@media (min-width: 44rem) {
  .lk-row {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 2.25rem;
    grid-template-areas: "statement bar mean";
  }

  .lk-statement {
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lk-row--head {
    display: grid;
    padding: 0 0 0.125rem;
    border-bottom-color: var(--irsc-border-strong);
    color: var(--irsc-text-muted);
    font-size: var(--irsc-text-xs);
    font-weight: var(--irsc-weight-semibold);
  }

  .lk-row--head > span:first-child {
    grid-area: statement;
  }

  .lk-axis-labels {
    grid-area: bar;
    display: flex;
    justify-content: space-between;
    padding: 0 2.5rem;
  }

  .lk-row--head .lk-mean {
    color: var(--irsc-text-muted);
    font-size: var(--irsc-text-xs);
  }
}

/* Short single-choice questions read as a sentence over one stacked bar; the most
   chosen answer takes the accent, the rest stay gray */
.sentence {
  margin: var(--irsc-space-1) 0 var(--irsc-space-2);
  color: var(--irsc-text);
}

.sentence strong {
  color: var(--irsc-heading);
  font-size: var(--irsc-text-xl);
}

.stackbar {
  display: block;
  width: 100%;
  height: 0.875rem;
  overflow: visible;
}

.stackbar__seg {
  fill: var(--viz-3);
  stroke: var(--irsc-surface);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.stackbar__seg--lead {
  fill: var(--viz-5);
}

.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  margin: var(--irsc-space-2) 0 0;
  padding: 0;
  font-size: var(--irsc-text-xs);
  list-style: none;
}

.stack-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-1);
}

.stack-swatch {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 2px;
  background: var(--viz-3);
}

.stack-swatch--lead {
  background: var(--viz-5);
}

/* Other choices: one short bar per answer */
.dash-bars {
  display: grid;
  gap: 0.3rem;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 7.5rem) minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: var(--irsc-space-2);
  font-size: var(--irsc-text-sm);
}

.dash-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bar {
  height: 0.5rem;
  margin: 0;
}

.dash-bar-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* What people wrote: a quote card per question, all of them behind "Read all" */
.quote {
  margin: var(--irsc-space-2) 0 0;
  padding: var(--irsc-space-2) var(--irsc-space-3) var(--irsc-space-2) 2rem;
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface-sunken);
  position: relative;
}

.quote::before {
  content: "\201C";
  position: absolute;
  top: -0.15rem;
  left: 0.5rem;
  color: var(--viz-5);
  font-family: Georgia, serif;
  font-size: 2.25rem;
  line-height: 1;
}

.quote__text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--irsc-text);
  font-size: var(--irsc-text-sm);
  font-style: italic;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.quote__source {
  overflow: hidden;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-more {
  margin-top: var(--irsc-space-2);
  font-size: var(--irsc-text-sm);
}

.dash-more > summary {
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  cursor: pointer;
}

.dash-more__q {
  margin: var(--irsc-space-3) 0 var(--irsc-space-1);
  font-weight: var(--irsc-weight-semibold);
}

.dash-comments {
  display: grid;
  gap: var(--irsc-space-1);
  margin: 0;
  padding: 0;
  font-size: var(--irsc-text-sm);
  list-style: none;
}

.dash-comments li {
  padding: var(--irsc-space-1) var(--irsc-space-2);
  border-left: 3px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-sm);
  background: var(--irsc-surface-sunken);
  overflow-wrap: anywhere;
}

.dash-table {
  margin-top: var(--irsc-space-2);
}

.dash-table > summary {
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  cursor: pointer;
}

.dash-table > .irsc-table-wrap {
  margin-top: var(--irsc-space-2);
}

/* Dean view: where the numbers come from, and each class at a glance */
.dean-bar {
  padding-bottom: var(--irsc-space-2);
}

.dash-scope {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--irsc-text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-classes {
  display: grid;
  margin: var(--irsc-space-2) 0 0;
  padding: 0;
  list-style: none;
}

.dash-classes li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0 var(--irsc-space-3);
  padding: 0.3rem 0;
  border-top: 1px solid var(--irsc-border);
  font-size: var(--irsc-text-sm);
}

.dash-classes__current {
  margin: 0 calc(var(--irsc-space-2) * -1);
  padding-inline: var(--irsc-space-2) !important;
  border-radius: var(--irsc-radius-sm);
  background: var(--irsc-accent-soft);
}

.dash-classes__name {
  overflow: hidden;
  font-weight: var(--irsc-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-classes__n {
  color: var(--irsc-text-muted);
  font-variant-numeric: tabular-nums;
}

.dash-classes__stat {
  color: var(--irsc-heading);
  font-weight: var(--irsc-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.dash-classes__hidden {
  grid-column: 1 / -1;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
}

/* Hover numbers for bars and segments (app.js places it) */
.dash-tip {
  position: fixed;
  z-index: 50;
  max-width: 18rem;
  padding: var(--irsc-space-1) var(--irsc-space-2);
  border-radius: var(--irsc-radius-sm);
  background: var(--irsc-text);
  color: var(--irsc-surface);
  font-size: var(--irsc-text-sm);
  pointer-events: none;
}

/* Test term: the one address a test form goes to */
.test-email {
  display: block;
  width: min(100%, 24rem);
}

.email-preview {
  margin: 0;
  padding: var(--irsc-space-4);
  border-radius: var(--irsc-radius-md);
  background: var(--irsc-surface-sunken);
  font: inherit;
  white-space: pre-wrap;
}

.page-notice {
  margin: 0 0 var(--irsc-space-4);
}

/* ---------- Sign in ---------- */

.login {
  width: min(28rem, 100% - 2 * var(--irsc-space-4));
  margin: clamp(var(--irsc-space-5), 8vh, var(--irsc-space-8)) auto;
  padding: var(--irsc-space-5);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
  color: var(--irsc-text);
  box-shadow: var(--irsc-shadow-1);
}

@media (min-width: 30rem) {
  .login {
    padding: var(--irsc-space-6);
  }
}

.login h1 {
  margin: 0 0 var(--irsc-space-2);
}

.login .irsc-field,
.login .irsc-notice {
  margin-block: var(--irsc-space-4);
}

.login .irsc-btn {
  width: 100%;
}

/* ---------- Forced colors ---------- */

@media (forced-colors: active) {
  .hero-card,
  .q-card,
  .card-link,
  .action-menu__list,
  .login,
  .choice,
  .scale label,
  .chip {
    border: 1px solid CanvasText;
  }

  .choice:has(input:checked),
  .scale label:has(input:checked),
  .likert__option:has(input:checked),
  .combo-item.active {
    outline: 2px solid Highlight;
  }

  .rate-bar {
    forced-color-adjust: none;
    border: 1px solid CanvasText;
    background: Canvas;
  }

  .rate-bar::-webkit-progress-bar {
    background: Canvas;
  }

  /* Vendor pseudo-elements get separate rules: one unknown selector drops a whole list */
  .rate-bar::-webkit-progress-value {
    background: Highlight;
  }

  .rate-bar::-moz-progress-bar {
    background: Highlight;
  }
}

/* ---------- Settings (campus admins) ---------- */

/* The cog: bottom right on every admin page except the ones people fill in */
.settings-cog {
  position: fixed;
  right: max(var(--irsc-space-4), env(safe-area-inset-right));
  bottom: max(var(--irsc-space-4), env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--irsc-border-strong);
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-surface);
  box-shadow: var(--irsc-shadow-2);
  color: var(--irsc-text-muted);
}

.settings-cog svg {
  transition: transform 0.3s ease;
}

.settings-cog:hover,
.settings-cog:focus-visible {
  color: var(--irsc-heading);
}

.settings-cog:hover svg {
  transform: rotate(60deg);
}

.settings-cog[aria-current="page"] {
  border-color: var(--irsc-link);
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
}

@media (prefers-reduced-motion: reduce) {
  .settings-cog svg {
    transition: none;
  }
}

/* Room under the last thing on the page so the cog never covers it */
.has-cog main {
  padding-bottom: var(--irsc-space-7);
}

.settings-head h1 {
  margin: 0;
}

.settings-head__eyebrow {
  margin: 0;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-xs);
  font-weight: var(--irsc-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-tabs {
  flex-wrap: wrap;
  margin: var(--irsc-space-3) 0 var(--irsc-space-5);
  border-bottom: 1px solid var(--irsc-border);
}

.settings-figs {
  margin-bottom: var(--irsc-space-6);
}

.settings-figs .fig {
  align-content: center;
  min-height: 5.5rem;
}

.fig--link {
  color: inherit;
  text-decoration: none;
}

.fig--link:hover {
  border-color: var(--irsc-border-strong);
}

.fig--problem {
  border-color: var(--irsc-danger);
}

.settings-section {
  margin-bottom: var(--irsc-space-6);
}

.settings-section h2 {
  margin-bottom: var(--irsc-space-3);
  font-size: var(--irsc-text-lg);
}

.settings-note {
  margin: 0 0 var(--irsc-space-3);
  font-size: var(--irsc-text-sm);
}

/* One person (or one browser) per row: initial, who, where, and an action on the right */
.people {
  display: grid;
  gap: var(--irsc-space-2);
  margin: 0 0 var(--irsc-space-4);
  padding: 0;
  list-style: none;
}

.person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-4);
  padding: var(--irsc-space-3) var(--irsc-space-4);
  border: 1px solid var(--irsc-border);
  border-radius: var(--irsc-radius-lg);
  background: var(--irsc-surface);
}

.person p {
  margin: 0;
}

.person__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--irsc-radius-pill);
  background: var(--irsc-accent-soft);
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
}

.person__who {
  flex: 1 1 14rem;
  min-width: 0;
}

.person__name {
  font-weight: var(--irsc-weight-semibold);
  overflow-wrap: anywhere;
}

.person__where {
  flex: 2 1 18rem;
  min-width: 0;
}

.person__meta {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
  overflow-wrap: anywhere;
}

.person__act {
  flex: none;
  margin-left: auto;
}

.answering {
  display: grid;
  gap: var(--irsc-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.answering li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  padding: var(--irsc-space-2) 0;
  border-bottom: 1px solid var(--irsc-border);
}

.settings-ended {
  margin-bottom: var(--irsc-space-4);
}

.settings-ended summary {
  color: var(--irsc-link);
  font-weight: var(--irsc-weight-semibold);
  cursor: pointer;
}

.settings-ended ul {
  margin: var(--irsc-space-2) 0 0;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

.activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--irsc-space-2) var(--irsc-space-5);
  margin-bottom: var(--irsc-space-3);
}

.activity__when {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.activity__who,
.activity__notes {
  overflow-wrap: anywhere;
}

.activity__notes {
  color: var(--irsc-text-muted);
}

.irsc-table tbody tr.activity__problem > * {
  background: var(--irsc-danger-soft);
}

.activity-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--irsc-space-3);
  margin-top: var(--irsc-space-3);
}

/* Phones: each event reads as a short card instead of a wide table */
@media (max-width: 40rem) {
  .activity thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .activity tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 var(--irsc-space-3);
    padding: var(--irsc-space-2) var(--irsc-space-3);
    border-bottom: 1px solid var(--irsc-border);
  }

  .activity td {
    padding: 0;
    border: 0;
  }

  .activity td:nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  .activity__who {
    color: var(--irsc-text-muted);
  }

  /* The row carries the tint as one block; tinted cells would leave gaps between them */
  .irsc-table tbody tr.activity__problem {
    background: var(--irsc-danger-soft);
  }

  .irsc-table tbody tr.activity__problem > * {
    background: transparent;
  }

  .activity-filters .dash-filter {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .activity-filters select {
    flex: 0 1 15rem;
  }
}

@media print {
  .settings-cog {
    display: none;
  }
}

@media (forced-colors: active) {
  .settings-cog,
  .person {
    border: 1px solid CanvasText;
  }
}

/* ---------- Settings: People & access ---------- */

.settings-message {
  margin-bottom: var(--irsc-space-4);
}

.settings-message p {
  margin: 0;
}

.settings-message form {
  margin-top: var(--irsc-space-2);
}

/* Form on the left, the list on the right; stacked on narrower screens */
.access-layout {
  display: grid;
  gap: var(--irsc-space-6);
  align-items: start;
}

@media (min-width: 64rem) {
  .access-layout {
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  }
}

.grant-card h2,
.access-list h2 {
  margin-top: 0;
  font-size: var(--irsc-text-lg);
}

.grant-form,
.grant-confirm {
  display: grid;
  gap: var(--irsc-space-4);
  justify-items: start;
}

.grant-form .irsc-field,
.grant-levels,
.grant-form .irsc-input,
.grant-form .irsc-select {
  width: 100%;
  margin: 0;
}

.grant-levels .choice {
  margin: var(--irsc-space-2) 0 0;
}

.grant-levels .choice strong {
  display: block;
}

.choice__note {
  display: block;
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

/* Admin covers everything, so there is no area to pick */
.grant-form:has(input[name="level"][value="admin"]:checked) .grant-area {
  display: none;
}

.grant-until {
  max-width: 12rem;
}

.grant-confirm {
  grid-auto-flow: row;
}

.person--access {
  align-items: flex-start;
}

.person--access .grants {
  flex: 1 1 100%;
  display: grid;
  gap: var(--irsc-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.grant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-1) var(--irsc-space-3);
  padding-top: var(--irsc-space-2);
  border-top: 1px solid var(--irsc-border);
}

.grant__area {
  font-weight: var(--irsc-weight-semibold);
  overflow-wrap: anywhere;
}

.grant__when {
  color: var(--irsc-text-muted);
  font-size: var(--irsc-text-sm);
}

.grant__remove {
  margin-left: auto;
}

.grant--expired .grant__area {
  color: var(--irsc-text-muted);
  font-weight: normal;
  text-decoration: line-through;
}

/* ---------- Schedule tab: rules, class dates, the ones that need a look ---------- */

.sched__set .choice {
  align-items: baseline;
}

.sched__set .choice > span {
  line-height: 2.4;
}

/* A number or date typed inside a sentence ("open 14 days before") */
.num-inline,
.date-inline {
  display: inline-block;
  vertical-align: baseline;
}

.date-inline {
  width: auto;
  min-height: 2.25rem;
  margin: 0 var(--irsc-space-1);
  padding-block: 0;
}

.num-inline {
  width: 5.5rem;
  min-height: 2.25rem;
  margin: 0 var(--irsc-space-1);
  padding-block: 0;
  text-align: right;
}

.sched .sentence {
  display: block;
  font-weight: var(--irsc-weight-regular);
  line-height: 2.4;
}

.sched textarea {
  width: 100%;
}

.sched-figs {
  margin: var(--irsc-space-4) 0;
}

.look-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.look__flags {
  margin: var(--irsc-space-2) 0 0;
  padding-left: var(--irsc-space-5);
}

.look__flags > li + li {
  margin-top: var(--irsc-space-1);
}

.look__fix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-3);
  margin-top: var(--irsc-space-3);
  padding-top: var(--irsc-space-3);
  border-top: 1px solid var(--irsc-border);
}

.look__fix label {
  display: inline-flex;
  align-items: center;
  gap: var(--irsc-space-2);
  font-weight: var(--irsc-weight-semibold);
  white-space: nowrap;
}

.look__fix input[type="date"] {
  width: auto;
}

.sched-table td {
  vertical-align: top;
}

.sched-classes > summary {
  cursor: pointer;
  color: var(--irsc-link);
}

.sched-classes ul {
  margin: var(--irsc-space-2) 0 0;
  padding-left: var(--irsc-space-5);
}

.dash-pending {
  margin: var(--irsc-space-4) 0;
}

.dash-pending ul {
  margin: var(--irsc-space-2) 0 0;
  padding-left: var(--irsc-space-5);
}

/* ---------- Emails tab ---------- */

.emails__on {
  font-size: var(--irsc-text-lg);
}

.emails__from {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0 var(--irsc-space-4);
}

.email-card {
  margin: 0 0 var(--irsc-space-4);
  padding: 0;
  min-width: 0;
}

.email-card__head {
  display: flex;
  align-items: center;
  gap: var(--irsc-space-3);
}

.email-card__title {
  flex: 1 1 auto;
  font-family: var(--irsc-font-display);
  font-size: var(--irsc-text-lg);
  font-weight: var(--irsc-weight-semibold);
}

.email-card__sent {
  flex: none;
  font-size: var(--irsc-text-sm);
}

.email-card__when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2) var(--irsc-space-4);
  margin-top: var(--irsc-space-3);
}

.email-card__when label,
.email-card__timing {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--irsc-space-2);
}

.email-card__when select {
  width: auto;
}

.email-card textarea {
  width: 100%;
  font-family: var(--irsc-font-body);
}
