/*
 * Application styles.
 *
 * This file implements the design system. docs/rules/design-system.html is
 * the authority for tokens, classes and markup patterns;
 * docs/rules/design.md explains the rules behind them. Every class
 * defined here is listed in the design system's Class Reference -- add new
 * classes there too.
 *
 *   1. Fonts
 *   2. Tokens
 *   3. Bootstrap bridge (theme)
 *   4. Base
 *   5. Layout
 *   6. Components
 *   7. Utilities
 *   8. Settings
 *   9. Content Blocks (docs/application/content-blocks.md)
 *  10. Media
 *  11. Certificate card
 */

/* 1. Fonts -------------------------------------------------------------- */

/* Only 400 and 600 are loaded: use fw-normal / fw-semibold, never 500 or 700. */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/poppins/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/poppins/poppins-600.woff2") format("woff2");
}

/* 2. Tokens ------------------------------------------------------------- */

:root {
  --font-family-base:
    "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /*
   * Brand colours (themeable). These are the default Teal preset;
   * theme_style_tag() overrides them in every page head with the theme
   * chosen in Settings > Appearance (App\Core\Theme). Never hard-code a
   * brand hex value anywhere else.
   */
  --color-primary-900: #022a2b;
  /* navbar, dark surfaces */
  --color-primary-800: #044647;
  /* hover */
  --color-primary-700: #0f5d5f;
  /* primary actions, links, active states */
  --color-primary-rgb: 15, 93, 95;
  /* primary-700 as r, g, b for tints */
  --color-primary-800-rgb: 4, 70, 71;
  --color-accent-500: #a54b17;
  /* secondary emphasis, used sparingly */
  --color-accent-rgb: 165, 75, 23;

  /* Fixed colours (not themeable). */
  --color-warm-500: #ea9491;
  /* decorative highlight only, never an error */
  --color-background: #f8f6f3;
  /* page background */
  --color-surface: #ffffff;
  /* cards, tables, inputs, modals */
  --color-surface-subtle: #f8f6f3;
  /* panels inside a surface, table headers */
  --color-border: #dee2e6;
  --color-text: #212529;
  --color-text-muted: #595c5f;
  /* 4.5:1 or better on both backgrounds */
}

/* 3. Bootstrap bridge ----------------------------------------------------- */

/*
 * Bootstrap compiles its own blue into its variables. Pointing them at the
 * tokens makes Bootstrap's classes follow the chosen theme (text-bg-primary,
 * border-primary, links, btn-link, breadcrumbs, focus rings...).
 *
 * Custom properties resolve where they are declared, so .theme-scope repeats
 * the mapping on any element that sets its own --color-* values (the live
 * preview in Settings > Appearance).
 */
:root,
.theme-scope {
  --bs-font-sans-serif: var(--font-family-base);
  --bs-secondary-color: var(--color-text-muted);
  --bs-border-color: var(--color-border);
  --bs-primary: var(--color-primary-700);
  --bs-primary-rgb: var(--color-primary-rgb);
  --bs-primary-text-emphasis: var(--color-primary-800);
  --bs-primary-bg-subtle: rgba(var(--color-primary-rgb), 0.1);
  --bs-primary-border-subtle: rgba(var(--color-primary-rgb), 0.3);
  --bs-link-color: var(--color-primary-700);
  --bs-link-color-rgb: var(--color-primary-rgb);
  --bs-link-hover-color: var(--color-primary-800);
  --bs-link-hover-color-rgb: var(--color-primary-800-rgb);
  --bs-focus-ring-color: rgba(var(--color-primary-rgb), 0.25);
  --bs-code-color: var(--color-primary-900);
}

/* Components that compile colours into their own variables. */
.btn-primary {
  --bs-btn-bg: var(--color-primary-700);
  --bs-btn-border-color: var(--color-primary-700);
  --bs-btn-hover-bg: var(--color-primary-800);
  --bs-btn-hover-border-color: var(--color-primary-800);
  --bs-btn-active-bg: var(--color-primary-900);
  --bs-btn-active-border-color: var(--color-primary-900);
  --bs-btn-disabled-bg: var(--color-primary-700);
  --bs-btn-disabled-border-color: var(--color-primary-700);
  --bs-btn-focus-shadow-rgb: var(--color-primary-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--color-primary-700);
  --bs-btn-border-color: var(--color-primary-700);
  --bs-btn-hover-bg: var(--color-primary-700);
  --bs-btn-hover-border-color: var(--color-primary-700);
  --bs-btn-active-bg: var(--color-primary-800);
  --bs-btn-active-border-color: var(--color-primary-800);
  --bs-btn-disabled-color: var(--color-primary-700);
  --bs-btn-disabled-border-color: var(--color-primary-700);
  --bs-btn-focus-shadow-rgb: var(--color-primary-rgb);
}

.list-group {
  --bs-list-group-active-bg: var(--color-primary-700);
  --bs-list-group-active-border-color: var(--color-primary-700);
}

.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--color-primary-700);
}

