/*
 * U-QAS page styles on top of CraftAdmin.
 * Loaded after craftadmin.min.css. The page views keep their original markup
 * (main / pagetitle / section / card-title / info-card ...); this file gives
 * those classes the CraftAdmin look, so no id, name or JS hook had to change.
 */

/* ---- shell ------------------------------------------------------------------ */

/* The page area. Same box as CraftAdmin's .app-content, without its image
   resizing and overflow clipping: the scoring pages size the scan image
   themselves and the magnifier depends on that. */
.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--craftadmin-content-max);
  padding: var(--craftadmin-gutter);
  margin: 0 auto;
}

.topbar-title {
  overflow: hidden;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-heading-color);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title:hover {
  color: var(--bs-link-color);
}

.brand-logo {
  border-radius: 4px;
}

.user-menu .dropdown-header {
  white-space: normal;
}

/* ---- page title (CraftAdmin page-head / page-title) --------------------------- */

.pagetitle {
  /* was var(--craftadmin-gutter): title sat too far from the first card */
  margin-bottom: 1rem;
}

/* A title block with nothing in it (the dashboard) must not take up room:
   it used to add a second gutter between the top bar and the first card. */
.pagetitle:not(:has(*)) {
  display: none;
}

.pagetitle h1 {
  margin: 0;
  overflow-wrap: break-word;
  font-size: 1.75rem;
}

@media (max-width: 575.98px) {
  .pagetitle h1 {
    font-size: 1.5rem;
  }
}

/* ---- cards ---------------------------------------------------------------------- */

.main .card {
  margin-bottom: var(--craftadmin-gutter);
}

/* Same box as before: no padding above the card body, the title carries it.
   The views are written for this (pt-3, p-2 on their first row) and the scan
   magnifier measures from the top of the card. */
.main .card-body {
  padding: 0 1.25rem 1.25rem;
}

.main .card-title {
  padding: 1.25rem 0 .75rem;
  margin-bottom: 0;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-heading-color);
}

.main .card-title span {
  font-family: var(--bs-body-font-family);
  font-size: .875rem;
  font-weight: 400;
  color: var(--bs-secondary-color);
}

/* ---- dashboard / reports tiles (CraftAdmin stat tile) ------------------------------ */

.main .info-card {
  --craftadmin-accent-color: var(--craftadmin-maroon);
  border-top: 3px solid var(--craftadmin-accent-color);
}

/* tiles in one row end level with each other */
.main .info-card {
  height: calc(100% - var(--craftadmin-gutter));
}

.main .info-card.sales-card     { --craftadmin-accent-color: var(--craftadmin-maroon); }
.main .info-card.revenue-card   { --craftadmin-accent-color: var(--bs-success); }
.main .info-card.customers-card { --craftadmin-accent-color: var(--bs-warning); }

.main .info-card .card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.main .info-card .card-title {
  padding: 0;
  margin-bottom: .125rem;
  font-family: var(--bs-body-font-family);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.main .info-card .ps-3 {
  padding-left: 0 !important;
}

.main .info-card h6 {
  margin: 0;
  font-size: clamp(1.625rem, 1.25rem + 1.2vw, 2.125rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--bs-heading-color);
}

/* dashboard card menu (Last Month / Last 3 Month / Last Year), top right of its card */
.dashboard .filter {
  position: absolute;
  top: .75rem;
  right: 0;
}

.dashboard .filter .icon {
  padding: 0 1.25rem .25rem;
  font-size: 1rem;
  color: var(--bs-secondary-color);
}

.dashboard .filter .icon:hover,
.dashboard .filter .icon:focus {
  color: var(--bs-link-color);
}

.dashboard .filter .dropdown-header h6 {
  margin: 0;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---- tables: simple-datatables (.datatable) in CraftAdmin colours ------------------- */

.datatable-top,
.datatable-bottom {
  padding: .5rem 0;
  color: var(--bs-secondary-color);
}

/* a wide table scrolls inside its card instead of widening the page */
.main .datatable-container {
  overflow-x: auto;
}

.datatable-selector,
.datatable-input {
  padding: .25rem .625rem;
  font-size: .875rem;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.datatable-selector:focus,
.datatable-input:focus {
  border-color: var(--craftadmin-focus);
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(64, 64, 126, .2);
}

.datatable-table > thead > tr > th {
  white-space: normal;
  border-bottom: 2px solid var(--craftadmin-maroon);
}

/* room for the sort arrows beside the heading */
.datatable-sorter {
  padding-right: 1rem;
}

.datatable-table > tbody > tr > td,
.datatable-table > tbody > tr > th {
  vertical-align: middle;
}

.datatable-wrapper.no-header .datatable-container,
.datatable-wrapper.no-footer .datatable-container {
  border-color: var(--bs-border-color);
}

.datatable-sorter::before { border-top-color: currentcolor; }
.datatable-sorter::after  { border-bottom-color: currentcolor; }

.datatable-pagination a,
.datatable-pagination button {
  padding: .25rem .625rem;
  color: var(--bs-body-color);
  border-radius: var(--bs-border-radius);
}

.datatable-pagination a:hover,
.datatable-pagination button:hover {
  background-color: var(--bs-secondary-bg);
}

.datatable-pagination .datatable-active a,
.datatable-pagination .datatable-active a:focus,
.datatable-pagination .datatable-active a:hover,
.datatable-pagination .datatable-active button,
.datatable-pagination .datatable-active button:focus,
.datatable-pagination .datatable-active button:hover {
  color: #fff;
  background-color: var(--craftadmin-maroon);
}

table.datatable-table:focus {
  outline: 1px solid var(--craftadmin-focus);
}

table.datatable-table:focus tr.datatable-cursor > td:first-child {
  border-left-color: var(--craftadmin-focus);
}

/* Score Sheet (#example): the filter boxes DataTables puts in the header */
#example thead input {
  width: 100%;
  min-width: 4.5rem;
  padding: .125rem .375rem;
  font-family: var(--bs-body-font-family);
  font-size: .8125rem;
  font-weight: 400;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

/* Score Sheet: "Show n entries" and "Search" on one line each */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  margin: .75rem 0 .5rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  width: auto;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right;
}

/* Expert Review: the boxed Yes / No answer stays on one line */
.main .form-row > label.col-lg-1.border {
  min-width: 2.75rem;
  text-align: center;
}

/* ---- plain buttons on Generate Random Records (Verify / Show Summary) ------------------ */

#verify_id,
#go_id {
  padding: .375rem .875rem;
  font-weight: 700;
  color: var(--bs-body-color);
  vertical-align: top;
  background: var(--craftadmin-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

#verify_id:hover,
#go_id:hover {
  background: var(--bs-secondary-bg);
}

/* ---- back to top --------------------------------------------------------------------- */

.back-to-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 1040;
  width: 40px;
  height: 40px;
  visibility: hidden;
  background: var(--craftadmin-maroon);
  border-radius: 4px;
  opacity: 0;
  transition: all .4s;
}

.back-to-top i {
  font-size: 24px;
  line-height: 0;
  color: #fff;
}

.back-to-top:hover {
  color: #fff;
  filter: brightness(1.15);
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/* ---- dark theme: light-only utilities used in the page views ----------------------------- */

[data-bs-theme="dark"] .main .bg-light {
  background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] .main .text-dark:not(.badge) {
  color: var(--bs-body-color) !important;
}

/* ---- sign-in page ---------------------------------------------------------------------- */

.signin-card-wide {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  max-width: 68rem;
}

.signin-about {
  margin: 0 0 1.25rem;
  font-size: .9375rem;
}

.signin-about b {
  color: #fff;
}

.signin-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

.signin-features h5 {
  margin-bottom: .25rem;
  font-size: .9375rem;
  color: #fff;
}

.signin-features h5 > .bi,
.signin-workflow .bi {
  color: #f6a55e;
}

.signin-features ul {
  padding-left: 1.125rem;
}

.signin-subhead {
  margin: 1.5rem 0 .75rem;
  font-size: .9375rem;
  color: #fff;
}

.signin-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  text-align: center;
}

.signin-workflow .bi {
  font-size: 1.75rem;
  line-height: 1;
}

.signin-workflow p {
  margin: .375rem 0 0;
  font-size: .8125rem;
}

.signin-wordmark {
  max-width: 100%;
  height: 70px;
  padding: .375rem .625rem;
  background: #fff;
  border-radius: 4px;
}

.signin-links {
  padding-top: 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--bs-border-color);
}