.pagination {
  --bs-pagination-active-bg: var(--color-primary-700);
  --bs-pagination-active-border-color: var(--color-primary-700);
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(var(--color-primary-rgb), 0.25);
}

.form-check-input:checked {
  background-color: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.form-check-input:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary-700);
  box-shadow: 0 0 0 0.25rem rgba(var(--color-primary-rgb), 0.25);
}

.nav-link:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(var(--color-primary-rgb), 0.25);
}

.btn-close {
  --bs-btn-close-focus-shadow: 0 0 0 0.25rem rgba(var(--color-primary-rgb), 0.25);
}

/*
 * Not bridged yet because nothing uses them: form switches, ranges,
 * progress bars, nav pills, accordions. Bridge them here before first use.
 */

/* 4. Base ----------------------------------------------------------------- */

body {
  background-color: var(--color-background);
}

/* Bootstrap's heading weight (500) isn't loaded and falls back to 400. */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-weight: 600;
}

/*
 * Inline code tags (e.g. induction codes, certificate numbers, file paths).
 * Replaces Bootstrap's unstyled pink with a clean, theme-aware badge chip.
 */
code {
  font-family: var(--bs-font-monospace);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary-900);
  background-color: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.18);
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  letter-spacing: -0.01em;
  word-break: break-word;
}

a>code,
a code {
  color: inherit;
}

pre code {
  font-size: inherit;
  color: inherit;
  background-color: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

/* 5. Layout --------------------------------------------------------------- */

/* Top bar of the admin and inductee areas (admin-header.php, app-navbar.php). */
.app-navbar {
  --bs-navbar-color: rgba(255, 255, 255, 0.75);
  background-color: var(--color-primary-900);
}

.app-navbar .navbar-brand {
  min-width: 0;
  max-width: 16rem;
}

.app-navbar .nav-link.active {
  font-weight: 600;
}

/* The primary focus ring would vanish on the dark bar. */
.app-navbar .nav-link:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
}

/*
 * Admin layout (admin-header.php): the sticky top bar, then the sidebar
 * beside the page. From lg up the sidebar is a fixed-width column that
 * sticks below the top bar and scrolls on its own, so any number of
 * sections fits. Below lg the same markup is an offcanvas drawer
 * (.offcanvas-lg), opened from the top bar.
 */
.admin-shell {
  display: flex;
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 992px) {
  .admin-sidebar {
    flex: 0 0 15rem;
    position: sticky;
    top: 3.5rem;
    /* the top bar's height */
    align-self: flex-start;
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
  }
}

/* Sidebar navigation: group labels (Application, Core) and links. */
.admin-nav {
  width: 100%;
  padding: 1rem 0.75rem;
}

.admin-nav-group {
  margin: 1.25rem 0.75rem 0.375rem;
}

.admin-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--color-text);
}

.admin-nav .nav-link .bi {
  color: var(--color-text-muted);
}

.admin-nav .nav-link:hover {
  background-color: var(--color-surface-subtle);
  color: var(--color-text);
}

.admin-nav .nav-link.active {
  background-color: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary-700);
  font-weight: 600;
}

.admin-nav .nav-link.active .bi {
  color: inherit;
}

/* Company logo beside the company name in page headers. */
.brand-logo {
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

/* Title row at the top of every page: optional breadcrumb, title, subtitle, actions. */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.page-header .breadcrumb {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.page-title {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.page-subtitle {
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

/* Width cap for form, profile and detail pages. */
.page-narrow {
  max-width: 720px;
}

/* Centered column of the guest layout (log in, register, verify certificate). */
.container-guest {
  max-width: 420px;
}

/* 6. Components ----------------------------------------------------------- */

/*
 * Required-field marker: <label class="form-label required"> (or a legend).
 * The red asterisk is visual only (empty alt text); the control's required
 * attribute is what assistive technology announces. The first `content` is
 * the fallback for browsers without the alt-text syntax.
 */
.required::after {
  content: "*";
  content: "*" / "";
  margin-left: 0.2rem;
  color: var(--bs-danger);
}

/*
 * Field help in a tooltip: a small info button right after the label, for
 * forms where a line of help under every field is too much text. Its
 * aria-label is the help text, and the control points at it with
 * aria-describedby, so screen readers still read the help.
 */
.field-help {
  padding: 0 0.125rem;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--color-text-muted);
  vertical-align: baseline;
  background: none;
  border: 0;
  border-radius: 0.25rem;
}

.field-help:hover,
.field-help:focus-visible {
  color: var(--color-primary-700);
}

/*
 * Read-only fields on a record page without an edit form (Compliance Record,
 * Exam Attempt). Same fill as a disabled control, so the page doesn't read as
 * an editable form, but the value stays focusable and can be copied.
 */
.form-control[readonly] {
  background-color: var(--bs-secondary-bg);
}

/* Buttons at the end of a form: submit first, then Cancel. */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

/* A list table filling a card: .card.card-table > .table-responsive > .table */
.card-table {
  max-width: none;
}

.card-table>.table-responsive {
  border-radius: var(--bs-card-inner-border-radius);
}

/*
 * Scrollable table container: keeps overflow inside the table instead of the webpage.
 * Used when a table has many records, with sticky headers so column labels remain visible.
 */
.table-scrollable {
  max-height: calc(100vh - 16.5rem);
  min-height: 20rem;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--color-primary-rgb), 0.25) var(--color-surface-subtle);
}

.table-scrollable::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-scrollable::-webkit-scrollbar-track {
  background: var(--color-surface-subtle);
  border-radius: 4px;
}

.table-scrollable::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary-rgb), 0.25);
  border-radius: 4px;
}