.signin-links p {
  margin-bottom: .375rem;
}

.signin-links .bi {
  color: var(--bs-link-color);
}

@media (max-width: 767.98px) {
  .signin-card-wide {
    grid-template-columns: minmax(0, 1fr);
    max-width: 32rem;
  }

  .signin-card-wide .signin-form {
    order: -1;
  }
}

/* ---- full-page sign-in (CraftAdmin "auth" layout) ---------------------------------------------
   Two equal halves, each the full height of the window: About on the left, form on the right.
   The .signin-about / -features / -workflow / -wordmark / -links rules above are reused. */

.auth-uqas {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* -- about half: the kit's charcoal (the sidebar colour, #2a2c2f), lifted a little; one flat colour and solid
   tiles, no gradients or see-through layers (those made it look smoky) -- */

.auth-uqas .auth-brand {
  gap: 2rem;
  align-items: center;
  padding: 2.5rem clamp(1.25rem, 2.6vw, 2.75rem);
  color: #f1f2f4;
  background:
    var(--craftadmin-gradient) bottom left / 100% 4px no-repeat,
    #32353a;
}

.auth-uqas .auth-brand > * {
  width: 100%;
  max-width: 52rem;             /* fills the half; only a very wide screen leaves a margin */
}

.auth-uqas .auth-brand .brand-logo {
  background: #fff;
  border-radius: 4px;
}

.auth-uqas .auth-brand .brand-sub {
  color: #b9bec6;
}

.auth-uqas .auth-about h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.625rem, 2.2vw, 2rem);
}

.auth-uqas .auth-about h1::after {
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: .625rem;
  content: "";
  background: var(--craftadmin-gradient);
  border-radius: 2px;
}

/* the description reads as a lead paragraph */
.auth-uqas .signin-about {
  margin-bottom: 1.375rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #d0d4da;
}

/* features: four cards, two by two. Each card has its icon badge and title on one row and its
   two points under them. The markup is unchanged (h5 with an icon, then a ul). */
.auth-uqas .signin-features {
  gap: .875rem;
}

.auth-uqas .signin-features > div {
  padding: .8125rem 1rem;
  background: #3c4046;
  border: 1px solid #4b5058;
  border-top: 3px solid #f58920;
  border-radius: var(--bs-border-radius-lg);
}

.auth-uqas .signin-features h5 {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: .5rem;
  font-size: 1.0625rem;
}

.auth-uqas .signin-features h5 > .bi {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  background: #32353a;
  border-radius: 50%;
}

.auth-uqas .signin-features ul {
  padding: 0;
  margin: 0;
  font-size: .875rem;
  line-height: 1.6;
  color: #d0d4da;
  list-style: none;
}

.auth-uqas .signin-features li {
  position: relative;
  padding-left: 1.5rem;
}

/* a small tick in front of each point */
.auth-uqas .signin-features li::before {
  position: absolute;
  top: .0625rem;
  left: 0;
  font-family: "bootstrap-icons";
  font-size: 1rem;
  line-height: 1.4;
  color: #f6a55e;
  content: "\f26e";             /* bi-check */
}

.auth-uqas .signin-subhead {
  display: flex;
  gap: .875rem;
  align-items: center;
  margin: 1.375rem 0 .75rem;
  font-size: .75rem;
  color: #b9bec6;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.auth-uqas .signin-subhead::after {
  flex: 1 1 auto;
  height: 1px;
  content: "";
  background: #4b5058;
}

.auth-uqas .signin-features h5 > .bi,
.auth-uqas .signin-workflow .bi,
.auth-notice .bi {
  color: #f6a55e;
}

/* workflow: one bar in four numbered segments, read left to right */
.auth-uqas .signin-workflow {
  gap: 0;
  overflow: hidden;
  counter-reset: step;
  background: #3c4046;
  border: 1px solid #4b5058;
  border-radius: var(--bs-border-radius-lg);
}

.auth-uqas .signin-workflow > div {
  position: relative;
  padding: .875rem .5rem .75rem;
  counter-increment: step;
}

.auth-uqas .signin-workflow > div + div {
  border-left: 1px solid #4b5058;
}

/* the arrow that sits on each dividing line */
.auth-uqas .signin-workflow > div + div::before {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  font-family: "bootstrap-icons";
  font-size: .6875rem;
  color: #32353a;
  content: "\f285";             /* bi-chevron-right */
  background: #f6a55e;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.auth-uqas .signin-workflow .bi {
  font-size: 1.5rem;
}

.auth-uqas .signin-workflow p {
  margin-top: .375rem;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
  color: #f1f2f4;
}

.auth-uqas .signin-workflow p::before {
  display: block;
  margin-bottom: .125rem;
  font-size: .6875rem;
  font-weight: 400;
  color: #b9bec6;
  text-transform: uppercase;
  letter-spacing: .1em;
  content: "Step " counter(step);
}

.auth-notice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem 1rem;
  color: #d0d4da;
  background: #3c4046;
  border-left: 3px solid #f58920;
  border-radius: var(--bs-border-radius);
}

.auth-notice .bi {
  font-size: 1.125rem;
  line-height: 1.2;
}

/* -- form half: no card, the form sits on the page itself, copyright at the foot -- */

.auth-uqas .auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem clamp(1.25rem, 2.6vw, 2.75rem) 1.5rem;
  background:
    var(--craftadmin-surface);
}

.auth-uqas .auth-form {
  max-width: 42rem;
  margin: auto 0;
}

.auth-uqas .signin-wordmark {
  height: 84px;
}

.auth-heading {
  margin-bottom: .125rem;
  font-size: 2rem;
}

.auth-uqas .auth-form h5 {
  font-size: 1.125rem;
}

.auth-uqas .auth-form > .text-center {
  margin-bottom: 2rem !important;
}

.auth-uqas .auth-form .form-control,
.auth-uqas .auth-form .input-group-text,
.auth-uqas .auth-form .btn {
  min-height: 3rem;
}

.auth-uqas .auth-form .form-label {
  font-weight: 700;
}

.auth-uqas .auth-form .input-group-text {
  min-width: 3rem;
  justify-content: center;
}

.auth-uqas .auth-form .btn {
  margin-top: .5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .03em;
}

/* the two-line title, with a short accent rule under it */
.auth-uqas .auth-form > .text-center::after {
  display: block;
  width: 3rem;
  height: 3px;
  margin: 1rem auto 0;
  content: "";
  background: var(--craftadmin-gradient);
  border-radius: 2px;
}

.auth-uqas .signin-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem 1.5rem;
  padding-top: 1.25rem;
  margin-top: 2rem;
}

.auth-uqas .signin-links p {
  margin: 0;
  overflow-wrap: anywhere;
}

.auth-uqas .signin-links .bi {
  display: inline-block;
  width: 1.375rem;
}

.auth-foot {
  padding-top: 1.5rem;
  font-size: .8125rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

/* a short laptop window: both halves tighten so the page still fits without scrolling */
@media (min-width: 992px) and (max-height: 820px) {
  .auth-uqas .auth-brand {
    gap: 1.25rem;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .auth-uqas .auth-about h1 {
    margin-bottom: .625rem;
  }

  .auth-uqas .signin-about {
    margin-bottom: 1rem;
  }

  .auth-uqas .signin-features {
    gap: .625rem;
  }

  .auth-uqas .signin-features > div {
    padding: .625rem .875rem;
  }

  .auth-uqas .signin-features h5 {
    margin-bottom: .375rem;
    font-size: 1rem;
  }

  .auth-uqas .signin-features h5 > .bi {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .auth-uqas .signin-features ul {
    font-size: .8125rem;
    line-height: 1.5;
  }

  .auth-uqas .signin-subhead {
    margin: 1rem 0 .625rem;
  }

  .auth-uqas .auth-about h1::after {
    margin-top: .5rem;
  }

  .auth-uqas .signin-about {
    font-size: 1rem;
    line-height: 1.55;
  }

  .auth-notice {
    padding: .5rem .875rem;
  }

  .auth-uqas .auth-form > .text-center::after {
    margin-top: .625rem;
  }

  .auth-uqas .signin-workflow > div {
    padding: .625rem .375rem .5rem;
  }

  .auth-uqas .signin-workflow .bi {
    font-size: 1.25rem;
  }

  .auth-uqas .signin-workflow p {
    font-size: .8125rem;
  }

  .auth-uqas .auth-panel {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
  }

  .auth-uqas .signin-wordmark {
    height: 70px;
  }

  .auth-uqas .auth-form > .text-center {
    margin-bottom: 1.25rem !important;
  }

  .auth-uqas .signin-links {
    padding-top: 1rem;
    margin-top: 1.25rem;
  }

  .auth-foot {
    padding-top: 1rem;
  }
}

/* a 1366x768 or 1280x720 laptop: after the browser's own bars only about 630-680px of height
   is left, so everything tightens once more */
@media (min-width: 992px) and (max-height: 745px) {
  .auth-uqas .auth-brand {
    gap: .75rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .auth-uqas .auth-about h1 {
    margin-bottom: .5rem;
    font-size: 1.5rem;
  }

  .auth-uqas .auth-about h1::after {
    margin-top: .375rem;
  }

  .auth-uqas .signin-about {
    margin-bottom: .75rem;
    font-size: .9375rem;
    line-height: 1.5;
  }

  .auth-uqas .signin-features {
    gap: .5rem;
  }

  .auth-uqas .signin-features > div {
    padding: .5rem .75rem;
  }

  .auth-uqas .signin-features h5 {
    gap: .5rem;
    margin-bottom: .25rem;
    font-size: .9375rem;
  }

  .auth-uqas .signin-features h5 > .bi {
    width: 1.75rem;
    height: 1.75rem;
    font-size: .875rem;
  }

  .auth-uqas .signin-features ul {
    line-height: 1.4;
  }

  .auth-uqas .signin-subhead {
    margin: .75rem 0 .5rem;
  }

  .auth-uqas .signin-workflow > div {
    padding: .5rem .375rem .375rem;
  }

  .auth-uqas .signin-workflow .bi {
    font-size: 1.125rem;
  }

  .auth-uqas .signin-workflow p {
    margin-top: .125rem;
  }

  .auth-notice {
    padding: .375rem .75rem;
    font-size: .8125rem;
  }

  .auth-uqas .auth-panel {
    padding-top: 1rem;
    padding-bottom: .75rem;
  }

  .auth-uqas .signin-wordmark {
    height: 56px;
  }

  .auth-heading {
    font-size: 1.625rem;
  }

  .auth-uqas .auth-form > .text-center {
    margin-bottom: .875rem !important;
  }

  .auth-uqas .auth-form .form-control,
  .auth-uqas .auth-form .input-group-text,
  .auth-uqas .auth-form .btn {
    min-height: 2.625rem;
  }

  .auth-uqas .auth-form form {
    gap: .75rem !important;
  }

  .auth-uqas .signin-links {
    padding-top: .75rem;
    margin-top: 1rem;
  }

  .auth-foot {
    padding-top: .75rem;
  }
}

/* a narrow laptop or a tablet on its side: each half is only about 500px wide */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .auth-uqas .auth-brand {
    gap: 1rem;
    padding: 1.5rem 1.75rem;
  }

  .auth-uqas .signin-about {
    margin-bottom: 1rem;
    font-size: .9375rem;
    line-height: 1.5;
  }

  .auth-uqas .signin-features {
    gap: .5rem;
  }

  .auth-uqas .signin-features > div {
    padding: .5rem .75rem;
  }

  .auth-uqas .signin-features h5 {
    gap: .5rem;
    font-size: .9375rem;
  }

  .auth-uqas .signin-features h5 > .bi {
    width: 1.75rem;
    height: 1.75rem;
    font-size: .875rem;
  }

  .auth-uqas .signin-workflow p {
    font-size: .8125rem;
  }
}

/* Below 992px the two halves stack. The kit keeps only the logo of the about panel there;
   U-QAS keeps all of it, under the form, so nothing on the page is lost on a phone. */
@media (max-width: 991.98px) {
  .auth-uqas {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .auth-uqas .auth-panel {
    order: -1;
    padding-top: 2.5rem;
    padding-bottom: 2rem;
  }

  .auth-uqas .auth-brand {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .auth-uqas .auth-brand > .auth-about {
    display: block;
  }

  .auth-uqas .auth-brand > .auth-notice {
    display: flex;
  }
}

@media (max-width: 575.98px) {
  .auth-uqas .signin-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-uqas .signin-workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* two by two on a phone: a line under the first row, arrows only inside a row */
  .auth-uqas .signin-workflow > div:nth-child(-n+2) {
    border-bottom: 1px solid #4b5058;
  }

  .auth-uqas .signin-workflow > div:nth-child(odd) {
    border-left: 0;
  }

  .auth-uqas .signin-workflow > div:nth-child(odd)::before {
    display: none;
  }

  .auth-uqas .signin-features {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================================
   CARDS, BOXES AND TABLES IN THE CRAFTADMIN MANNER
   The views still carry their original markup, so the kit's own classes (card-accent-brand,
   chip, stat, table-card ...) cannot be put on the elements. These rules give the existing
   elements the same treatment. Nothing here changes where the scan image sits.
   ========================================================================================== */

/* ---- cards: a section card gets the kit's brand line and a header rule (card-accent-brand,
        card-header). Only cards that have a title; stat tiles keep their own coloured edge. -- */

.main .card:has(> .card-body > .card-title):not(.info-card) {
  background-image: var(--craftadmin-gradient);
  background-repeat: no-repeat;
  background-size: 100% 3px;
}

.main .card:not(.info-card) > .card-body > .card-title {
  padding: 1.125rem 0 .75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

/* the date range beside a title, as a kit chip */
.main .card:not(.info-card) > .card-body > .card-title > span {
  display: inline-block;
  padding: .125rem .5rem;
  margin-left: .5rem;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: middle;
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 2px;
}

/* ---- dashboard: Review Status ---------------------------------------------------------------
   The two totals read as stat tiles; each reviewer is a pair of lines in a ruled list. */

.dashboard .card-body > .row:has(> label.col-lg-3) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
  margin: 0;
}

.dashboard .card-body > .row:has(> label.col-lg-3) > label {
  width: auto;
  padding: 0 1rem;
  background: var(--bs-tertiary-bg);
  border-left: 3px solid var(--craftadmin-maroon);
}

.dashboard .card-body > .row:has(> label.col-lg-3) > label:nth-child(3),
.dashboard .card-body > .row:has(> label.col-lg-3) > label:nth-child(4) {
  border-left-color: var(--craftadmin-orange);
}

/* the two captions on the first line ... */
.dashboard .card-body > .row:has(> label.col-lg-3) > label:nth-child(odd) {
  grid-row: 1;
  padding-top: .75rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ... and the two figures under them */
.dashboard .card-body > .row:has(> label.col-lg-3) > label:nth-child(even) {
  grid-row: 2;
  padding-bottom: .75rem;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--bs-heading-color);
}

.dashboard .card-body > .row:has(> label.col-lg-4) {
  align-items: center;
  margin: 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.dashboard .card-body > .row:has(> label.col-lg-4) > label {
  flex: 1 1 50%;
  width: 50%;
  padding: .4375rem .75rem;
}

.dashboard .card-body > .row:has(> label.col-lg-4) > label:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* the "Reviewer ID" line heads each pair */
.dashboard .card-body > .row:has(> label.col-lg-4):nth-of-type(even) {
  background: var(--bs-tertiary-bg);
}

/* ---- admin dashboard: balanced layout ---------------------------------------------------------
   As written the page is an 8/4 split: a short Review Status card and a tall External Expert
   card on the left, and on the right three 400px charts stacked in a 720px scrolling box.
   For the admin view (the one whose first card has the duration menu, .filter) the three
   cards run full width, one under the other, and each lays its contents out side by side.
   The charts are drawn after this CSS applies, so they take the new sizes. Markup untouched. */

@media (min-width: 768px) {

  /* Review Status: totals on top, then one tile per reviewer.
     A tile is two cells of the grid side by side: the reviewer's ID on the left and the
     participants assigned on the right, each with its caption above its value. Tiles wrap
     onto further lines, two to a line here and more on wider screens, so any number of
     reviewers fits and no word or ID is ever broken across lines. */
  .dashboard .card:has(> .filter) > .card-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 2fr) minmax(0, 3fr));
    column-gap: 0;
    row-gap: .75rem;
  }

  .dashboard .card:has(> .filter) > .card-body > .card-title,
  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-3) {
    grid-column: 1 / -1;
  }

  .dashboard .card:has(> .filter) > .card-body > .card-title {
    margin-bottom: .25rem;
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-3) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: .25rem;
  }

  .dashboard .card:has(> .filter) > .card-body > br {
    display: none;
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4) {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    min-width: 0;
    padding: .625rem .875rem;
    border: 1px solid var(--bs-border-color);
  }

  /* left half: Reviewer ID */
  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(even) {
    background: var(--bs-tertiary-bg);
    border-right: 0;
    border-left: 3px solid var(--craftadmin-navy);
    border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
  }

  /* right half: Participants assigned */
  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(odd) {
    margin-right: .75rem;
    background: none;
    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
  }

  /* the last tile on a line has no gap after it (two tiles = four cells a line) */
  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(4n+1) {
    margin-right: 0;
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4) > label {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;          /* never "GR0" on one line and "1" on the next */
    overflow-wrap: normal;
    word-break: normal;
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4) > label:first-child {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
    white-space: normal;          /* a long caption may take two lines, on whole words */
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4) > label:last-child {
    font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--bs-heading-color);
  }
}

/* three tiles to a line */
@media (min-width: 1200px) {
  .dashboard .card:has(> .filter) > .card-body {
    grid-template-columns: repeat(3, minmax(0, 2fr) minmax(0, 3fr));
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(4n+1) {
    margin-right: .75rem;
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(6n+1) {
    margin-right: 0;
  }
}

/* four tiles to a line */
@media (min-width: 1700px) {
  .dashboard .card:has(> .filter) > .card-body {
    grid-template-columns: repeat(4, minmax(0, 2fr) minmax(0, 3fr));
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(6n+1) {
    margin-right: .75rem;
  }

  .dashboard .card:has(> .filter) > .card-body > .row:has(> label.col-lg-4):nth-of-type(8n+1) {
    margin-right: 0;
  }
}

@media (min-width: 992px) {

  .dashboard > .row:has(> .col-lg-8 .filter) > .col-lg-8,
  .dashboard > .row:has(> .col-lg-8 .filter) > .col-lg-4 {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

  /* every role: the side column is as tall as its chart, not a 720px scrolling box */
  .dashboard > .row > .col-lg-4[style*="720px"] {
    height: auto !important;
    overflow: visible !important;
  }

  /* External Expert: the two charts side by side, each half the card */
  .dashboard #expert_status,
  .dashboard #barChart {
    flex: 0 0 50%;
    width: 50% !important;
    min-height: 320px !important;
  }

  /* the pie is drawn at 60% of the smaller side of its box, so in a wide, short box it came
     out much smaller than the bar chart beside it. A taller box brings the two level. */
  .dashboard #expert_status {
    min-height: 350px !important;
  }

  .dashboard #barChart {
    align-self: center;
  }

  /* Reviewer's Status: the three reviewers side by side */
  .dashboard > .row:has(> .col-lg-8 .filter) > .col-lg-4 > .card > .card-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: minmax(0, 1fr);
    column-gap: 1.25rem;
    padding-bottom: 1.25rem !important;
  }

  .dashboard > .row:has(> .col-lg-8 .filter) > .col-lg-4 > .card > .card-body > .card-title {
    grid-column: 1 / -1;
  }

  .dashboard > .row:has(> .col-lg-8 .filter) > .col-lg-4 > .card > .card-body > .col-lg-6 {
    grid-row: 2;
    width: auto;
    padding: .5rem .875rem;
    font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-weight: 600;
    color: var(--bs-heading-color);
    text-align: center;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-top: 3px solid var(--craftadmin-navy);
    border-bottom: 0;
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
  }

  .dashboard > .row:has(> .col-lg-8 .filter) > .col-lg-4 > .card > .card-body > .echart {
    grid-row: 3;
    min-height: 420px !important;   /* room for a two-line legend above the ring */
    border: 1px solid var(--bs-border-color);
    border-top: 0;
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
  }
}

/* ---- the scoring panel and its arrows -------------------------------------------------------- */

.main #scan_score .bg-light,
.main #question_panel {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

/* previous / next image: a bordered button instead of a bare arrow */
.main a[alt="previous"],
.main a[alt="next"],
.main a[alt="left"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  min-height: 2.5rem;
  background: var(--craftadmin-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: background-color .15s, border-color .15s;
}

.main a[alt="previous"]:hover,
.main a[alt="next"]:hover,
.main a[alt="left"]:hover {
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
}

/* ---- tables ------------------------------------------------------------------------------------
   From 768px up. Below that the lists are cards (see the phone block), and these rules stay out
   of their way. */
@media (min-width: 768px) {

  /* the table sits in a ruled box with a tinted header band, like the kit's table in a card */
  .main .datatable-container {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
  }

  .main .datatable-table {
    margin-bottom: 0;
    font-size: .875rem;
  }

  .main .datatable-table > thead > tr > th,
  .main #example > thead > tr > th,
  .main .card .table:not(.table-borderless) > thead > tr > th {
    padding-top: .625rem;
    padding-bottom: .625rem;
    font-size: .8125rem;
    color: var(--bs-heading-color);
    vertical-align: middle;
    background: var(--bs-tertiary-bg);
  }

  .main .datatable-table > thead > tr > th .datatable-sorter {
    color: inherit;
  }

  /* thirteen columns have to fit a laptop: tight sides, and less room kept for the sort arrows */
  .main .datatable-table > :not(caption) > * > * {
    padding-right: .4375rem;
    padding-left: .4375rem;
  }

  .main .datatable-table > :not(caption) > * > :first-child {
    padding-left: .75rem;
  }

  .main .datatable-table > :not(caption) > * > :last-child {
    padding-right: .75rem;
  }

  .main .datatable-table .datatable-sorter {
    padding-right: .75rem;
  }

  /* quiet zebra and a clear hover */
  .main .datatable-table > tbody > tr:nth-child(even) > *,
  .main #example > tbody > tr:nth-child(even) > * {
    background-color: rgba(var(--bs-emphasis-color-rgb), .025);
  }

  .main .datatable-table > tbody > tr:hover > *,
  .main #example > tbody > tr:hover > * {
    background-color: var(--bs-primary-bg-subtle);
  }

  .main .datatable-table > tbody > tr:last-child > *,
  .main #example > tbody > tr:last-child > * {
    border-bottom-width: 0;
  }

  /* the link that opens a record (first column) */
  .main .datatable-table > tbody > tr > td:first-child > a {
    display: inline-block;
    min-width: 2rem;
    padding: .0625rem .5rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: var(--bs-primary-bg-subtle);
    border-radius: 2px;
  }

  .main .datatable-table > tbody > tr > td:first-child > a:hover {
    color: #fff;
    background: var(--craftadmin-maroon);
  }

  /* buttons inside a row are row-sized */
  .main .datatable-table > tbody > tr > td > .btn,
  .main .datatable-table > tbody > tr > th > .btn {
    padding: .1875rem .75rem;
    font-size: .875rem;
  }

  /* Score Sheet: the footer repeats the headings, so it is quieter than the header */
  .main #example > tfoot > tr > th {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
    background: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
    border-bottom: 0;
  }

  .main #example > thead > tr > th {
    white-space: normal;
  }
}