.table-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary-rgb), 0.45);
}

/* Allow table page container to utilize full width without an artificial cap */
.container-xxl:has(.table-scrollable) {
  max-width: none;
}

.card-table .table {
  margin-bottom: 0;
  width: 100%;
  max-width: none;
  table-layout: auto;
}

.card-table .table> :not(caption)>*> :first-child {
  padding-left: 1rem;
}

.card-table .table> :not(caption)>*> :last-child {
  padding-right: 1rem;
}

.card-table .table>thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  --bs-table-bg: var(--color-surface-subtle);
  background-color: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--color-border);
}

.card-table .table>tbody>tr:last-child>* {
  border-bottom-width: 0;
}

/* Sortable column header link in a list table */
.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  transition: color 0.15s ease;
}

.table-sort-link:hover,
.table-sort-link:focus-visible {
  color: var(--color-primary-700);
  text-decoration: none;
}

.table-sort-link .bi {
  font-size: 0.75rem;
}

.table-sort-link.active {
  color: var(--color-primary-700);
  font-weight: 600;
}

/* A whole card that is a single link (dashboard shortcuts, Tools). */
.link-card {
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.link-card:hover,
.link-card:focus-visible {
  color: inherit;
  border-color: rgba(var(--color-primary-rgb), 0.5);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

/* A chart in a card: Chart.js fills the box, so the box sets the height. */
.chart-box {
  position: relative;
  height: 20rem;
}

/*
 * A square before each label in a ranked widget table, fading from the
 * primary colour (first row) to a light tint (last row). The view sets the
 * shade inline, since it depends on the row's place.
 */
.rank-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.5rem;
  vertical-align: -0.0625rem;
  border-radius: 0.1875rem;
}

/*
 * Scrollable table inside dashboard breakdown widget.
 * Matches .chart-box height (20rem) so the card doesn't stretch unevenly,
 * with sticky table headers so column headers remain visible during scroll.
 */
.dashboard-table-scrollable {
  max-height: 20rem;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--color-primary-rgb), 0.25) var(--color-surface-subtle);
}

.dashboard-table-scrollable::-webkit-scrollbar {
  width: 6px;
}

.dashboard-table-scrollable::-webkit-scrollbar-track {
  background: var(--color-surface-subtle);
  border-radius: 3px;
}

.dashboard-table-scrollable::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary-rgb), 0.25);
  border-radius: 3px;
}

.dashboard-table-scrollable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bs-card-bg, #fff);
  box-shadow: inset 0 -1px 0 var(--color-border);
}

/*
 * Company auto-suggest dropdown
 */
.company-suggestions-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  margin-top: 0.25rem;
  max-height: 16rem;
  overflow-y: auto;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
  scrollbar-width: thin;
}

.company-suggestions-menu .dropdown-item {
  cursor: pointer;
  white-space: normal;
  transition: background-color 0.1s ease;
}

.company-suggestions-menu .dropdown-item:hover,
.company-suggestions-menu .dropdown-item:focus,
.company-suggestions-menu .dropdown-item.active {
  background-color: var(--color-surface-subtle);
  color: var(--color-text);
}

.company-suggestions-menu mark {
  padding: 0;
  background-color: transparent;
  font-weight: 600;
  color: var(--color-primary-700);
}

/* 7. Utilities ------------------------------------------------------------ */

.bg-surface-subtle {
  background-color: var(--color-surface-subtle);
}

.border-dashed {
  border-style: dashed !important;
}

/* 8. Settings --------------------------------------------------------------- */

/* Company logo preview in Settings > General: a neutral drop area, whatever the theme. */
.logo-preview-box {
  width: 160px;
  height: 64px;
  background-color: var(--color-surface-subtle);
  border: 1px dashed var(--color-border);
}

.logo-preview-box img {
  max-width: 150px;
  max-height: 48px;
}

/* Notifications: "Remind [n] days before" input group. */
.reminder-days {
  max-width: 230px;
}

/* Email preview modal body. */
.email-preview-frame {
  height: 70vh;
}

/* Appearance: colour theme choices (radio + label). */
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.25rem;
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  background-color: var(--color-surface);
  cursor: pointer;
  text-align: center;
  height: 100%;
  /* equal tiles even when one has a "Default" note */
}