/* ---- table tools: page size, search, count and pages (any width) ---------------------------- */

.main .datatable-top {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .25rem 0 .875rem;
}

.main .datatable-top::after,
.main .datatable-bottom::after {
  display: none;              /* the library's float clearfix; these bars are flex now */
}

.main .datatable-top > div {
  float: none;
}

.main .datatable-selector,
.main .datatable-input {
  min-height: 2.25rem;
  padding: .3125rem .75rem;
  font-size: .9375rem;
  background-color: var(--craftadmin-surface);
}

.main .datatable-input {
  width: 16rem;
  max-width: 100%;
}

.main .datatable-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 0 0;
}

.main .datatable-bottom > div,
.main .datatable-bottom > nav {
  float: none;
}

.main .datatable-info {
  margin: 0;
  font-size: .875rem;
}

/* pages as one joined strip, like the kit's pagination */
.main .datatable-pagination-list {
  display: inline-flex;
  flex-wrap: wrap;
  margin: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}

.main .datatable-pagination li {
  float: none;
}

.main .datatable-pagination li + li {
  border-left: 1px solid var(--bs-border-color);
}

.main .datatable-pagination a,
.main .datatable-pagination button {
  min-width: 2.25rem;
  margin: 0;
  font-weight: 700;
  background: var(--craftadmin-surface);
  border: 0;
  border-radius: 0;
}

.main .datatable-pagination .datatable-disabled a,
.main .datatable-pagination .datatable-disabled button {
  opacity: .45;
}

.main .datatable-pagination .datatable-active a,
.main .datatable-pagination .datatable-active button {
  color: #fff;
  background: var(--craftadmin-maroon);
}

/* ---- reviewer scoring page: proportions (992px and up) -------------------------------------
   Styling only. The image box (100% x 450px), the 500px question box, every field name and
   the buttons are as the view wrote them. Phones and tablets keep their own rules below.
   The page is recognised by its question box, #score_questionair_id. */

@media (min-width: 992px) {

  /* Room above the image and the panel. The magnifier places its lens from the nearest
     positioned box, which used to be the card (image flush with the card top). The form now
     takes that job with the same left and top edge relative to the image, so the lens lands
     exactly where it did before. */
  .main .card-body > #scan_score:has(#score_questionair_id) {
    position: relative;
    padding: 0 1.25rem;
    margin: 1.25rem -1.25rem 0;
  }

  /* -- left: captions as one quiet line under the image, arrows together -- */
  #scan_score:has(#score_questionair_id) .col-lg-6.text-center > h6 {
    display: inline-block;
    padding: .1875rem .625rem;
    margin: .625rem .1875rem 0;
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
  }

  #scan_score:has(#score_questionair_id) .col-lg-6.text-center > h6:first-of-type {
    display: block;
    padding: 0;
    margin: .5rem 0 0;
    font-weight: 400;
    color: var(--bs-secondary-color);
    background: none;
    border: 0;
  }

  #scan_score:has(#score_questionair_id) .col-lg-6.text-center > .row {
    gap: .75rem;
    justify-content: center;
    margin-top: .75rem;
  }

  #scan_score:has(#score_questionair_id) .col-lg-6.text-center > .row > .col-lg-6.h2 {
    flex: 0 0 auto;
    width: auto;
    min-width: 3.5rem;
    padding: 0;
    margin: 0;
  }

  /* -- right: the question panel -- */
  #scan_score:has(#score_questionair_id) .col-lg-6.bg-light {
    padding: .875rem 1rem .5rem;
  }

  #scan_score:has(#score_questionair_id) .col-lg-6.bg-light hr {
    margin: .75rem 0;
  }

  #score_questionair_id {
    padding: 0 .75rem 0 .25rem;
  }

  /* every line of the form: one flex row, text left, answers right, nothing wraps mid-word */
  #score_questionair_id .form-row,
  #scan_score:has(#score_questionair_id) .form-group > .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem .5rem;
    align-items: center;
  }

  #score_questionair_id .form-row > label,
  #scan_score:has(#score_questionair_id) .form-group > .form-row > label {
    flex: 0 0 auto;
    width: auto;
    padding: 0;
    margin: 0;
  }

  /* Incorrect Image line (and its remark list + Revert back button when ticked) */
  #scan_score:has(#score_questionair_id) .form-group > .form-row > label:first-child {
    margin-right: .5rem;
    font-weight: 600;
  }

  #scan_score:has(#score_questionair_id) .form-group > .form-row > label.revert_button.col-lg-6 {
    flex: 1 1 0;
    min-width: 0;
  }

  /* Participant ID / ENR NO / SCR NO / IMG ID: two pairs to a line, values not cut */
  #score_questionair_id > .form-row:first-child {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: .5rem .75rem;
  }

  #score_questionair_id > .form-row:first-child > br {
    display: none;
  }

  #score_questionair_id > .form-row:first-child > label:not(:has(input)) {
    font-size: .8125rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
  }

  #score_questionair_id > .form-row:first-child .form-control {
    padding: .25rem .5rem;
    font-size: .875rem;
    font-weight: 600;
    background: var(--bs-tertiary-bg);
  }

  /* section names (Zooming, Caliper placement ...) */
  #score_questionair_id > .h6.text-primary {
    margin: 0 0 .375rem;
    font-size: .75rem;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  /* a question: text takes the room, the two answers sit at the right */
  #score_questionair_id .form-row:has(> label.col-lg-8) {
    padding: .1875rem .5rem;
    margin: 0 -.5rem;
    border-radius: var(--bs-border-radius);
  }

  #score_questionair_id .form-row:has(> label.col-lg-8):hover {
    background: var(--bs-secondary-bg);
  }

  #score_questionair_id .form-row > label.col-lg-8 {
    flex: 1 1 0;
    min-width: 0;
  }

  #score_questionair_id .form-row > label:not(:has(input)):first-child:not(.col-lg-8) {
    margin-right: .5rem;
  }

  /* each answer (No / Yes / IMAGE 1 ...) is a small button; the chosen one is tinted */
  #score_questionair_id .form-row > label:has(> input[type="radio"]) {
    display: inline-flex;
    gap: .375rem;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    padding: .1875rem .625rem;
    white-space: nowrap;
    cursor: pointer;
    background: var(--craftadmin-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
  }

  #score_questionair_id .form-row > label:has(> input[type="radio"]):hover {
    border-color: var(--bs-primary-border-subtle);
  }

  #score_questionair_id .form-row > label:has(> input[type="radio"]:checked) {
    font-weight: 600;
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
  }

  #score_questionair_id .form-row > label > input[type="radio"] {
    margin: 0;
    accent-color: var(--bs-primary);
  }

  /* Total Score: label and box together at the right */
  #score_questionair_id .text-row {
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: flex-end;
  }

  #score_questionair_id .text-row > label {
    flex: 0 0 auto;
    width: auto;
    padding: 0;
    margin: 0;
    font-weight: 700;
  }

  #score_questionair_id .text-row .total_score {
    width: 5rem;
    font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
  }

  /* Save buttons stay in view at the foot of the question box once they appear */
  #score_questionair_id > #save_button {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: .625rem 0;
    margin-top: .75rem;
    background: rgb(var(--bs-light-rgb));
    border-top: 1px solid var(--bs-border-color);
  }

  [data-bs-theme="dark"] #score_questionair_id > #save_button {
    background: var(--bs-tertiary-bg);
  }

  #score_questionair_id > #save_button .btn {
    min-width: 9rem;
    margin: 0 .25rem;
  }
}

/* ---- reviewer / expert dashboard: proportions ---------------------------------------------
   CSS only (main.php untouched). This dashboard is recognised by its three count tiles
   (.info-card). The admin dashboard has none and keeps its own layout above. */