.theme-swatch-colors {
  display: flex;
  width: 100%;
  max-width: 64px;
  height: 24px;
  border-radius: 0.25rem;
  overflow: hidden;
}

.theme-swatch-colors span {
  flex: 1;
}

.theme-swatch:hover {
  border-color: var(--color-text-muted);
}

.theme-swatch-note {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  line-height: 1;
}

/* "Custom colours" option: one full-width row instead of a tile. */
.theme-swatch-row {
  flex-direction: row;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.theme-swatch-row .theme-swatch-colors {
  width: 64px;
  flex-shrink: 0;
}

.theme-swatch-row .theme-swatch-note {
  font-size: 0.8rem;
}

.theme-preview-header {
  background-color: var(--color-primary-900);
  min-height: 48px;
}

.btn-check:checked+.theme-swatch {
  border-color: var(--color-primary-700);
  box-shadow: 0 0 0 0.2rem rgba(var(--color-primary-rgb), 0.2);
}

.btn-check:focus-visible+.theme-swatch {
  outline: 2px solid var(--color-primary-700);
  outline-offset: 2px;
}

/* 9. Content Blocks ------------------------------------------------------- */

/*
 * Content Blocks reading canvas (docs/application/content-blocks.md #4).
 * .content-canvas caps media-width blocks (image/gallery/iframe) at 1024px;
 * .content-block-inner nests inside it to cap text-width blocks (text/alert)
 * at 700px. Both are plain centered max-widths. A slide's own width is the
 * canvas (.cb-slides-stage), so the same two widths apply inside a slide.
 */
.content-canvas {
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
}

.content-block-inner {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Image block layout variants (docs/application/content-blocks.md #3.1). */
.cb-image {
  display: block;
}

.cb-image.cb-align-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.cb-image.cb-align-right {
  margin-left: auto;
}

/*
 * Width presets: "full" spans the 1024px media canvas edge to edge;
 * "content" is a fixed 700px so the image lines up with paragraph text
 * width above/below it; "small"/"smaller" are canvas percentages. Below the
 * 576px breakpoint every preset except "full" collapses to 100% so a
 * "smaller" image never shrinks to an illegible size on a phone.
 */
.cb-image.cb-w-full {
  width: 100%;
}

.cb-image.cb-w-content {
  width: 700px;
  max-width: 100%;
}

.cb-image.cb-w-small {
  width: 50%;
}

.cb-image.cb-w-smaller {
  width: 35%;
}

@media (max-width: 576px) {

  .cb-image.cb-w-content,
  .cb-image.cb-w-small,
  .cb-image.cb-w-smaller {
    width: 100%;
  }
}

.cb-image img.cb-shape-rounded {
  border-radius: 0.5rem;
}

.cb-image img.cb-shape-square {
  border-radius: 0;
}

.cb-image img.cb-shape-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.cb-image img.cb-aspect-16-9 {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.cb-image img.cb-aspect-4-3 {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.cb-image img.cb-aspect-1-1 {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
}

/*
 * Slide title typography, shared by the Studio editor (as an <input>) and
 * the inductee page (as the real <h2>) so both read identically. Sized for
 * comfortable reading by adult/senior staff, larger than the app's general
 * fs-5/fs-6 body headings.
 */
.cb-heading-2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
}

/*
 * Blocks on a slide sit close together, the same in the Studio editor
 * (.cb-block) and on the inductee page (.content-block).
 */
.cb-block,
.content-block {
  margin-top: 1.5rem;
}

.cb-block:first-child,
.content-block:first-child {
  margin-top: 0;
}

/*
 * Rich text fields (text/alert content) may or may not contain
 * explicit <p> tags depending on how they were typed — give paragraphs
 * consistent spacing either way, and let a single bare line of text (no
 * wrapping tag at all) read like normal body copy via inherited styles.
 */
.content-block-inner p,
.cb-richtext p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.content-block-inner p:last-child,
.cb-richtext p:last-child {
  margin-bottom: 0;
}

/* Studio editor (docs/application/content-blocks.md #6). */
.cb-block {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.cb-block:hover,
.cb-block.active,
.cb-block.focused {
  background-color: rgba(var(--color-primary-rgb), 0.05);
}

/*
 * Block controls are a floating, borderless overlay that reserves no layout
 * space of its own (WYSIWYG canvas stays undisturbed) and only appears on
 * hover/focus, per product direction.
 */
.cb-block-controls {
  position: absolute;
  top: -0.9rem;
  right: 0.5rem;
  z-index: 2;
  display: flex;
  gap: 0.125rem;
  background: var(--color-surface);
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  padding: 0.15rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.cb-block:hover .cb-block-controls,
.cb-block.active .cb-block-controls,
.cb-block.focused .cb-block-controls,
.cb-block:focus-within .cb-block-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Minimum ~36px touch target (Fitts's law) with no visible border. */
.cb-block-controls .btn {
  border: none;
  background: transparent;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.95rem;
  border-radius: 0.375rem;
  color: var(--color-text-muted);
}

.cb-block-controls .btn:hover:not(:disabled) {
  background-color: var(--color-surface-subtle);
  color: var(--color-text);
}

.cb-block-controls .btn[data-remove]:hover {
  background-color: #f8d7da;
  color: #842029;
}

.cb-block-controls .btn:disabled {
  opacity: 0.3;
}

/*
 * Inline title/rich-text fields are styled to already look like their final
 * rendered form (heading size, no input chrome) so editing IS the preview —
 * no separate "preview mode" needed to see the real result.
 */
.cb-title-input,
.cb-richtext {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  padding: 0.15rem 0.35rem;
  margin: 0 -0.35rem;
}

.cb-title-input:focus,
.cb-richtext:focus {
  outline: none;
  background-color: rgba(var(--color-primary-rgb), 0.07);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.18);
}

.cb-title-input::placeholder {
  font-weight: 400;
  color: var(--color-text-muted);
  opacity: 1;
}

/* Exam Blocks Studio question text: a borderless textarea, like the title inputs. */
.cb-question-input {
  resize: vertical;
}

.cb-richtext {
  min-height: 2.25rem;
}

/*
 * Breathing room above the formatting toolbar so it never sits flush
 * against the field/heading above it (title input, alert box top edge),
 * and a clear gap below it before the editable text starts.
 */
.cb-richtext-toolbar {
  margin-top: 0.65rem;
  margin-bottom: 0.4rem;
}

.cb-richtext:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
}

/* Compact settings row for non-text fields (image/iframe/alert controls). */
.cb-settings-panel {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--color-border);
}

.cb-empty-media {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: 0.5rem;
}

.cb-raw-html-preview {
  background-color: var(--color-surface-subtle);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

/*
 * Slides (docs/application/content-blocks.md #5): the inductee
 * induction page and the Content Blocks Studio show one slide at a time.
 * On the inductee page the outline is always an offcanvas drawer, opened
 * from the slide bar, so the slide has the width to itself. In the Studio
 * (the layout has a .cb-slides-sidebar), from lg up the outline is a sticky
 * sidebar column beside the stage, and scrolls on its own; below lg the
 * same markup is a drawer (.offcanvas-lg), like the admin sidebar. The
 * stage keeps the 1024px canvas width.
 */
.cb-slides-layout {
  max-width: calc(1024px + 18.5rem);
  margin-left: auto;
  margin-right: auto;
  /* Room below the last slide for the fixed slide bar (.cb-slide-nav). */
  padding-bottom: 4.5rem;
}

/*
 * The page always shows its scrollbar, so moving between a short slide and
 * a long one never changes the page width and shifts the slide sideways.
 * On body (the browser applies it to the page), so Bootstrap's drawer and
 * modal can still hide it while open, and pad for it as usual.
 */
body:has(.cb-slides-layout) {
  overflow-y: scroll;
}

.cb-slides-stage {
  min-width: 0;
  max-width: 1024px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 992px) {
  .cb-slides-layout:has(> .cb-slides-sidebar) {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
  }

  .cb-slides-layout:has(> .cb-slides-sidebar) .cb-slides-stage {
    max-width: none;
    margin: 0;
  }

  .cb-slides-sidebar {
    position: sticky;
    top: var(--cb-sidebar-sticky-top, 1.5rem);
    max-height: calc(100vh - var(--cb-sidebar-sticky-top, 1.5rem) - 1.5rem);
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--color-surface);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow-sm);
  }

  /* Bootstrap makes an .offcanvas-lg body a flex row; stack its contents. */
  .cb-slides-sidebar .offcanvas-body {
    display: block;
  }
}

/*
 * Inductee page: the induction's title at the top of the outline drawer,
 * with the About button (modal with the description). It replaces the page
 * header, so the slide starts at the top of the screen.
 */
.cb-slides-induction {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding-bottom: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.cb-slides-induction-title {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

/* The outline: section links, their lecture links, and the current slide. */
.cb-slide-outline .cb-outline-section {
  margin-top: 0.75rem;
}

.cb-slide-outline .cb-outline-link,
.cb-slide-outline .cb-outline-items .cb-outline-link {
  padding: 0.3rem 0.5rem;
  border-radius: 0.375rem;
}

.cb-slide-outline .cb-outline-items {
  margin-left: 0.5rem;
  padding-left: 0.25rem;
}

.cb-slide-outline .cb-outline-link:hover {
  background-color: var(--color-surface-subtle);
}

.cb-slide-outline .cb-outline-link.active {
  background-color: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary-700);
  font-weight: 600;
}

/*
 * A slide: a card with its title (not a block) on the 700px text column,
 * lined up with the text blocks below it, then its blocks. A minimum height
 * keeps short slides from looking like fragments.
 */
.cb-slide {
  min-height: 60vh;
  scroll-margin-top: var(--cb-sidebar-sticky-top, 1.5rem);
}

.cb-slide>.card-body {
  padding: 1.5rem;
}

/*
 * Brand band along the top and bottom edge of a slide: the primary colour
 * with a slanted accent block, both from Settings > Appearance. The bottom
 * band is the top one turned half round, so its accent sits bottom right.
 */
.cb-slide-band {
  position: relative;
  flex-shrink: 0;
  height: 10px;
  overflow: hidden;
  background-color: var(--color-primary-700);
  border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0;
}

.cb-slide-band::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  background-color: var(--color-accent-500);
  transform: skewX(-18deg);
  transform-origin: left top;
}

.cb-slide-band-bottom {
  transform: rotate(180deg);
}

.cb-slide-header {
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

/*
 * Where the slide sits ("Section 2" on a section, its section's title on a
 * lecture), and an exam question's "Question 3 of 20" (§12).
 */
.cb-slide-eyebrow,
.exam-question-eyebrow {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.cb-slide-title {
  margin-bottom: 0;
}

.cb-slide-title:focus {
  outline: none;
}

/*
 * The floating bar at the bottom of the screen: the slide bar (Previous /
 * counter / Next) and the exam page's bar (§12). Above page content, below
 * Bootstrap's sticky top bar, drawers and modals.
 */
.cb-slide-nav,
.exam-bar {
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

.cb-slide-nav .btn,
.exam-bar .btn {
  white-space: nowrap;
}

/*
 * The slide bar is fixed, so it stays in the same place on every slide,
 * however short or long. Centred on the stage: the layout is centred on the
 * screen, so from lg up, beside the Studio's sidebar column, the bar is
 * centred on the part right of the column and gap (18.5rem).
 */
.cb-slide-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1rem;
  width: min(36rem, calc(100% - 2rem));
  margin: 0 auto;
}

@media (min-width: 992px) {
  .cb-slides-layout:has(> .cb-slides-sidebar) .cb-slide-nav {
    left: 18.5rem;
  }
}

.cb-slide-nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.cb-slide-counter,
.exam-bar-status {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/*
 * Exam Blocks Studio outline & teleport scroll
 * (docs/application/exams.md §3). Every teleport target gets
 * breathing room above it so a smooth-scroll landing never touches the
 * viewport edge.
 */
.cb-block {
  scroll-margin-top: 1.5rem;
}

/*
 * The Exam Blocks Studio's page layout. The question column is the centred
 * 720px .page-narrow column, like the exam page, with nothing beside it in
 * normal flow.
 *
 * .cb-content-area is a position:relative wrapper around the outline rail
 * and the column. The rail is position:absolute, top:0/bottom:0 within it,
 * so it starts level with the first question and spans the column's
 * height; the nav inside the rail sticks during scroll.
 *
 * Horizontally, the rail sits at calc(50% - 644px): half the column
 * (360px) + a 24px gap + the rail's own 260px, in the gutter centring
 * leaves empty. It fits once that gutter is wide enough (720 + 2 x 284 =
 * 1288px), so it shows from 1300px; narrower screens use the Exam Outline
 * button and its drawer.
 */
.cb-content-area {
  position: relative;
}

.cb-outline-sidebar-rail {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 644px);
  width: 260px;
}

/*
 * The nav sticks within the rail's top:0/bottom:0 span (see above), below
 * the Studio's sticky top bar (--cb-sidebar-sticky-top, see .cb-studio-main).
 */
.cb-outline-sidebar {
  position: sticky;
  top: var(--cb-sidebar-sticky-top, 1.5rem);
  max-height: calc(100vh - var(--cb-sidebar-sticky-top, 1.5rem) - 1.5rem);
  overflow-y: auto;
}

/* Both Studios' top bars are sticky (~4rem tall), so their sidebars and
   slides need a taller clearance than the inductee page's non-sticky navbar. */
.cb-studio-main {
  --cb-sidebar-sticky-top: 4.5rem;
}

@media (min-width: 1300px) {
  .cb-outline-sidebar-rail {
    display: block;
  }

  .cb-outline-toggle {
    display: none;
  }
}

.cb-outline-list .cb-outline-section {
  margin-top: 1.25rem;
}

.cb-outline-list .cb-outline-section:first-child {
  margin-top: 0;
}

.cb-outline-link {
  display: block;
  padding: 0.25rem 0;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 0.25rem;
}

.cb-outline-link:hover,
.cb-outline-link:focus {
  color: var(--color-primary-700);
}

.cb-outline-link-section {
  font-weight: 600;
}

.cb-outline-empty {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.cb-outline-items {
  margin-top: 0.125rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--color-border);
}

.cb-outline-items .cb-outline-link {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding: 0.2rem 0 0.2rem 0.6rem;
}

.cb-outline-items .cb-outline-link:hover,
.cb-outline-items .cb-outline-link:focus {
  color: var(--color-primary-700);
}

@keyframes teleport-highlight-pulse {
  0% {
    background-color: var(--color-warm-500);
  }

  100% {
    background-color: transparent;
  }
}

.teleport-highlight-pulse {
  animation: teleport-highlight-pulse 1.2s ease-out;
  border-radius: 0.5rem;
}

/*
 * Small type badge: Section or Lecture on the Content Blocks Studio's slide
 * toolbar (Studio only; the inductee page has no editorial labels). Reuses
 * the brand primary/accent tokens rather than introducing new colors, so
 * the two slide levels stay easy to tell apart at a glance.
 */
.cb-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.cb-type-badge-section {
  background-color: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary-700);
}

.cb-type-badge-lecture {
  background-color: rgba(var(--color-accent-rgb), 0.12);
  color: var(--color-accent-500);
}

/* Spinner icon shown on the Save button while a save request is in flight. */
@keyframes cb-spin {
  to {
    transform: rotate(360deg);
  }
}

.cb-spin {
  display: inline-block;
  animation: cb-spin 0.8s linear infinite;
}

/* 10. Media ------------------------------------------------------------- */

/* Media Library list thumbnail and grid tile (views/admin/media-library/index.php). */
.media-thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
}

.media-tile img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.media-tile .card-body {
  font-size: 0.75rem;
}

.media-tile .badge {
  font-size: 0.65rem;
}

.media-tile-select {
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
}

.media-tile-zoom {
  z-index: 2;
}

/* MediaPicker modal (assets/js/media-picker.js) -- reusable image picker
   used by the Content Blocks Studio editor's image/gallery blocks. */
.media-picker-grid {
  min-height: 6rem;
}

.media-picker-thumb {
  cursor: pointer;
  border: 2px solid transparent;
}

.media-picker-thumb img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.media-picker-thumb:hover {
  border-color: var(--color-border);
}

.media-picker-check {
  color: var(--color-primary-700);
  font-size: 1.25rem;
  background-color: var(--color-surface);
  border-radius: 50%;
  line-height: 1;
  opacity: 0;
}

.media-picker-thumb-selected {
  border-color: var(--color-primary-700);
}

.media-picker-thumb-selected .media-picker-check {
  opacity: 1;
}

.media-picker-dropzone {
  cursor: pointer;
}

/* 11. Certificate card ----------------------------------------------------- */

/*
 * The Certificate as a pocket-sized pass (views/partials/certificate-card.php):
 * an ID card, CR80 = 85.6 x 54 mm. The card is a size container and
 * everything inside is sized in cqw (1% of the card's width), so the same
 * layout scales from the larger on-screen preview down to the exact printed
 * size.
 *
 * Colours are the fixed neutral tokens only, never the Appearance theme, so
 * any company logo and any theme stay legible on the card.
 */
.cert-card {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 85.6 / 54;
  overflow: hidden;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3.7% / 5.9%;
  /* the 3.18 mm corners of a real card */
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.08);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.cert-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3cqw;
  padding: 2.6cqw 4.5cqw;
  background-color: var(--color-surface);
  border-bottom: 0.5cqw solid var(--color-text);
  color: var(--color-text);
}

.cert-card-brand {
  display: flex;
  align-items: center;
  gap: 2cqw;
  min-width: 0;
}

.cert-card-logo {
  height: 7cqw;
  width: auto;
  max-width: 26cqw;
  object-fit: contain;
}

.cert-card-company {
  overflow: hidden;
  font-size: 3.6cqw;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-card-kind {
  flex-shrink: 0;
  font-size: 2.3cqw;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Pages built around the card (public verification): exactly as wide as the card. */
.container-certificate {
  max-width: calc(560px + 1.5rem);
  /* the card + the container's side padding */
}

.cert-card-body {
  display: flex;
  flex: 1;
  gap: 4cqw;
  min-height: 0;
  padding: 4cqw 4.5cqw 3.6cqw;
}

.cert-card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.cert-card-holder {
  font-size: 5.4cqw;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cert-card-induction {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 1.2cqw;
  font-size: 3.3cqw;
  line-height: 1.3;
  color: var(--color-text-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Certificate number on its own row, then Issued / Expires side by side. */
.cert-card-details {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 1.2cqw 5cqw;
  margin: auto 0 0;
}

.cert-card-details>div:first-child {
  grid-column: 1 / -1;
}

.cert-card-details dt {
  font-size: 2.3cqw;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.cert-card-details dd {
  margin: 0.3cqw 0 0;
  font-size: 3cqw;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.cert-card-verify {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  width: 23cqw;
}

.cert-card-qr {
  width: 100%;
  aspect-ratio: 1;
}

.cert-card-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cert-card-verify-label {
  margin-top: 1cqw;
  font-size: 2.2cqw;
  line-height: 1.2;
  text-align: center;
  color: var(--color-text-muted);
}

/* Printing a certificate page prints only the card, at its real size, with a thin cut line. */
@media print {
  @page {
    margin: 12mm;
  }

  html,
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .cert-card,
  .cert-card * {
    visibility: visible;
  }

  .cert-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 85.6mm;
    max-width: none;
    border: 0.2mm solid #999;
    box-shadow: none;
  }
}

/* 12. Exams ---------------------------------------------------------------- */

/*
 * An exam question card (docs/application/exams.md §3–4): the
 * same markup and look on the inductee's exam page, the result page and in
 * the Exam Blocks Studio, so the Studio is a true preview. All three put the
 * cards in the centred .page-narrow column.
 */
.exam-questions {
  display: grid;
  gap: 1rem;
}

.exam-question>.card-body {
  padding: 1.5rem;
}

/*
 * On the exam page the eyebrow and question are the fieldset's <legend>.
 * Bootstrap floats legends so they sit inside the padding; keep that.
 */
.exam-question-legend {
  margin-bottom: 0;
  font-size: inherit;
}

.exam-question-text {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
}

.exam-question-diagram {
  display: block;
  margin-bottom: 1rem;
}

/*
 * Answer options, one bordered row each. On the exam page each row is the
 * <label> of its radio, so the whole row is the click target; the result
 * page and the Studio preview mark the correct and incorrect answers.
 * States always pair colour with an icon and words ("Your answer",
 * "Correct answer"), never colour alone.
 */
.exam-choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

.exam-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

label.exam-choice {
  cursor: pointer;
}

label.exam-choice:hover {
  border-color: rgba(var(--color-primary-rgb), 0.45);
  background-color: rgba(var(--color-primary-rgb), 0.04);
}

/* The selected answer: a 2px primary edge (the inset shadow adds 1px without moving the text). */
label.exam-choice:has(.exam-choice-radio:checked) {
  border-color: var(--color-primary-700);
  background-color: rgba(var(--color-primary-rgb), 0.08);
  box-shadow: inset 0 0 0 1px var(--color-primary-700);
}

label.exam-choice:has(.exam-choice-radio:focus-visible) {
  box-shadow:
    inset 0 0 0 1px var(--color-primary-700),
    0 0 0 0.25rem var(--bs-focus-ring-color);
}

/* Radio and icon markers, 20px, level with the first line of the text. */
.exam-choice-radio {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  cursor: pointer;
}

/* The row shows keyboard focus (above), so the radio needs no ring of its own. */
.exam-choice-radio:focus {
  box-shadow: none;
}

.exam-choice-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--color-text-muted);
}

/* Narrower than 10rem beside a note, the note drops to its own line instead. */
.exam-choice-text {
  flex: 1 1 10rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.exam-choice-note {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
}

.exam-choice.is-correct {
  border-color: var(--bs-success);
  background-color: var(--bs-success-bg-subtle);
}

.exam-choice.is-correct .exam-choice-icon {
  color: var(--bs-success);
}

.exam-choice.is-correct .exam-choice-note {
  color: var(--bs-success-text-emphasis);
}

.exam-choice.is-correct .exam-choice-radio:checked {
  background-color: var(--bs-success);
  border-color: var(--bs-success);
}

.exam-choice.is-incorrect {
  border-color: var(--bs-danger);
  background-color: var(--bs-danger-bg-subtle);
}

.exam-choice.is-incorrect .exam-choice-icon {
  color: var(--bs-danger);
}

.exam-choice.is-incorrect .exam-choice-note {
  color: var(--bs-danger-text-emphasis);
}

/* Studio: an option being edited, with its text as a borderless input. */
.exam-choice-edit {
  align-items: center;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.exam-choice-edit:focus-within {
  border-color: var(--color-primary-700);
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.exam-choice-edit .exam-choice-radio {
  margin-top: 0;
}

.exam-choice-input {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0;
  color: inherit;
  background: transparent;
  border: 0;
}

.exam-choice-input:focus {
  outline: none;
}

.exam-choice-remove {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.exam-explanation {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  background-color: var(--color-surface-subtle);
  border-radius: 0.5rem;
}

/*
 * Exam page: Cancel, the answered count and Submit Exam, in the slide bar's
 * look (§9). Sticky, so it stays in reach while scrolling through the
 * questions and rests under the last one.
 */
.exam-bar {
  position: sticky;
  bottom: 1rem;
  margin-top: 1.5rem;
}

/* May wrap onto two lines on a phone, so the buttons keep their size. */
.exam-bar-status {
  min-width: 0;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.exam-bar-status.is-complete {
  font-weight: 600;
  color: var(--bs-success-text-emphasis);
}

/*
 * Exam Blocks Studio: each question block is a question card, which shows
 * the hover and selected states in place of the block's own tint. An
 * outline, since the card's shadow-sm is !important.
 */
.cb-block[data-type="question"] {
  margin-top: 1rem;
  padding: 0;
}

.cb-block[data-type="question"]:first-child {
  margin-top: 0;
}

.cb-block[data-type="question"]:hover,
.cb-block[data-type="question"].active,
.cb-block[data-type="question"].focused {
  background-color: transparent;
}

.cb-block[data-type="question"]:hover .exam-question {
  outline: 1px solid rgba(var(--color-primary-rgb), 0.35);
}

.cb-block[data-type="question"].active .exam-question,
.cb-block[data-type="question"].focused .exam-question {
  outline: 2px solid var(--color-primary-700);
}