@media (min-width: 768px) {
  /* the three counts share one line instead of two and one */
  .dashboard > .row:has(.info-card) > .col-lg-8 > .row > [class*="col-xxl-4"] {
    flex: 0 0 33.333333%;
    width: 33.333333%;
  }
}

@media (min-width: 992px) {
  /* the wrappers step aside, so the tiles can span the page and the two chart cards sit
     side by side under them at the same height */
  .dashboard > .row:has(.info-card) > .col-lg-8,
  .dashboard > .row:has(.info-card) > .col-lg-8 > .row {
    display: contents;
  }

  .dashboard > .row:has(.info-card) > .col-lg-8 > .row > .col-12 {
    flex: 0 0 62%;
    width: 62%;
  }

  .dashboard > .row:has(.info-card) > .col-lg-4 {
    flex: 0 0 38%;
    width: 38%;
  }

  .dashboard > .row:has(.info-card) > .col-lg-8 > .row > .col-12 > .card,
  .dashboard > .row:has(.info-card) > .col-lg-4 > .card {
    height: calc(100% - var(--craftadmin-gutter));
  }

  /* Reviewer's Status has a chart only for some user IDs. With none, the card is just a
     title: it is not shown and External Expert takes the full width. */
  .dashboard > .row:has(.info-card) > .col-lg-4:not(:has(.echart)) {
    display: none;
  }

  .dashboard > .row:has(.info-card):not(:has(> .col-lg-4 .echart)) > .col-lg-8 > .row > .col-12 {
    flex: 0 0 100%;
    width: 100%;
  }

  /* Reviewer ID line: a heading for its chart */
  .dashboard > .row:has(.info-card) > .col-lg-4 .card-body > .col-lg-6 {
    width: 100%;
    padding: .5rem .75rem;
    margin-top: .25rem;
    font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-weight: 600;
    text-align: center;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-top: 3px solid var(--craftadmin-navy);
    border-radius: var(--bs-border-radius);
  }
}

/* ---- wide lists on a laptop (992px to 1499px) ---------------------------------------------------
   The 13-column lists were a little wider than their card at 1366px, so the last column
   (Review Status) needed a sideways scroll. Slightly smaller text and tighter cell sides
   in this range only; wider screens keep the roomier look. */
@media (min-width: 992px) and (max-width: 1499.98px) {
  .main .datatable-table {
    font-size: .8125rem;
  }

  .main .datatable-table > thead > tr > th {
    font-size: .75rem;
  }

  .main .datatable-table > :not(caption) > * > * {
    padding-right: .25rem;
    padding-left: .25rem;
  }

  .main .datatable-table > :not(caption) > * > :first-child {
    padding-left: .5rem;
  }

  .main .datatable-table > :not(caption) > * > :last-child {
    padding-right: .5rem;
  }

  .main .datatable-table .datatable-sorter {
    padding-right: .625rem;
  }
}

@media (min-width: 992px) and (max-width: 1299.98px) {
  .main .datatable-table > :not(caption) > * > * {
    padding-right: .125rem;
    padding-left: .125rem;
  }

  .main .datatable-table .datatable-sorter {
    padding-right: .5rem;
  }
}

/* ---- tick boxes in the pages -------------------------------------------------------------------
   The views use bare <input type="checkbox"> (Review Status in Score Images, the ITS list,
   Incorrect Image on the scoring page). Same inputs, same names and values; only the drawing
   changes. In lists a tick is a round green "done" badge with a soft ring; an empty one is a
   dashed circle. No red: green means done. */

.main input[type="checkbox"]:not(.form-check-input) {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  background: var(--craftadmin-surface) center / 100% 100% no-repeat;
  border: 1.5px dashed var(--bs-secondary-color);
  border-radius: 50%;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.main input[type="checkbox"]:not(.form-check-input):hover {
  border-color: #198754;
  box-shadow: 0 0 0 .1875rem rgba(25, 135, 84, .14);
}

.main input[type="checkbox"]:not(.form-check-input):active {
  transform: scale(.92);
}

.main input[type="checkbox"]:not(.form-check-input):focus-visible {
  outline: 2px solid #198754;
  outline-offset: 3px;
}

.main input[type="checkbox"]:not(.form-check-input):checked {
  background-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.6' d='m5.6 10.4 2.9 2.9 5.9-6.4'/%3e%3c/svg%3e");
  border: 0;
  box-shadow: 0 0 0 .1875rem rgba(25, 135, 84, .2);
}

.main input[type="checkbox"]:not(.form-check-input):checked:hover {
  background-color: #157347;
  box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .26);
}

.main input[type="checkbox"]:not(.form-check-input):disabled {
  cursor: default;
  opacity: .55;
}

/* Incorrect Image on the scoring page is an on/off choice, not a "done" mark: a switch,
   grey when off and orange when on (992px and up; on phones it is already a large button). */
@media (min-width: 992px) {
  .main #review_st_id {
    width: 2.625rem;
    height: 1.375rem;
    background: var(--bs-secondary-color) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") left center / 1.375rem 1.375rem no-repeat;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    transition: background-color .15s, background-position .15s;
  }

  .main #review_st_id:hover {
    box-shadow: 0 0 0 .1875rem rgba(245, 137, 32, .2);
  }

  .main #review_st_id:focus-visible {
    outline: 2px solid var(--craftadmin-orange);
    outline-offset: 3px;
  }

  .main #review_st_id:checked,
  .main #review_st_id:checked:hover {
    background-color: var(--craftadmin-orange);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: right center;
    box-shadow: none;
  }

  #scan_score label:has(> #review_st_id) {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    cursor: pointer;
  }
}

/* ---- sidebar: long menu names go onto a second line instead of ending in "..." ---------------
   The names come from the database and are shown in full. The narrow icon rail (text hidden
   by the kit) is not affected. */

.app-sidebar .sidebar-text {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: break-word;
}

.app-sidebar .sidebar-link {
  line-height: 1.25;
}

/* ... and so that they rarely need that second line: the sidebar is 16px wider (240 -> 256),
   the links a little tighter and the text one step smaller. "Generate Random Records (ITS)",
   the longest name, now fits on one line. Wrapping stays as the fallback for anything longer. */
/* width put back to the kit's 240px on the user's word (2026-12-05): the sidebar is not to be widened
html:root {
  --craftadmin-sidebar-width: 256px;
}
*/

@media (min-width: 992px) {
  html:not([data-sidebar="rail"]) .app-sidebar .sidebar-link {
    gap: .375rem;
    padding-right: 0;
    padding-left: .5rem;
    font-size: .9375rem;      /* the kit's own 15px: 13px and 14px were both too small for the user */
    letter-spacing: -.03em;   /* this, the tight gap and sides are what let the longest name fit 240px */
  }
}

/* ---- empty message strip ------------------------------------------------------------------------
   Reports (and any page that prints its message box straight into the section) left 32px of
   padding and margin under the title even with no message. An empty one takes no room; with a
   message it shows as before. Boxes inside a card are left alone: they space the card's top. */

.main .section > .p-2:empty {
  display: none;
}

/* ---- sign-in in progress: the outline of the application ---------------------------------------
   Covers the sign-in page from the press of Login until the next page arrives (markup at the
   foot of login.php, switched on by uqas-login.js). It is drawn like the page that is coming:
   sidebar, top bar, three tiles, two cards. */

.signin-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  background: var(--bs-body-bg);
  opacity: 0;
  transition: opacity .18s ease;
}

.signin-loading[hidden] {
  display: none;
}

.signin-loading.is-on {
  opacity: 1;
}

/* progress line: quick at first, then slower and slower, never quite full */
.signin-loading .sl-bar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 0;
  height: 3px;
  background: var(--craftadmin-gradient);
  border-radius: 0 3px 3px 0;
}

/* (the bar's width is set by uqas-login.js, in step with the ring in the middle) */

.signin-loading .sl-side {
  display: flex;
  flex: 0 0 240px;
  flex-direction: column;
  gap: 1.125rem;
  padding: 1rem .875rem;
  background: var(--craftadmin-sidebar-bg, #2a2c2f);
}

.signin-loading .sl-brand {
  display: flex;
  gap: .625rem;
  align-items: center;
  margin-bottom: 1rem;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.signin-loading .sl-brand img {
  width: 36px;
  height: 36px;
}

.signin-loading .sl-side > i {
  display: block;
  width: 72%;
  height: .75rem;
  background: rgba(255, 255, 255, .13);
  border-radius: 999px;
}

.signin-loading .sl-side > i:nth-of-type(2n) { width: 88%; }
.signin-loading .sl-side > i:nth-of-type(3n) { width: 58%; }

.signin-loading .sl-main {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.signin-loading .sl-top {
  display: flex;
  flex: 0 0 64px;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--craftadmin-band, var(--bs-tertiary-bg));
  border-bottom: 2px solid var(--craftadmin-orange);
}

/* the top bar's title: an empty line, like the rest */
.signin-loading .sl-top > i {
  display: block;
  flex: 0 1 18rem;
  height: .875rem;
  background: rgba(var(--bs-emphasis-color-rgb), .1);
  border-radius: 999px;
}

/* -- the middle: ring, percentage, one line of text --
   Sizes are in clamp(), so the same block suits a phone, a laptop and a large monitor. */
.signin-loading .sl-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: clamp(.75rem, 2.2vmin, 1.25rem);
  align-items: center;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: clamp(1.25rem, 4vmin, 2.25rem) clamp(1.5rem, 5vmin, 3rem);
  text-align: center;
  background: var(--craftadmin-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .12);
  transform: translate(-50%, -50%);
}

.signin-loading .sl-ring {
  position: relative;
  width: clamp(6.5rem, 26vmin, 10rem);
  aspect-ratio: 1;
}

.signin-loading .sl-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);   /* the fill starts at the top */
}

.signin-loading .sl-ring-track,
.signin-loading .sl-ring-fill {
  fill: none;
  stroke-width: 9;
}

.signin-loading .sl-ring-track {
  stroke: var(--bs-secondary-bg);
}

.signin-loading .sl-ring-fill {
  stroke: url(#sl_grad);
  stroke-linecap: round;
  stroke-dasharray: 326.73;    /* 2 x pi x 52 */
  stroke-dashoffset: 326.73;
}

.signin-loading .sl-pct {
  position: absolute;
  inset: 0;
  display: flex;
  gap: .125rem;
  align-items: baseline;
  justify-content: center;
  padding-top: 34%;
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1;
  color: var(--bs-heading-color);
}

.signin-loading .sl-pct > b {
  font-size: clamp(1.625rem, 7vmin, 2.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.signin-loading .sl-pct > small {
  font-size: clamp(.875rem, 3vmin, 1.125rem);
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.signin-loading .sl-status {
  max-width: min(22rem, 100%);
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: clamp(.9375rem, 2.6vmin, 1.0625rem);
  font-weight: 600;
  color: var(--bs-heading-color);
  overflow-wrap: anywhere;
}

.signin-loading .sl-body {
  display: grid;
  gap: 1.5rem;
  align-content: start;
  padding: 1.5rem;
  overflow: hidden;
}

.signin-loading .sl-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.signin-loading .sl-cards {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.5rem;
}

/* the empty tiles, cards and avatar: a soft light sweeps across them */
.signin-loading .sl-tiles > i,
.signin-loading .sl-cards > i,
.signin-loading .sl-top > b {
  display: block;
  background:
    linear-gradient(100deg, transparent 35%, rgba(var(--bs-emphasis-color-rgb), .06) 50%, transparent 65%) 0 0 / 250% 100%,
    var(--craftadmin-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  animation: sl-sweep 1.5s linear infinite;
}

.signin-loading .sl-tiles > i { height: 6rem; }
.signin-loading .sl-cards > i { height: 24rem; }

.signin-loading .sl-top > b {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
}

@keyframes sl-sweep {
  from { background-position: 120% 0, 0 0; }
  to   { background-position: -130% 0, 0 0; }
}

@media (max-width: 991.98px) {
  .signin-loading .sl-side {
    display: none;
  }

  .signin-loading .sl-top {
    padding: 0 1rem;
  }

  .signin-loading .sl-body {
    gap: 1rem;
    padding: 1rem;
  }

  .signin-loading .sl-tiles,
  .signin-loading .sl-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .signin-loading .sl-tiles > i { height: 4.5rem; }
  .signin-loading .sl-cards > i { height: 14rem; }
}

@media (prefers-reduced-motion: reduce) {
  .signin-loading,
  .signin-loading .sl-tiles > i,
  .signin-loading .sl-cards > i,
  .signin-loading .sl-top > b {
    transition: none;
    animation: none;
  }

  .signin-loading .sl-ring-fill {
    transition: none;
  }
}

/* ---- "Please wait" over the page area -----------------------------------------------------------
   Markup and script at the top of pgheader.php (so: every page except sign-in). It covers the
   content only; the sidebar and top bar stay usable, so a slow page can still be left.
   It appears only after 1s of loading: until then it is invisible and lets clicks through. */

.page-wait {
  position: fixed;
  top: var(--craftadmin-topbar-height, 64px);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1010;               /* under the top bar (1020) and the sidebar drawer (1035) */
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(var(--bs-body-bg-rgb), .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: page-wait-in .2s ease 1s both;   /* was .35s: it showed too often */
}

.page-wait[hidden] {
  display: none;
}

@media (min-width: 992px) {
  .page-wait {
    left: var(--craftadmin-sidebar-current, 240px);
  }
}

@keyframes page-wait-in {
  from { visibility: hidden; opacity: 0; }
  to   { visibility: visible; opacity: 1; }
}

.page-wait-box {
  display: grid;
  gap: .25rem .875rem;
  grid-template-columns: auto auto;
  align-items: center;
  max-width: 100%;
  padding: 1rem 1.375rem;
  background: var(--craftadmin-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: .875rem;
  box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .14);
}

.page-wait-spin {
  grid-row: 1 / span 2;
  width: 2.25rem;
  height: 2.25rem;
  border: .25rem solid var(--bs-secondary-bg);
  border-top-color: var(--craftadmin-orange);
  border-radius: 50%;
  animation: page-wait-turn .8s linear infinite;
}

@keyframes page-wait-turn {
  to { transform: rotate(360deg); }
}

.page-wait-text {
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bs-heading-color);
}

.page-wait-box > small {
  grid-column: 2;
  font-size: .8125rem;
  line-height: 1.2;
  color: var(--bs-secondary-color);
}

@media (prefers-reduced-motion: reduce) {
  .page-wait {
    animation-duration: .01s;
  }

  .page-wait-spin {
    animation-duration: 2.4s;
  }
}

/* ---- print: content only, as before ------------------------------------------------------- */

@media print {
  .app-sidebar,
  .app-topbar,
  .app-footer,
  .back-to-top {
    display: none !important;
  }

  .app-main {
    margin-left: 0 !important;
  }
}

/* ==========================================================================================
   PHONES AND TOUCH SCREENS
   Everything below sits inside a media query. A desktop with a mouse and a window of
   992px or more gets none of it, so the desktop pages are exactly as above.
   ========================================================================================== */

/* ---- scan image (Score Scan Images, Expert Review, Image Review Details) -------------------
   On a wide screen the image is 100% x 450px with a hover magnifier. On a phone that box is
   tall and narrow, so the scan was squeezed sideways, and the magnifier's touch handler
   stopped the page from scrolling under the finger. Here the image keeps its own proportions,
   the magnifier is off, a swipe scrolls the page and a tap opens the full image (the link
   that was already around it), where the phone's own pinch zoom works. */
@media (max-width: 991.98px), (hover: none) and (pointer: coarse) {
  a.img-magnifier-container {
    display: block;
  }

  #scan_image_id {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    pointer-events: none;   /* touches go to the link and the page, not to the magnifier */
  }

  .img-magnifier-glass {
    display: none;
  }
}

@media (max-width: 991.98px) {

  /* ---- scoring form: questions flow with the page, no box scrolling inside the page ------- */

  #score_questionair_id,
  #question_panel {
    height: auto !important;
    overflow: visible !important;
  }

  #scan_score .bg-light,
  #question_panel {
    padding: .75rem .25rem 1rem;
    margin-top: 1rem;
  }

  /* Participant ID / ENR NO / SCR NO / IMG ID: label and value side by side */
  #score_questionair_id > .form-row:first-child {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .5rem .75rem;
    align-items: center;
  }

  #score_questionair_id > .form-row:first-child > label {
    width: auto;
    margin: 0;
    font-weight: 400;
  }

  #score_questionair_id > .form-row:first-child > br {
    display: none;
  }

  /* the question on its own line ... */
  #score_questionair_id .form-row > label:not(:has(input)) {
    display: block;
    width: 100%;
    margin: .875rem 0 .375rem;
    font-weight: 700;
  }

  /* ... and each answer a button the size of a thumb, two to a row.
     The label is the radio's own label, so tapping anywhere on it answers. */
  #score_questionair_id .form-row > label:has(> input[type="radio"]),
  #scan_score label:has(> input[type="checkbox"]) {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    width: calc(50% - .75rem);
    min-height: 3rem;
    padding: .5rem .75rem;
    margin: 0 .375rem .5rem 0;
    font-weight: 700;
    cursor: pointer;
    background: var(--craftadmin-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    -webkit-tap-highlight-color: transparent;
  }

  #score_questionair_id .form-row > label:has(> input[type="radio"]:checked),
  #scan_score label:has(> input[type="checkbox"]:checked) {
    color: var(--bs-primary-text-emphasis);
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary);
    box-shadow: inset 0 0 0 1px var(--bs-primary);
  }

  #score_questionair_id .form-row > label > input[type="radio"],
  #scan_score label > input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--bs-primary);
  }

  /* Incorrect Image: the remark list and Revert back, full width once they are shown */
  #scan_score label.revert_button {
    width: 100%;
    margin-bottom: .5rem;
  }

  #scan_score label.revert_button .btn {
    width: 100%;
    min-height: 3rem;
  }

  /* Total Score: label and box on one line */
  #score_questionair_id .text-row {
    display: flex;
    gap: .75rem;
    align-items: center;
  }

  #score_questionair_id .text-row > label {
    width: auto;
    margin: 0;
    font-weight: 700;
    text-align: left !important;
  }

  #score_questionair_id .text-row > label:has(input) {
    flex: 1 1 auto;
  }

  /* Save and Exit / Save and Next stay at the foot of the screen once they appear */
  #save_button {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: .625rem 0;
    margin-top: .75rem;
    background: rgb(var(--bs-light-rgb));
    border-top: 1px solid var(--bs-border-color);
  }

  [data-bs-theme="dark"] #save_button {
    background: var(--bs-tertiary-bg);
  }

  #save_button .btn {
    min-width: 44%;
    min-height: 3rem;
  }

  /* back-to-top keeps clear of the save bar */
  body:has(#save_button) .back-to-top {
    bottom: 5.5rem;
  }

  /* ---- previous / next image: two thumb-size buttons side by side --------------------------- */

  #scan_score .row > .col-lg-6.h2,
  #score_review .row > .col-lg-4.h2 {
    flex: 0 0 50%;
    width: 50%;
    margin: .5rem 0 0;
    text-align: center;
  }

  .main a[alt="previous"],
  .main a[alt="next"],
  .main a[alt="left"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    min-height: 3rem;
    text-decoration: none;
    background: var(--craftadmin-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
  }

  /* ---- Expert Review: Reject / Accept first, the arrows under them --------------------------- */

  #score_review .row > label.col-lg-2 {
    flex: 0 0 50%;
    order: 1;
    width: 50%;
    margin: .5rem 0 0;
  }

  #score_review .row > .col-lg-4.h2 {
    order: 2;
  }

  #score_review .row > label.col-lg-2 > .btn {
    min-height: 3rem;
  }

  /* the reviewer's answers: question left, Yes / No right */
  #question_panel .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    align-items: center;
    padding: .25rem 0;
  }

  #question_panel .form-row > label {
    width: auto;
    margin: 0;
  }

  #question_panel .form-row > label.col-lg-8 {
    flex: 1 1 0;
    min-width: 0;
  }

  /* ---- dashboard: the reviewer charts column scrolls with the page ---------------------------- */

  .dashboard .col-lg-4[style*="720px"] {
    height: auto !important;
    overflow: visible !important;
  }

  /* ---- sign-in: links easier to hit ----------------------------------------------------------- */

  .signin-links a {
    display: inline-block;
    padding: .375rem 0;
  }
}

/* ---- lists on a phone: one card per row -----------------------------------------------------
   For the simple-datatables lists (Score Images, Expert Review Required, Random Records ...).
   uqas-mobile.js copies each column heading into data-label on the cells and adds .table-stack;
   without that script the table stays a table. The headings become a strip of sort buttons. */
@media (max-width: 767.98px) {
  .main .datatable-container:has(> .table-stack) {
    overflow-x: visible;
  }

  .main .datatable-top > div,
  .main .datatable-bottom > div,
  .main .datatable-bottom > nav {
    float: none !important;
    margin-bottom: .5rem;
  }

  .main .datatable-input {
    width: 100%;
    min-height: 2.75rem;
  }

  .main .datatable-selector {
    min-height: 2.75rem;
  }

  .main .datatable-pagination a,
  .main .datatable-pagination button {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .table-stack,
  .table-stack > thead,
  .table-stack > tbody,
  .table-stack > tbody > tr {
    display: block;
    width: 100%;
  }

  .table-stack > thead > tr {
    display: flex;
    gap: .375rem;
    padding-bottom: .5rem;
    margin-bottom: .75rem;
    overflow-x: auto;
    border-bottom: 2px solid var(--craftadmin-maroon);
  }

  .table-stack > thead > tr > th {
    flex: 0 0 auto;
    width: auto !important;        /* the table script sets a % width meant for columns */
    min-width: max-content;
    padding: .25rem .375rem;
    white-space: nowrap;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
  }

  .table-stack > thead .datatable-sorter {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
  }

  .table-stack > tbody > tr {
    padding: .5rem .875rem;
    margin-bottom: .75rem;
    background: var(--craftadmin-surface);
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--craftadmin-navy);
    border-radius: var(--bs-border-radius);
  }

  .table-stack > tbody > tr > td,
  .table-stack > tbody > tr > th {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    min-height: 2.25rem;
    padding: .25rem 0;
    font-weight: 400;
    text-align: right !important;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    box-shadow: none;
  }

  .table-stack > tbody > tr > :last-child {
    border-bottom: 0;
  }

  .table-stack > tbody > tr > [data-label]::before {
    flex: 0 0 42%;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    text-align: left;
    content: attr(data-label);
  }

  .table-stack > tbody > tr > td > .btn,
  .table-stack > tbody > tr > th > .btn {
    flex: 0 1 auto;
    width: auto;
    min-width: 6rem;
    min-height: 2.75rem;
  }

  /* plain links in a card (the S. No. that opens the record, the View link) look and
     measure like something to tap */
  .table-stack > tbody > tr > td > a:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    min-height: 2.75rem;
    padding: .25rem .875rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--bs-primary-bg-subtle);
    border: 1px solid var(--bs-primary-border-subtle);
    border-radius: var(--bs-border-radius);
  }

  /* the View link is an <i class="fa fa-image"> and Font Awesome is not loaded, so it was
     blank; in a card it borrows the same picture from Bootstrap Icons */
  .table-stack > tbody i.fa.fa-image::before {
    font-family: "bootstrap-icons";
    font-style: normal;
    font-size: 1.25rem;
    line-height: 1;
    content: "\f42a";
  }

  .table-stack > tbody input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* "No entries found" keeps its own centred line */
  .table-stack > tbody > tr > td[colspan] {
    justify-content: center;
    text-align: center !important;
  }
}
