/* Load first (before admin.css / application.css via require_tree). */
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400..700;1,14..32,400..700&display=swap");

:root {
  --font-app: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  font-family: var(--font-app);
}

button,
input,
select,
textarea,
optgroup {
  font-family: inherit;
}
/* Admin console (internal support) */

.admin-body {
  margin: 0;
  min-height: 100vh;
  background: #f8fafc;
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  color: #0f172a;
}

.admin-header {
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
}

.admin-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.admin-header__title {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.admin-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.admin-header__logout-form {
  margin: 0;
  display: inline;
}

.admin-header__logout {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.admin-header__logout:hover {
  background: #cbd5e1;
}

.admin-link {
  color: #93c5fd;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-link-strong {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.admin-link-strong:hover {
  text-decoration: underline;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.admin-nav__link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-nav__link:hover {
  color: #fff;
}

.admin-nav__link--active {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.admin-page__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
}

.admin-page__lead {
  margin: 0 0 1.25rem;
  color: #475569;
}

.admin-stat-highlight {
  font-weight: 800;
  font-size: 1.35rem;
  color: #0f172a;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-metric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-metric-card--alert {
  border-color: #fecaca;
  background: #fff1f2;
}

.admin-metric-card__label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.admin-metric-card__value {
  font-size: 1.45rem;
  font-weight: 700;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Admin support ticket: keep Description and Status side by side on typical desktop widths */
.admin-support-request-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

@media (max-width: 960px) {
  .admin-support-request-top {
    grid-template-columns: 1fr;
  }
}

.admin-support-request-notes .admin-input[type="text"],
.admin-support-request-notes textarea.admin-input {
  max-width: none;
  width: 100%;
}

.admin-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-panel__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.admin-panel__subtitle {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-db-health-dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.65rem 1.25rem;
  font-size: 0.92rem;
  align-items: start;
}

.admin-db-health-dl dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.admin-db-health-dl dd {
  margin: 0;
}

.admin-db-health__primary {
  font-weight: 700;
  margin-right: 0.35rem;
}

.admin-chart-wrap {
  position: relative;
  height: 240px;
}

.admin-disk-summary {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.admin-disk-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.admin-disk-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.admin-disk-bar__fill--green {
  background: #22c55e;
}

.admin-disk-bar__fill--amber {
  background: #f59e0b;
}

.admin-disk-bar__fill--red {
  background: #ef4444;
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.admin-table__num {
  text-align: right;
  white-space: nowrap;
}

.admin-table__mono {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

/* Icon-only row actions — same treatment as portal data-table .group-icon-link (application.css) */
table.admin-table .admin-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: 8px;
  color: #2563eb;
  line-height: 0;
  text-decoration: none;
  font-weight: 400;
}

table.admin-table .admin-icon-link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

table.admin-table .admin-icon-link svg {
  flex-shrink: 0;
}

.admin-th-link {
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
}

.admin-th-link:hover {
  text-decoration: underline;
}

.admin-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.admin-pill--ok {
  background: #dcfce7;
  color: #166534;
}

.admin-pill--bad {
  background: #fee2e2;
  color: #991b1b;
}

.admin-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-tag--success {
  background: #dcfce7;
  color: #166534;
}

.admin-tag--amber {
  background: #fef3c7;
  color: #92400e;
}

.admin-tag--muted {
  background: #f1f5f9;
  color: #475569;
}

.admin-muted {
  color: #64748b;
  margin: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.admin-input {
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-width: 220px;
  font: inherit;
}

.admin-input--grow {
  flex: 1 1 220px;
  min-width: 200px;
}

.admin-grant-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-grant-credits__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex: 1 1 280px;
}

.admin-grant-credits__label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.admin-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-button {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.35;
}

.admin-button:hover {
  background: #1d4ed8;
  color: #fff;
}

.admin-panel--danger-zone {
  border-color: #fecaca;
  background: #fef2f2;
  box-shadow: 0 1px 3px rgba(185, 28, 28, 0.08);
}

.admin-panel__title--danger {
  color: #b91c1c;
}

.admin-danger-zone__intro {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: #7f1d1d;
  line-height: 1.45;
  max-width: 52rem;
}

.admin-danger-zone__actions {
  margin: 0;
}

.admin-button--danger {
  background: #dc2626;
}

.admin-button--danger:hover {
  background: #b91c1c;
  color: #fff;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.admin-button--outline {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.admin-button--outline:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.admin-pagination {
  margin-top: 1rem;
}

.admin-pagination__info {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #64748b;
}

.admin-breadcrumb {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.admin-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem 1rem;
  font-size: 0.92rem;
}

.admin-dl dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.admin-dl dd {
  margin: 0;
}

/* Admin support requests index — filters + table/pagination split */
.admin-support-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.admin-support-filters__submit {
  flex-shrink: 0;
}

.admin-input--filter-q {
  min-width: 220px;
}

.admin-support-requests__panel {
  padding: 0;
  overflow: visible;
}

.admin-support-requests__table-wrap {
  overflow-x: auto;
}

.admin-support-requests__pagination {
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
}

.admin-support-requests__footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  width: 100%;
}

.admin-support-requests__pagination-nav {
  flex: 1 1 12rem;
  display: flex;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 767px) {
  .admin-support-requests__footer-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-support-requests__pagination-nav {
    width: 100%;
  }

  .admin-support-requests__per-page-form {
    margin-left: 0;
    width: 100%;
  }
}

.admin-support-requests__per-page-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.admin-support-requests__per-page-label {
  margin: 0;
  font-size: 0.85rem;
}

.admin-support-requests__per-page-select {
  min-width: 4.5rem;
}

.admin-support-requests__empty {
  padding: 1.25rem;
  margin: 0;
}
/* ==========================================================================
   MasteryByte — site-wide responsive layout (mobile & tablet)
   Loaded after application.css in the layout so @media rules override base styles.
   ========================================================================== */

/* ── Utilities ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Prevent horizontal page scroll from wide children */
body.app-has-topbar {
  overflow-x: clip;
}

body.app-has-topbar .main-content {
  min-width: 0;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Chart.js canvases use absolute fill inside .chart-canvas-wrap — do not set height: auto globally */
.chart-canvas-wrap canvas {
  max-width: 100%;
}

/* ── Viewport-safe widths ── */
.footer-inner {
  max-width: min(1680px, 100%);
}

/* ==========================================================================
   Dashboard homepage (authenticated root)
   ========================================================================== */

.dashboard-header {
  min-width: 0;
}

.dashboard-header h1 {
  word-break: break-word;
}

.dashboard-context-strip {
  max-width: 100%;
}

.dashboard-context-strip__value {
  word-break: break-word;
}

/* Metric cards: 6 → 3 → 2 → 1 */
@media (max-width: 1279px) {
  .dashboard .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .dashboard .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .dashboard .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Tablet: calendar strip stacks before cards get too cramped */
@media (max-width: 767px) {
  .dashboard-header {
    margin-bottom: 1.35rem;
  }

  .dashboard-header h1 {
    font-size: 1.4rem;
    margin-bottom: 0.65rem;
  }

  .dashboard-context-strip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--st-radius-lg);
    width: 100%;
    box-sizing: border-box;
  }

  .dashboard-context-strip__item {
    border-right: none;
    border-bottom: 0.5px solid var(--st-border-tertiary);
    padding: 0.5rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
  }

  .dashboard-context-strip__item:last-child {
    border-bottom: none;
  }

  .dashboard-context-strip__value {
    font-size: 0.875rem;
  }

  .onboarding-checklist {
    padding: 1rem 1rem 1.1rem;
  }

  .onboarding-checklist__header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .onboarding-checklist__header-text {
    flex: 1 1 12rem;
    min-width: 0;
  }

  .onboarding-checklist__toggle {
    min-height: 44px;
  }
}

@media (max-width: 479px) {
  .dashboard .metrics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard .metric-card h3 {
    font-size: 1.65rem;
  }

  .dashboard .metric-card {
    padding: 1rem 1.1rem;
  }

  .dashboard .chart-card__header,
  .dashboard .chart-card__body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 639px) {
  .dashboard .chart-tag-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard .chart-tag-filter select {
    width: 100%;
    min-width: 0;
  }

  .dashboard .chart-canvas-wrap {
    height: min(260px, 58vw);
    min-height: 200px;
  }

  .dashboard .chart-card__hint {
    font-size: 0.8125rem;
  }
}

/* ── Two-column page layouts (stack on tablet) ── */
.gs-page-layout,
.settings-two-col {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.gs-page-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  margin-top: 1rem;
}

.settings-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .gs-page-layout,
  .settings-two-col,
  .account-layout {
    grid-template-columns: 1fr;
  }
}

/* Contact/student form responsive rules live at the end of application.css
   (scoped to .dashboard) so they override base two-column form layout. */

/* ── Topbar / mobile navigation ── */
.topbar-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.topbar-nav-toggle:hover {
  background: var(--st-bg-secondary);
}

.topbar-nav-toggle:focus {
  outline: none;
}

.topbar-nav-toggle:focus-visible {
  outline: 2px solid var(--st-accent);
  outline-offset: 2px;
}

.topbar-nav-toggle__icon {
  display: block;
  width: 20px;
  height: 14px;
  position: relative;
}

.topbar-nav-toggle__bar,
.topbar-nav-toggle__bar::before,
.topbar-nav-toggle__bar::after {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.topbar-nav-toggle__bar {
  top: 50%;
  margin-top: -1px;
}

.topbar-nav-toggle__bar::before,
.topbar-nav-toggle__bar::after {
  content: "";
}

.topbar-nav-toggle__bar::before {
  top: -6px;
}

.topbar-nav-toggle__bar::after {
  top: 6px;
}

.topbar--nav-open .topbar-nav-toggle__bar {
  background: transparent;
}

.topbar--nav-open .topbar-nav-toggle__bar::before {
  top: 0;
  transform: rotate(45deg);
}

.topbar--nav-open .topbar-nav-toggle__bar::after {
  top: 0;
  transform: rotate(-45deg);
}

.topbar-brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar .org-switcher .org-trigger span,
.topbar .org-switcher > a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(42vw, 14rem);
}

@media (max-width: 1023px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    padding: 0.65rem 1rem;
    gap: 0.5rem 0.75rem;
  }

  .topbar-left {
    flex: 1 1 calc(100% - 3.5rem);
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
  }

  .topbar-brand-row {
    flex: 1 1 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .topbar-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .user-nav {
    flex-shrink: 0;
    margin-left: auto;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: 1 1 100%;
    order: 10;
    gap: 0;
    padding: 0.35rem 0 0.5rem;
    border-top: 0.5px solid var(--st-border-tertiary);
    margin-top: 0.25rem;
  }

  .topbar--nav-open .main-nav {
    display: flex;
  }

  .main-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.9375rem;
    min-height: 44px;
    box-sizing: border-box;
  }

  .main-nav .nav-item {
    width: 100%;
  }

  .main-nav .nav-item > .nav-link {
    width: 100%;
  }

  .main-nav .nav-dropdown {
    display: block;
    position: static;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 0.35rem 0.75rem;
    min-width: 0;
    background: transparent;
  }

  .main-nav .nav-item:hover .nav-dropdown {
    display: block;
  }

  .main-nav .nav-dropdown-link {
    padding: 0.65rem 0.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
  }

  .user-trigger {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }

  .topbar .org-switcher .org-trigger span,
  .topbar .org-switcher > a span {
    max-width: min(50vw, 11rem);
  }
}

@media (max-width: 479px) {
  html:has(body.app-has-topbar) {
    font-size: 100%;
  }

  .main-content {
    padding: 0.65rem 0.75rem 1rem;
  }

  .topbar .org-switcher .org-trigger span,
  .topbar .org-switcher > a span {
    max-width: min(38vw, 8.5rem);
    font-size: 0.95rem !important;
  }
}

/* ── Footer ── */
@media (max-width: 767px) {
  .app-footer {
    padding: 0.85rem 1rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    max-width: 100%;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    width: 100%;
    text-align: center;
  }

  .footer-center {
    order: 3;
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .footer-right {
    justify-content: center;
    gap: 0.35rem 0.65rem;
  }

  .footer-right a {
    line-height: 1.4;
  }
}

@media (max-width: 479px) {
  .app-footer {
    padding: 0.75rem 0.85rem;
    font-size: 0.8125rem;
  }

  .footer-sep {
    display: none;
  }

  .footer-right {
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* ── Page headers & filters ── */
@media (max-width: 639px) {
  .dashboard-header[style*="flex"] {
    flex-wrap: wrap !important;
    align-items: stretch !important;
  }

  .dashboard-header[style*="flex"] > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dashboard-header h1,
  .page-title {
    font-size: 1.35rem;
  }

  .car-results-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .car-results-page-header__actions {
    width: 100%;
  }

  .car-results-page-header__actions .ar-btn,
  .car-results-page-header__actions .btn,
  .car-results-page-header__actions a {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .filters-bar,
  .index-toolbar,
  .students-index__toolbar,
  .assessments-index__toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ── Auth (sign-in, sign-up, password reset) ── */

@media (max-width: 767px) {
  .auth-container,
  .auth-container--sign-in {
    padding: 1rem 0.85rem 2rem;
  }

  .auth-body .auth-card,
  .auth-card,
  .auth-body--signup .auth-signup__card.auth-card {
    padding: 1.35rem 1.1rem 1.45rem;
    border-radius: 12px;
  }

  .auth-body .auth-card h2,
  .auth-card h2,
  .auth-page__title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .auth-page__intro {
    margin: -0.5rem 0 1rem;
    font-size: 0.8125rem;
  }

  .auth-logo,
  .auth-logo--large {
    --auth-logo-max-height: clamp(88px, 24vw, 140px);
    margin-bottom: 0.85rem;
  }

  .auth-links {
    font-size: 0.8125rem;
    margin-top: 1rem;
  }

  .auth-links--stack {
    gap: 0.45rem;
  }

  .auth-links--stack a {
    display: block;
    padding: 0.15rem 0;
    line-height: 1.4;
  }

  .auth-card .actions input[type="submit"],
  .auth-body .auth-card .actions input[type="submit"],
  .auth-signup-form__actions input[type="submit"] {
    min-height: 44px;
    font-size: 0.875rem;
  }

  .auth-card input[type="email"],
  .auth-card input[type="password"],
  .auth-card input[type="text"],
  .auth-card select,
  .auth-body .auth-card input[type="email"],
  .auth-body .auth-card input[type="password"],
  .auth-body .auth-card input[type="text"],
  .auth-body .auth-card select {
    font-size: 16px;
    min-height: 44px;
  }

  .field--password-toggle .field__password-toggle {
    width: 2.75rem;
    height: 2.75rem;
  }

  .flash-container--auth {
    padding: 0.65rem 0.85rem 0;
  }

  .flash-container--auth .flash {
    text-align: left;
    font-size: 0.8125rem;
  }

  .auth-signup {
    padding: 0.75rem 0.65rem 1rem;
    min-height: 100dvh;
  }

  .auth-signup__brand {
    padding: 0.65rem 0 0;
  }

  .auth-signup__logo-wrap {
    padding: 0.65rem 0.45rem;
  }

  .auth-signup__benefits-wrap {
    padding: 0.85rem 0.9rem;
  }

  .auth-signup__benefits-heading {
    margin-bottom: 0.75rem;
  }

  .auth-signup__title {
    font-size: 1.15rem;
  }

  .auth-signup__subtitle {
    font-size: 0.875rem;
  }

  .auth-signup__main {
    margin-top: 0.65rem;
  }

  .auth-signup-form .field--hcaptcha {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-signup-form .field--hcaptcha .hcaptcha-widget {
    max-width: 100%;
  }

  .auth-signup__footer-link {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
  }

  #error_explanation {
    font-size: 0.8125rem;
    line-height: 1.45;
    word-break: break-word;
  }

  #error_explanation h2 {
    font-size: 0.9375rem;
    line-height: 1.35;
  }
}

@media (max-width: 479px) {
  .auth-signup__benefits {
    gap: 0.4rem;
  }

  .auth-signup__benefit-text {
    font-size: 0.875rem;
  }

  .auth-signup-form__section-title {
    font-size: 0.6875rem;
  }
}

/* ── Tables: scroll wrappers + mobile actions ── */
.table-scroll-x,
.data-table-wrap,
.students-index__table-wrap,
.contacts-index__table-wrap,
.groups-index__table-wrap,
.assessments-index__table-wrap,
.reports-index__table-wrap,
.ar-table-wrap,
.car-table-wrap,
.gar-marking-table-wrap,
.marking-table-wrap,
.cp-table-wrap,
.bl-table-wrap {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Marking summary card (assessment results) */
@media (max-width: 767px) {
  .ar-summary {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
    gap: 1.1rem;
  }

  .ar-summary__body {
    width: 100%;
  }

  .ar-student__header {
    padding: 0.85rem 1rem;
  }

  .ar-student__info {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ar-student__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
  }

  .group-assessment-results .gar-student-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .group-assessment-results .gar-student-card__lock-row {
    flex-wrap: wrap;
    width: 100%;
  }
}

/* Marking / feedback tables → stacked rows on small screens */
@media (max-width: 767px) {
  .marking-answers-table {
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .marking-answers-table thead {
    display: none;
  }

  .marking-answers-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 0.5px solid var(--st-border-tertiary);
    border-radius: var(--st-radius-md);
    background: var(--st-bg-primary);
    overflow: hidden;
  }

  .marking-answers-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .marking-answers-table tbody td {
    display: block;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 0.5px solid var(--st-border-tertiary);
    padding: 0.65rem 0.85rem;
  }

  .marking-answers-table tbody td:last-child {
    border-bottom: none;
  }

  .marking-answers-table tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-text-tertiary);
  }

  .marking-answers-table .marking-table__stem-row {
    background: var(--st-bg-secondary);
  }

  .marking-answers-table .marking-table__stem-row td {
    border-bottom: none;
    font-weight: 600;
  }

  .marking-answers-table .marking-table__group-footer td[data-label=""]:first-child::before,
  .marking-answers-table .marking-table__stem-row td::before {
    display: none;
  }

  .marking-answers-table tr.marking-table__total-row td:empty,
  .marking-answers-table tr.gar-marking-total td:empty {
    display: none;
  }

  .marking-answers-table tr.marking-table__total-row,
  .marking-answers-table tr.gar-marking-total {
    margin-top: 0.5rem;
    border-width: 1px;
  }

  .marking-answers-table .marking-table__cell--total-value {
    font-size: 1.1rem;
    font-weight: 800;
  }

  .marking-table__feedback-input {
    min-height: 5rem;
  }

  .gar-marking-actions,
  .car-mark-actions {
    margin-top: 1rem;
  }

  .gar-marking-actions .btn-primary,
  .car-mark-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .marking-answers-table {
    min-width: 48rem;
  }
}

@media (max-width: 767px) {
  .assessments-index table.data-table tbody .assessments-index__actions,
  .reports-index table.data-table tbody .reports-index__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem;
  }

  table.data-table .assessment-icon-link,
  table.data-table .contact-icon-link,
  table.data-table .student-icon-link,
  table.data-table .group-icon-link,
  table.data-table .question-icon-link {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Results tabs: scroll on narrow screens ── */
@media (max-width: 639px) {
  .contact-assessment-results .contact-results-tabs,
  .group-assessment-results .group-results-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    gap: 0.35rem;
    scrollbar-width: thin;
  }

  .contact-assessment-results .contact-results-tabs [role="tab"],
  .group-assessment-results .group-results-tabs [role="tab"] {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .contact-assessment-results__body,
  .group-assessment-results__body {
    padding: 1rem 0.85rem 1.25rem;
  }
}

/* ── Modals & dialogs ── */
@media (max-width: 639px) {
  dialog,
  .generation-loading-modal {
    width: calc(100vw - 1.5rem) !important;
    max-width: calc(100vw - 1.5rem) !important;
    margin: auto;
    box-sizing: border-box;
  }

  .assessment-remark-dialog__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .assessment-remark-dialog__actions .ar-btn,
  .assessment-remark-dialog__actions button {
    width: 100%;
    justify-content: center;
  }
}

/* ── Bulk sidebars (stack below content on small screens) ── */
@media (max-width: 1023px) {
  .sf-bulk-sidebar,
  .figures-index__sidebar {
    position: static;
    width: 100%;
    max-width: none;
  }
}

/* ── Form rows (generic two-column fields) ── */
@media (max-width: 639px) {
  .form-row,
  .form-grid--two,
  .settings-form__row--two {
    grid-template-columns: 1fr !important;
  }
}

/* ── Insight / chart overflow ── */
.insight-horizontal-bars,
.car-insight-split__chart,
.gar-score-distribution,
.chart-card__body canvas {
  max-width: 100%;
}

.insight-horizontal-bars__track {
  min-width: 0;
}

/* ==========================================================================
   Pagination (Kaminari + per-page controls)
   ========================================================================== */

@media (max-width: 767px) {
  .students-index__pagination-bar,
  .questions-index__pagination-bar,
  .sf-pagination-wrap,
  .bl-pagination,
  .pagination-footer,
  .figures-index__footer .students-index__pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .students-index__pagination-bar > div:has(.kaminari-pager),
  .bl-pagination > div:has(.kaminari-pager),
  .bl-pagination > .kaminari-pager,
  .sf-pagination-wrap > div:has(.kaminari-pager) {
    width: 100%;
    justify-content: center;
  }

  .pagination-per-page-group {
    width: 100%;
  }

  .pagination-per-page-form {
    flex-wrap: wrap;
    width: 100%;
  }
}

@media (max-width: 639px) {
  .kaminari-pager__pages {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 100%;
    padding-bottom: 0.15rem;
  }
}

@media (max-width: 479px) {
  .pagination-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .kaminari-pager__btn,
  .kaminari-pager__page {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   Index list view (students, contacts, groups, questions, …)
   ========================================================================== */

.students-index,
.contacts-index,
.groups-index,
.questions-index,
.assessments-index,
.reports-index,
.figures-index {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.index-list-table-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Legacy wide list tables (prefer page-specific list-table classes) */
.index-list-table--wide {
  min-width: 58rem;
}

@media (max-width: 767px) {
  .students-index,
  .contacts-index,
  .groups-index,
  .questions-index,
  .assessments-index,
  .reports-index {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .students-index__header {
    margin-bottom: 1rem;
  }

  .students-index__title {
    font-size: 1.2rem;
  }

  .students-index__btn-row {
    width: 100%;
  }

  .students-index__btn {
    flex: 1 1 auto;
    min-height: 40px;
  }

  .students-index__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .students-index__filters-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .students-index__search-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .students-index__select {
    width: 100%;
    max-width: 100%;
  }

  .students-index__view-toggle {
    width: 100%;
    justify-content: stretch;
  }

  .students-index__view-btn {
    flex: 1;
    justify-content: center;
    min-height: 40px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .students-index__alpha-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding-bottom: 0.35rem;
  }

  .students-index__alpha-btn {
    flex-shrink: 0;
  }

  .groups-index__tag-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    max-width: 100%;
  }

  .groups-index__tag-row .groups-index__tag {
    flex-shrink: 0;
  }

  .questions-index__bulk-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .questions-index__bulk-bar-start {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .questions-index__bulk-summary {
    flex: 1 1 100%;
    line-height: 1.45;
  }

  .questions-index__layout {
    flex-direction: column;
  }

  .questions-index__main {
    min-width: 0;
    width: 100%;
  }

  .questions-index__sidebar {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    position: static;
    top: auto;
  }

  .questions-index__main {
    min-width: 0;
  }

  .questions-index .questions-index__grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 1rem;
    min-width: 0;
    width: 100%;
  }

  .questions-grid-card {
    min-width: 0;
    max-width: 100%;
  }

  .questions-grid-card__body {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow-x: auto;
    word-break: break-word;
  }

  .questions-grid-card__body mjx-container {
    max-width: 100% !important;
    overflow-x: auto;
  }

  .questions-grid-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .questions-grid-card__meta {
    flex-wrap: wrap;
    align-items: baseline;
    row-gap: 0.25rem;
    min-width: 0;
  }

  .questions-grid-card__author {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .questions-grid-card__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .questions-index .questions-grid-card a.question-icon-link.students-index__action-btn,
  .questions-index .questions-grid-card button.students-index__action-btn {
    min-width: 40px;
    min-height: 40px;
  }

  /* Card-style rows for standard list tables */
  .index-list-table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
    border-radius: 0;
  }

  .index-list-table:not(.index-list-table--wide) {
    min-width: 0 !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0 0.65rem;
  }

  .index-list-table:not(.index-list-table--wide) thead {
    display: none;
  }

  .index-list-table:not(.index-list-table--wide) tbody tr {
    display: block;
    border: 0.5px solid var(--st-border-tertiary);
    border-radius: var(--st-radius-md);
    background: var(--st-bg-primary);
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
    overflow: hidden;
  }

  .index-list-table:not(.index-list-table--wide) tbody tr:hover {
    background: var(--st-bg-primary);
  }

  .index-list-table:not(.index-list-table--wide) tbody td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    border: none;
    border-bottom: 0.5px solid var(--st-border-tertiary);
    padding: 0.6rem 0.85rem;
    white-space: normal !important;
    text-align: left !important;
  }

  .index-list-table:not(.index-list-table--wide) tbody td:last-child {
    border-bottom: none;
  }

  .index-list-table:not(.index-list-table--wide) tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-text-tertiary);
  }

  .index-list-table:not(.index-list-table--wide) tbody td[data-label=""]::before {
    display: none;
  }

  .index-list-table:not(.index-list-table--wide) .students-index__td--check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Row checkboxes: never show bulk “select all” copy as a field label */
  .index-list-table:not(.index-list-table--wide) tbody td.students-index__td--check::before,
  .index-list-table:not(.index-list-table--wide) tbody td.students-index__td--check[data-label]::before {
    display: none !important;
    content: none !important;
  }

  .index-list-table:not(.index-list-table--wide) .students-index__td--actions,
  .index-list-table:not(.index-list-table--wide) .contacts-index__actions,
  .index-list-table:not(.index-list-table--wide) .groups-index__actions,
  .index-list-table:not(.index-list-table--wide) .reports-index__list-cell--actions {
    padding-top: 0.5rem;
  }

  .index-list-table:not(.index-list-table--wide) .students-index__actions,
  .index-list-table:not(.index-list-table--wide) .contacts-index__actions,
  .index-list-table:not(.index-list-table--wide) .groups-index__actions,
  .index-list-table:not(.index-list-table--wide) .reports-index__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .index-list-table:not(.index-list-table--wide) .students-index__action-btn,
  .index-list-table:not(.index-list-table--wide) .contacts-index__icon-btn,
  .index-list-table:not(.index-list-table--wide) .groups-index__icon-btn,
  .index-list-table:not(.index-list-table--wide) .reports-index__icon-btn {
    min-width: 40px;
    min-height: 40px;
  }

  .index-list-table:not(.index-list-table--wide) .groups-index__inline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  /* Wide tables: keep scroll inside wrapper */
  .index-list-table-wrap:has(.index-list-table--wide) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 0.5px solid var(--st-border-tertiary);
    border-radius: var(--st-radius-lg);
    background: var(--st-bg-primary);
  }

  .assessments-index table.data-table tbody .assessments-index__actions,
  .reports-index table.data-table tbody .reports-index__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* Assessments list: card layout (title-first, similar to grid cards) */
  .assessments-index .assessments-index__list-table {
    min-width: 0 !important;
  }

  .assessments-index .assessments-index__list-row {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 0.35rem;
    border-left-width: 3px;
    border-left-style: solid;
  }

  .assessments-index .assessments-index__list-row--draft {
    border-left-color: var(--st-border-secondary);
  }

  .assessments-index .assessments-index__list-row--ready {
    border-left-color: #0e7490;
  }

  .assessments-index .assessments-index__list-row--active,
  .assessments-index .assessments-index__list-row--completed {
    border-left-color: #16a34a;
  }

  .assessments-index .assessments-index__list-row--closed {
    border-left-color: #dc2626;
  }

  .assessments-index .assessments-index__list-row--ended {
    border-left-color: #ea580c;
  }

  .assessments-index .assessments-index__list-cell--check {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    order: 99;
  }

  .assessments-index .assessments-index__list-cell--check::before {
    display: none !important;
    content: none !important;
  }

  .assessments-index .assessments-index__list-bulk-bar {
    margin-bottom: 0.75rem;
  }

  .assessments-index .assessments-index__list-cell--ref {
    order: 1;
    padding-top: 0.5rem !important;
    padding-right: 2.75rem !important;
    padding-bottom: 0.25rem !important;
    border-bottom: none !important;
  }

  .assessments-index .assessments-index__list-cell--title {
    order: 2;
    padding-top: 0 !important;
    padding-bottom: 0.5rem !important;
    border-bottom: none !important;
  }

  .assessments-index .assessments-index__list-cell--title::before {
    display: none;
  }

  .assessments-index .assessments-index__list-title-link {
    font-size: 1.02rem;
    line-height: 1.35;
    display: block;
  }

  .assessments-index .assessments-index__list-cell--status {
    order: 3;
    padding-top: 0 !important;
    padding-bottom: 0.65rem !important;
    border-bottom: 0.5px solid var(--st-border-tertiary) !important;
  }

  .assessments-index .assessments-index__list-cell--status::before {
    display: none;
  }

  .assessments-index .assessments-index__list-cell--status .assessments-index__statuses {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .assessments-index .assessments-index__list-cell--tags {
    order: 4;
  }

  .assessments-index .assessments-index__td--author.assessments-index__list-cell--meta {
    order: 5;
  }

  .assessments-index .assessments-index__td--created.assessments-index__list-cell--meta {
    order: 6;
  }

  .assessments-index .assessments-index__td--marks.assessments-index__list-cell--meta {
    order: 7;
  }

  .assessments-index .assessments-index__td--time.assessments-index__list-cell--meta {
    order: 8;
  }

  .assessments-index .assessments-index__list-cell--actions {
    order: 9;
    padding-top: 0.65rem !important;
    background: var(--st-bg-secondary);
  }

  .assessments-index .assessments-index__list-cell--actions::before {
    display: none;
  }

  .assessments-index .assessments-index__list-cell--actions .assessments-index__actions {
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .assessments-index .assessments-index__list-cell--actions .assessments-index__icon-btn {
    min-width: 42px;
    min-height: 42px;
  }

  /* Reports list: card layout */
  .reports-index .reports-index__list-table {
    min-width: 0 !important;
  }

  .reports-index .reports-index__list-bulk-bar {
    margin-bottom: 0.75rem;
  }

  .reports-index .reports-index__list-row {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 0.35rem;
  }

  .reports-index .reports-index__list-cell--check {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    order: 99;
  }

  .reports-index .reports-index__list-cell--check::before {
    display: none !important;
    content: none !important;
  }

  .reports-index .reports-index__list-cell--ref {
    order: 1;
    padding-top: 0.5rem !important;
    padding-right: 2.75rem !important;
    padding-bottom: 0.25rem !important;
    border-bottom: none !important;
  }

  .reports-index .reports-index__list-cell--title {
    order: 2;
    padding-top: 0 !important;
    padding-bottom: 0.35rem !important;
    border-bottom: none !important;
  }

  .reports-index .reports-index__list-cell--title::before {
    display: none;
  }

  .reports-index .reports-index__list-title {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
    display: block;
    word-break: break-word;
  }

  .reports-index .reports-index__list-cell--student {
    order: 3;
  }

  .reports-index .reports-index__list-student-link {
    font-weight: 600;
  }

  .reports-index .reports-index__list-cell--assessment {
    order: 4;
  }

  .reports-index .reports-index__list-assessment-link {
    display: block;
    word-break: break-word;
  }

  .reports-index .reports-index__list-cell--meta {
    order: 5;
  }

  .reports-index .reports-index__td--created.reports-index__list-cell--meta {
    order: 6;
  }

  .reports-index .reports-index__td--emailed.reports-index__list-cell--meta {
    order: 7;
  }

  .reports-index .reports-index__list-cell--actions {
    order: 8;
    padding-top: 0.65rem !important;
    background: var(--st-bg-secondary);
  }

  .reports-index .reports-index__list-cell--actions::before {
    display: none;
  }
}

/* Tablet: horizontal scroll for wide index tables (readable columns) */
@media (min-width: 768px) and (max-width: 1023px) {
  .assessments-index .index-list-table-wrap:has(.assessments-index__list-table),
  .reports-index .index-list-table-wrap:has(.reports-index__list-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 0.5px solid var(--st-border-tertiary);
    border-radius: var(--st-radius-lg);
    background: var(--st-bg-primary);
  }

  .assessments-index .assessments-index__list-table {
    min-width: 48rem;
  }

  .reports-index .reports-index__list-table {
    min-width: 52rem;
  }
}

/* ==========================================================================
   Billing sub-pages (email logs, credit usage)
   ========================================================================== */

@media (max-width: 767px) {
  .bl-page {
    gap: 0.85rem;
    max-width: 100%;
    min-width: 0;
  }

  .bl-page__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .bl-page__title {
    font-size: 1.2rem;
  }

  .bl-page__subtitle {
    line-height: 1.4;
  }

  .bl-page__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .bl-page__actions .bl-btn {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
    min-height: 40px;
    white-space: normal;
    text-align: center;
  }

  .bl-warning {
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .bl-section-label--spaced {
    margin-top: 1.25rem;
  }

  .bl-intro {
    line-height: 1.45;
  }

  .bl-table-wrap {
    overflow-x: visible;
    padding: 0.65rem;
  }

  .bl-table--stacked {
    min-width: 0 !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0 0.65rem;
  }

  .bl-table--stacked thead {
    display: none;
  }

  .bl-table--stacked tbody tr {
    display: block;
    border: 0.5px solid var(--st-border-tertiary);
    border-radius: var(--st-radius-md);
    background: var(--st-bg-primary);
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
    overflow: hidden;
  }

  .bl-table--stacked tbody tr.bl-table__row {
    border-top: 0.5px solid var(--st-border-tertiary);
  }

  .bl-table--stacked tbody td {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
    border: none;
    border-bottom: 0.5px solid var(--st-border-tertiary);
    padding: 0.6rem 0.85rem;
    white-space: normal !important;
    text-align: left !important;
  }

  .bl-table--stacked tbody td:last-child {
    border-bottom: none;
  }

  .bl-table--stacked tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-text-tertiary);
  }

  .bl-table--stacked .bl-table__td--nowrap {
    white-space: normal !important;
  }

  .bl-table--stacked .bl-table__td--subject {
    word-break: break-word;
  }

  .bl-table--stacked .bl-table__td--muted,
  .bl-table--stacked .bl-table__td--break {
    word-break: break-word;
  }

  .bl-status-detail {
    word-break: break-word;
  }

  .bl-pagination {
    padding: 0.75rem 0.65rem 0.85rem;
  }
}

/* ==========================================================================
   Support requests (/support)
   ========================================================================== */

@media (max-width: 767px) {
  .sr-page {
    gap: 1rem;
    max-width: 100%;
    min-width: 0;
  }

  .sr-page__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sr-page__title {
    font-size: 1.2rem;
    word-break: break-word;
  }

  .sr-page__subtitle {
    line-height: 1.4;
  }

  .sr-page__title-row {
    align-items: flex-start;
    min-width: 0;
  }

  .sr-page__title-row > div:last-child {
    min-width: 0;
  }

  .sr-page__header > .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .sr-page__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .sr-page__actions .btn-primary,
  .sr-page__actions .bl-btn {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
    min-height: 40px;
    text-align: center;
  }

  .sr-access-card {
    padding: 0.85rem 1rem;
  }

  .sr-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .sr-filters__select {
    width: 100%;
    max-width: none;
  }

  .sr-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .sr-actions .nav-link,
  .sr-actions .group-icon-link {
    min-width: 40px;
    min-height: 40px;
  }

  .bl-table--stacked .bl-table__td strong {
    word-break: break-word;
  }

  .sr-meta-card {
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
  }

  .sr-meta-card__item {
    width: 100%;
  }

  .sr-body-card,
  .sr-attachments,
  .sr-reply-card,
  .sr-edit-card {
    padding: 1rem;
  }

  .sr-body-card__pre,
  .sr-comment__body {
    word-break: break-word;
    overflow-x: auto;
  }

  .sr-comment__meta {
    line-height: 1.4;
  }

  .sr-reply-card__textarea {
    width: 100%;
    box-sizing: border-box;
  }

  .sr-reply-card .btn-primary,
  .sr-edit-card__actions .btn-primary,
  .sr-edit-card__actions .bl-btn {
    width: 100%;
    justify-content: center;
  }

  .sr-edit-card__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .sr-danger-zone {
    max-width: none;
  }

  .sr-danger-zone__btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .support-request-form__field-title .support-request-form__title-input {
    max-width: none;
  }

  .support-request-form__card.auth-card {
    padding: 1rem;
  }
}

/* ==========================================================================
   School years (/school_years)
   ========================================================================== */

@media (max-width: 767px) {
  .sy-page {
    gap: 1rem;
    max-width: 100%;
    min-width: 0;
  }

  .sy-page__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sy-page__title {
    font-size: 1.2rem;
    word-break: break-word;
  }

  .sy-page__subtitle {
    line-height: 1.4;
  }

  .sy-page__title-row {
    align-items: flex-start;
    min-width: 0;
  }

  .sy-page__title-row > div:last-child {
    min-width: 0;
  }

  .sy-page__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .sy-page__actions .ar-btn,
  .sy-page__actions .btn-primary {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
    min-height: 40px;
    text-align: center;
  }

  .sy-page__header > .ar-btn {
    width: 100%;
    justify-content: center;
  }

  .sy-rollover-help {
    padding: 0.85rem 1rem;
  }

  .sy-rollover-help__body {
    word-break: break-word;
  }

  .sy-row__actions {
    text-align: left !important;
    white-space: normal;
  }

  .sy-row__actions .sy-action-link {
    display: inline-block;
    margin: 0.15rem 0.35rem 0.15rem 0;
  }

  .sy-form-card {
    max-width: none;
    padding: 1rem;
  }

  .sy-form__input--name {
    max-width: none;
  }

  .sy-form__date-row {
    flex-direction: column;
    gap: 0;
  }

  .sy-form__date-row > .sy-form__field {
    flex: 1 1 auto;
    width: 100%;
  }

  .sy-form-card .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .sy-show__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .sy-show__actions-sep {
    display: none;
  }

  .sy-show__actions .nav-link {
    padding: 0.45rem 0;
  }

  .sy-show__periods-card {
    padding: 1rem;
  }

  .sy-show__term-actions {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Settings files (/settings/files)
   ========================================================================== */

@media (max-width: 1023px) {
  .sf-files-layout {
    flex-direction: column;
  }

  .sf-files-layout__main {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .settings-files-index.stg-page {
    gap: 1rem;
  }

  .settings-files-index .stg-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .settings-files-index .stg-header__title {
    font-size: 1.2rem;
    word-break: break-word;
  }

  .settings-files-index .stg-header__subtitle {
    line-height: 1.4;
  }

  .settings-files-index .stg-header__title-row {
    align-items: flex-start;
    min-width: 0;
  }

  .settings-files-index .stg-header__title-row > div:last-child {
    min-width: 0;
  }

  .settings-files-index .stg-header > .ar-btn {
    width: 100%;
    justify-content: center;
  }

  .sf-storage-card {
    padding: 0.85rem 1rem;
    margin-bottom: 0;
  }

  .sf-storage-card__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .sf-storage-card__usage {
    text-align: left;
    line-height: 1.45;
  }

  .sf-storage-card__breakdown-sep {
    display: none;
  }

  .sf-storage-card__breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }

  .settings-files__bulk-bar {
    margin-bottom: 0.65rem;
  }

  .bl-table--stacked.settings-files__table .settings-files__td--check::before {
    display: none !important;
    content: none !important;
  }

  .bl-table--stacked.settings-files__table .settings-files__td--check {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 0.45rem;
    border-bottom: none;
  }
}

/* ==========================================================================
   Settings users (/settings/users)
   ========================================================================== */

@media (max-width: 767px) {
  .settings-users-index.stg-page {
    gap: 1rem;
  }

  .settings-users-index .stg-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .settings-users-index .stg-header__title {
    font-size: 1.2rem;
    word-break: break-word;
  }

  .settings-users-index .stg-header__subtitle {
    line-height: 1.4;
  }

  .settings-users-index .stg-header__title-row {
    align-items: flex-start;
    min-width: 0;
  }

  .settings-users-index .stg-header__title-row > div:last-child {
    min-width: 0;
  }

  .settings-users-index .stg-header > .ar-btn {
    width: 100%;
    justify-content: center;
  }

  .settings-users-index .su-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .settings-users-index .su-search-form {
    width: 100%;
    flex: 1 1 auto;
  }

  .settings-users-index .su-search {
    min-width: 0;
  }

  .settings-users-index .su-role-filters {
    width: 100%;
  }

  .settings-users-index .su-role-pill {
    flex: 1 1 calc(50% - 0.2rem);
    justify-content: center;
    text-align: center;
  }

  .settings-users-index .su-actions {
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .settings-users-index .su-action-form {
    display: block;
    width: 100%;
  }

  .settings-users-index .su-action-btn {
    width: 100%;
    justify-content: center;
    min-height: 36px;
  }

  .bl-table--stacked.settings-users__table .bl-table__td--actions {
    padding-top: 0.5rem;
  }
}

/* Questions grid: sidebar beside main squeezes cards on tablet — stack earlier */
@media (min-width: 768px) and (max-width: 1023px) {
  .questions-index__layout {
    flex-direction: column;
  }

  .questions-index__sidebar {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    position: static;
  }

  .questions-index__main {
    min-width: 0;
    width: 100%;
  }

  .questions-index .questions-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 1.25rem;
  }
}

/* ==========================================================================
   Group show — members tab & page chrome
   ========================================================================== */

@media (max-width: 767px) {
  .groups-show .dashboard-header {
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .groups-show .dashboard-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .groups-show .gs-tags-wrap {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .groups-show .auth-card.groups-show__main {
    min-width: 0;
    overflow: hidden;
  }

  .groups-show .groups-show__body {
    padding: 0.75rem;
  }

  .groups-show__tabs-bar {
    gap: 0.35rem 0.5rem;
    padding: 0.65rem 0.75rem;
  }

  .groups-show__tabs-bar .cp-tab {
    font-size: 0.8125rem;
    padding: 0.4rem 0.65rem;
  }

  .groups-show .gm-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
  }

  .groups-show .gm-search-wrap {
    max-width: none;
    width: 100%;
  }

  .groups-show .gm-add-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  .groups-show .gm-list {
    gap: 0.65rem;
  }

  .groups-show .gm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding: 0.85rem;
    border: 0.5px solid var(--st-border-tertiary);
    background: var(--st-bg-primary);
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  }

  .groups-show .gm-row:hover {
    border-color: var(--st-border-secondary);
  }

  .groups-show .gm-avatar {
    width: 40px;
    height: 40px;
  }

  .groups-show .gm-info {
    flex: 1 1 calc(100% - 52px);
    min-width: 0;
  }

  .groups-show .gm-name,
  .groups-show .gm-email {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .groups-show .gm-enrolment--empty {
    display: none;
  }

  .groups-show .gm-enrolment {
    flex: 1 1 100%;
    white-space: normal;
    line-height: 1.35;
  }

  .groups-show .gm-row .cp-badge {
    flex-shrink: 0;
  }

  .groups-show .gm-view-btn {
    flex: 1 1 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 0.15rem;
    text-align: center;
  }
}

/* ==========================================================================
   Contact show — reports tab & page chrome
   ========================================================================== */

@media (max-width: 767px) {
  .contact-show .contact-show__header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .contact-show__title {
    font-size: 1.25rem;
    word-break: break-word;
  }

  .contact-show__header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .contact-show .auth-card.contact-show__main {
    min-width: 0;
    overflow: hidden;
  }

  .contact-show__body {
    padding: 0.85rem 0.75rem;
  }

  .contact-show__tabs-bar {
    gap: 0.35rem 0.5rem;
    padding: 0.65rem 0.75rem;
  }

  .contact-show__tabs-bar .cp-tab {
    font-size: 0.8125rem;
    padding: 0.4rem 0.65rem;
  }

  .contact-show__reports-tab .cp-tab-heading {
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-word;
  }

  .contact-show__reports-tab .cp-tab-hint {
    line-height: 1.45;
  }

  .contact-show__table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  .contact-show table.data-table--stacked {
    min-width: 0 !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0 0.65rem;
  }

  .contact-show table.data-table--stacked thead {
    display: none;
  }

  .contact-show table.data-table--stacked tbody tr {
    display: block;
    border: 0.5px solid var(--st-border-tertiary);
    border-radius: var(--st-radius-md);
    background: var(--st-bg-primary);
    box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
    overflow: hidden;
  }

  .contact-show table.data-table--stacked tbody tr:hover {
    background: var(--st-bg-primary);
  }

  .contact-show table.data-table--stacked tbody td {
    display: block;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
    border: none;
    border-bottom: 0.5px solid var(--st-border-tertiary);
    padding: 0.6rem 0.85rem;
    white-space: normal !important;
    text-align: left !important;
  }

  .contact-show table.data-table--stacked tbody td:last-child {
    border-bottom: none;
  }

  .contact-show table.data-table--stacked tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-text-tertiary);
  }

  .contact-show table.data-table--stacked tbody td.contact-show__td--actions {
    padding-top: 0.5rem;
  }

  .contact-show table.data-table--stacked .contact-show__table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .contact-show table.data-table--stacked .contact-icon-link.contact-show__icon-btn,
  .contact-show table.data-table--stacked button.contact-show__icon-btn {
    width: 40px;
    height: 40px;
  }

  .contact-show table.data-table--stacked .contact-show__table-link,
  .contact-show table.data-table--stacked .contact-show__td--subject {
    word-break: break-word;
  }

  .contact-show .auth-card.contact-show__sidebar {
    min-width: 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .contact-show__table-wrap:has(.contact-show__reports-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contact-show table.contact-show__reports-table {
    min-width: 44rem;
  }
}

@media (max-width: 479px) {
  .students-index__view-btn {
    font-size: 0.7rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .students-index__view-btn .students-index__view-icon {
    display: none;
  }

  .groups-show__tabs-bar .cp-tab {
    flex: 1 1 calc(50% - 0.25rem);
    text-align: center;
    min-width: 0;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
/* =========================
   AUTH PAGES (LOGIN / SIGNUP)
   ========================= */

html, body {
  height: 100%;
  margin: 0;
}

/* Signed-in app only — auth pages override height/background below */
body:not(.auth-body) {
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

body {
  margin: 0;
}

/* Warm accent tokens (Create Group / index primary actions) */
:root {
  --st-canvas:        #f9f8f4;
  --st-bg-primary:    #ffffff;
  --st-bg-secondary:  #f3f0ea;
  --st-border-secondary: #ddd8cf;
  --st-border-mid:       #c9c0b4;
  --st-border-tertiary:  #e8e4dc;
  --st-text-primary:   #1c1917;
  --st-text-secondary: #57534e;
  --st-text-tertiary:  #a8a29e;
  --st-accent:         #5c5346;
  --st-accent-strong:  #433a32;
  --st-accent-hover:   #4a4238;
  --st-accent-soft:    #8a7d6e;
  --st-radius-sm: 6px;
  --st-radius-md: 8px;
  --st-radius-lg: 12px;

  /* Sign-in / sign-up / password (matches transactional email palette) */
  --auth-exec-page-bg: #f3efe8;
  --auth-exec-card-border: #e8e2d9;
  --auth-exec-heading: #2c2825;
  --auth-exec-text: #3d3834;
  --auth-exec-muted: #6b6560;
  --auth-exec-accent: #8b7355;
  --auth-exec-accent-hover: #756048;
  --auth-exec-accent-ring: rgba(139, 115, 85, 0.22);
  --auth-exec-header-band: #c4b8a4;
  --auth-exec-cta: #433a32;
  --auth-exec-cta-hover: #352e28;
  --auth-exec-cta-shadow: rgba(44, 40, 37, 0.24);
}

.main-content {
  flex: 1;
}

.auth-html,
html:has(body.auth-body) {
  min-height: 100%;
  min-height: 100dvh;
  height: auto;
  background-color: var(--auth-exec-page-bg);
}

.auth-body {
  display: block;
  min-height: 100%;
  min-height: 100dvh;
  height: auto;
  background-color: var(--auth-exec-page-bg);
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  color: var(--auth-exec-text);
}

.auth-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem clamp(2.5rem, 6vw, 4rem);
  box-sizing: border-box;
}

.auth-body .auth-card {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid var(--auth-exec-card-border);
  border-top: 4px solid var(--auth-exec-header-band);
  box-shadow: 0 4px 24px rgba(44, 40, 37, 0.06);
  padding: 2rem 2.25rem 2.25rem;
}

.auth-card {
  background: white;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  padding: 2rem 2.25rem 2.25rem;
}

.auth-logo {
  --auth-logo-max-height: clamp(100px, 24vw, 180px);
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-logo--large {
  --auth-logo-max-height: clamp(120px, 32vw, 300px);
}

.auth-container--sign-in {
  max-width: 480px;
}

.auth-logo__img,
.auth-logo img {
  display: block;
  margin-inline: auto;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: var(--auth-logo-max-height);
  object-fit: contain;
}

.auth-body .auth-card h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: var(--auth-exec-heading);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-card h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.auth-page__title {
  text-align: center;
  font-size: 1.4rem;
  margin: 0 0 1.25rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 600;
  color: var(--auth-exec-heading);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.auth-page__intro {
  margin: -0.65rem 0 1.15rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--auth-exec-muted);
}

.auth-body .auth-page__title {
  color: var(--auth-exec-heading);
}

/* Sign-up: split brand panel + sectioned form */
.auth-body--signup {
  background-color: var(--auth-exec-page-bg);
}

.auth-signup {
  display: grid;
  min-height: 100dvh;
  align-content: start;
  grid-template-columns: minmax(260px, 5fr) minmax(320px, 7fr);
  align-items: stretch;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  box-sizing: border-box;
}

.auth-signup__brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  min-width: 0;
  overflow-x: clip;
  padding: clamp(1.25rem, 3vh, 2rem) clamp(0.85rem, 1.5vw, 1.15rem) 0 clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(165deg, #c4b8a4 0%, #b0a08a 52%, #9a8870 100%);
  color: var(--auth-exec-heading);
}

.auth-signup__brand-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-signup__brand-divider {
  flex-shrink: 0;
  height: 1px;
  margin: 0.7rem 1.15rem;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.55) 18%,
    rgba(255, 255, 255, 0.55) 82%,
    transparent
  );
}

.auth-signup__logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 1rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 20px rgba(44, 40, 37, 0.08);
  box-sizing: border-box;
}

.auth-signup__logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 2px 12px rgba(44, 40, 37, 0.16));
}

.auth-signup__benefits-wrap {
  width: 100%;
  max-width: 100%;
  padding: 1.2rem 1.35rem 1.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 4px 20px rgba(44, 40, 37, 0.08);
  box-sizing: border-box;
}

.auth-signup__benefits-heading {
  margin: 0 0 0.95rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-align: center;
  color: var(--auth-exec-accent);
}

.auth-signup__benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.auth-signup__benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  text-align: left;
}

.auth-signup__benefits li:last-child {
  margin-bottom: 0;
}

.auth-signup__benefit-marker {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: var(--auth-exec-accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(139, 115, 85, 0.35);
}

.auth-signup__benefit-text {
  flex: 1;
  font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--auth-exec-heading);
}

.auth-signup__main {
  display: contents;
}

.auth-signup__card {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  width: 100%;
  max-width: 580px;
  justify-self: center;
  margin: 0;
  box-sizing: border-box;
}

.auth-body--signup .auth-signup__card.auth-card {
  background: #ffffff;
  border: 1px solid var(--auth-exec-card-border);
  border-top: 4px solid var(--auth-exec-header-band);
  border-radius: 12px;
  padding: 1.75rem 1.75rem 1.35rem;
  box-shadow:
    0 4px 24px rgba(44, 40, 37, 0.08),
    0 1px 3px rgba(44, 40, 37, 0.05);
}

.auth-signup__header {
  margin-bottom: 1rem;
}

.auth-signup__title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--auth-exec-heading);
  margin: 0 0 0.25rem;
  text-align: left;
  letter-spacing: 0.01em;
}

.auth-signup__subtitle {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--auth-exec-text);
}

.auth-signup-form .field {
  margin-bottom: 0.75rem;
}

.auth-signup-form label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--auth-exec-heading);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.auth-signup-form__section {
  margin-bottom: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--auth-exec-card-border);
}

.auth-signup-form__section + .auth-signup-form__section {
  margin-top: 0.85rem;
}

.auth-signup-form__section:last-of-type {
  padding-bottom: 0;
  border-bottom: none;
}

.auth-signup-form__section .field:last-child,
.auth-signup-form__section .auth-signup-form__row:last-child {
  margin-bottom: 0;
}

.auth-signup-form__section-title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-exec-accent);
}

.auth-signup-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.85rem;
  margin-bottom: 0;
}

.auth-signup-form__row > .field,
.auth-signup-form__row > .field.field--password-toggle {
  margin-bottom: 0;
}

.auth-signup-form__row + .field,
.auth-signup-form__row + .field.field--password-toggle {
  margin-top: 0.55rem;
}

.auth-signup-form .password-requirements-hint {
  margin-bottom: 0.55rem;
}

.auth-signup-form .field--hcaptcha {
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
}

.auth-signup-form__actions {
  margin-top: 0.85rem;
}

.auth-signup-form__actions input[type="submit"] {
  margin-top: 0;
}

.auth-signup__footer-link {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--auth-exec-card-border);
  text-align: center;
}

.auth-body--signup .auth-signup__title {
  text-align: left;
}

@media (max-width: 960px) {
  .auth-signup {
    grid-template-columns: 1fr;
    padding: 1.35rem 1.25rem 1.25rem;
  }

  .auth-signup__brand {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-content: flex-start;
    align-items: stretch;
    padding: clamp(1rem, 2.5vh, 1.5rem) 0 0;
  }

  .auth-signup__main {
    display: block;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    margin-top: 0.85rem;
  }

  .auth-signup__card {
    grid-column: auto;
    grid-row: auto;
    max-width: none;
    justify-self: stretch;
  }

  .auth-signup__brand-stack {
    max-width: none;
  }

  .auth-signup__logo-wrap {
    padding: 0.75rem 0.5rem;
  }

  .auth-signup__logo {
    width: 100%;
    max-width: min(100%, 440px);
    margin-inline: auto;
  }

  .auth-signup__benefits-wrap {
    padding: 1rem 1.1rem;
  }

  .auth-signup__benefit-text {
    font-size: 0.925rem;
  }

  .auth-signup__benefits {
    display: grid;
    gap: 0.5rem;
  }

  .auth-signup__benefits li {
    margin-bottom: 0;
  }
}

@media (max-width: 540px) {
  .auth-signup-form__row {
    grid-template-columns: 1fr;
  }
}

/* Assessment → group allocation (drag & drop) */
/* ── Assign Groups page ── */

/* Keep the grid class for the Stimulus controller data-zone layout */
.assessment-assign-groups__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 768px) {
  .assessment-assign-groups__grid {
    grid-template-columns: 1fr;
  }
}

/* Assessment form: email reports toggle only when auto-generate is on */
.assessments-form__card--options .auto-reports-email {
  display: none;
}

.assessments-form__card--options:has(#assessment_auto_generate_reports:checked) .auto-reports-email {
  display: flex;
}

/* Page layout */
.ag-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Header */
.ag-page__breadcrumb {
  margin-bottom: 0.75rem;
}

.ag-page__back-link {
  font-size: 0.8rem;
  color: var(--st-text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.ag-page__back-link:hover {
  color: var(--st-accent);
  text-decoration: underline;
}

.ag-page__title-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.ag-page__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #dcfce7;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ag-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--st-text-primary);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.ag-page__subtitle {
  font-size: 0.85rem;
  color: var(--st-text-secondary);
  margin: 0;
}

/* Assessment info bar */
.ag-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #fff;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.ag-info-bar__left {}

.ag-info-bar__title-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--st-text-primary);
  text-decoration: none;
  padding: 0;
  font-size: inherit;
}

.ag-info-bar__title-link:hover {
  color: var(--st-accent);
  text-decoration: underline;
}

.ag-info-bar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ag-info-bar__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
}

.ag-info-bar__meta--scheduled {
  color: #92400e;
}

/* Cards */
.ag-card {
  background: #fff;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  overflow: hidden;
}

.ag-card__header {
  padding: 0.65rem 1.25rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  background: #faf8f5;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ag-card__section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ag-card__body {
  padding: 1.25rem;
}

.ag-card__desc {
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.ag-card__hint {
  font-size: 0.78rem;
  color: var(--st-text-tertiary);
  margin: 0.65rem 0 0;
}

.ag-card__error {
  font-size: 0.85rem;
  color: #b45309;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.85rem;
  background: #fffbeb;
  border: 0.5px solid #fde68a;
  border-radius: var(--st-radius-md);
}

.ag-card__warning {
  font-size: 0.85rem;
  color: #b45309;
  margin: 0;
  padding: 0.6rem 0.85rem;
  background: #fffbeb;
  border: 0.5px solid #fde68a;
  border-radius: var(--st-radius-md);
  display: inline-block;
}

.ag-card__list {
  font-size: 0.875rem;
  color: var(--st-text-primary);
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.65;
}

.ag-card--danger .ag-card__header {
  background: #fff5f5;
  border-bottom-color: #fecaca;
}

.ag-card--danger .ag-card__section-label {
  color: #b91c1c;
}

/* Panels */
.ag-panel {
  min-height: 13rem;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  background: var(--st-bg-secondary);
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.ag-panel.dropzone-active {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.18);
  background: #f0fdf4;
}

.ag-panel--assigned {
  background: #fff;
}

.ag-panel__header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.ag-panel__icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ag-panel__icon--available {
  background: #f1f5f9;
  color: var(--st-text-secondary);
}

.ag-panel__icon--assigned {
  background: #dcfce7;
  color: #15803d;
}

.ag-panel__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--st-text-primary);
  margin-bottom: 0.15rem;
}

.ag-panel__hint {
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  margin: 0;
  line-height: 1.4;
}

.ag-panel__list {
  padding: 0.75rem;
}

/* Empty state */
.ag-empty {
  padding: 1.75rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--st-text-tertiary);
  border: 1.5px dashed var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.ag-empty--drop {
  color: #aaa;
}

.ag-empty__link {
  color: var(--st-accent);
  text-decoration: underline;
}

/* Group chips */
.ag-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.45rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-primary);
  cursor: grab;
  font-size: 0.85rem;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.ag-chip:last-child {
  margin-bottom: 0;
}

.ag-chip:hover {
  border-color: var(--st-border-secondary);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.06);
}

.ag-chip.is-dragging {
  opacity: 0.5;
}

.ag-chip--locked {
  opacity: 0.65;
  cursor: default;
}

.ag-chip--assigned {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ag-chip__avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #e8e3db;
  color: #5a5248;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ag-chip__avatar--assigned {
  background: #bbf7d0;
  color: #15803d;
}

.ag-chip__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
}

.ag-chip__label {
  font-weight: 600;
  color: var(--st-text-primary);
  text-decoration: none;
  font-size: 0.85rem;
}

a.ag-chip__label:hover {
  color: var(--st-accent);
  text-decoration: underline;
}

.ag-chip__meta {
  font-size: 0.72rem;
  color: var(--st-text-tertiary);
  white-space: nowrap;
}

.ag-chip__drag-handle {
  color: #ccc;
  font-size: 0.75rem;
  margin-left: auto;
  cursor: grab;
}

.ag-chip__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.3rem;
  border-top: 0.5px solid #bbf7d0;
}

.ag-chip__link-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}

.ag-chip__link-btn:hover {
  text-decoration: underline;
  color: #166534;
}

.ag-chip__remove {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 0.5px solid #bbf7d0;
  background: #fff;
  color: var(--st-text-tertiary);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.ag-chip__remove:hover {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

/* Schedule form */
.ag-schedule-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.ag-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ag-field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.ag-field__input {
  height: 36px;
  padding: 0 0.75rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-secondary);
  font-size: 0.85rem;
  color: var(--st-text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.ag-field__input:focus {
  border-color: #2d6a4f;
  background: #fff;
}

/* Buttons */
.ag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 1.1rem;
  border-radius: var(--st-radius-md);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s;
}

.ag-btn--primary {
  background: #2d6a4f;
  color: #fff;
}

.ag-btn--primary:hover {
  background: #235c42;
}

.ag-btn--send {
  background: #1d4ed8;
  color: #fff;
  height: 38px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.ag-btn--send:hover {
  background: #1e40af;
}

.ag-btn--danger {
  background: #0f172a;
  color: #fff;
  height: 38px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.ag-btn--danger:hover {
  background: #1e293b;
}

/* Organisation settings (edit): two cards side by side; right column can stack MasteryByte + SMTP */
.org-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.org-edit-email-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

@media (max-width: 900px) {
  .org-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* Form fields */
.auth-card .field {
  margin-bottom: 1rem;
}

.auth-card .field--hcaptcha {
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-card label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.auth-card .field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.auth-card .field--checkbox label {
  display: inline;
  margin-bottom: 0;
}

.field--password-toggle .field__password-wrap {
  position: relative;
  display: block;
}

.field--password-toggle .field__password-wrap input[type="password"],
.field--password-toggle .field__password-wrap input[type="text"] {
  width: 100%;
  padding-right: 2.85rem;
  box-sizing: border-box;
}

/* Sign-in: same outer box and padding as password + toggle row (eye sits in the extra right padding). */
.auth-card .field--login-email input[type="email"] {
  padding-right: 2.85rem;
  box-sizing: border-box;
}

.field--password-toggle .field__password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 0;
}

.field--password-toggle .field__password-toggle:hover {
  background: rgba(100, 116, 139, 0.1);
  color: #334155;
}

.field--password-toggle .field__password-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
  border-radius: 8px;
}

.field--password-toggle .field__password-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.field--password-toggle .field__password-toggle-icon--hidden {
  display: none;
}

.field--password-toggle .field__password-toggle-svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="tel"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-card select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  line-height: 1.4;
  background-color: #fff;
  color: #111827;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  box-sizing: border-box;
}

.auth-card input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.auth-card select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* SMTP: Port + Authentication (compact row) */
.auth-card .field--smtp-port-auth {
  display: grid;
  grid-template-columns: minmax(4.75rem, 6.5rem) minmax(0, 10.75rem);
  gap: 0.75rem 1.25rem;
  align-items: end;
}

@media (max-width: 420px) {
  .auth-card .field--smtp-port-auth {
    grid-template-columns: 1fr;
  }
}

.auth-card .field--smtp-port-auth .field--smtp-port label,
.auth-card .field--smtp-port-auth .field--smtp-auth label {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.auth-card .field--smtp-port-auth .field--smtp-port,
.auth-card .field--smtp-port-auth .field--smtp-auth {
  margin-bottom: 0;
}

.auth-card .field--smtp-port-auth input.smtp-port-input[type="number"] {
  width: 100%;
  max-width: 6.5rem;
  box-sizing: border-box;
  padding: 0.5rem 0.45rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: #f8fafc;
}

.auth-card .field--smtp-port-auth input.smtp-port-input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: #fff;
}

.auth-card .field--smtp-port-auth select.smtp-auth-select {
  width: 100%;
  max-width: 10.75rem;
  padding: 0.42rem 1.75rem 0.42rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.8125rem;
  line-height: 1.35;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  box-sizing: border-box;
}

.auth-card .field--smtp-port-auth select.smtp-auth-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Buttons */
.auth-card .actions input[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-accent-strong);
  background: var(--st-accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-card .actions input[type="submit"]:hover {
  background: var(--st-accent-hover);
}

/* SMTP form: compact Save + Verify side by side */
.auth-card .actions.actions--inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  justify-content: flex-start;
}

.auth-card .actions.actions--inline input[type="submit"] {
  width: auto;
  margin-top: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
}

.auth-card .actions.actions--inline input[type="submit"].actions__submit--verify {
  background: #ea580c;
}

.auth-card .actions.actions--inline input[type="submit"].actions__submit--verify:hover {
  background: #c2410c;
}

/* Organisation edit: SMTP help footer (avoid global .nav-link — sized for top bar). */
.smtp-help-card {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.55;
}

.smtp-help-card__intro {
  margin: 0 0 0.65rem;
}

.smtp-help-card__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
}

.smtp-help-card__hint code {
  font-size: 0.78em;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
}

.auth-card .smtp-help-card__support-link {
  display: inline;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  padding: 0;
  margin: 0;
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.35);
  text-underline-offset: 0.12em;
}

.auth-card .smtp-help-card__support-link:hover {
  color: #1d4ed8;
  text-decoration-color: rgba(29, 78, 216, 0.55);
}

.auth-card .smtp-help-card__support-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Links */
.auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}

.auth-links--stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.auth-links a {
  color: #2563eb;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.password-requirements-hint {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.auth-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

/* Sign-in, sign-up, password reset — executive beige accents */
.auth-body .auth-card label {
  color: var(--auth-exec-heading);
}

.auth-body--signup .auth-signup-form label,
.auth-body--signup .auth-signup__card label {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.auth-body--signup .auth-signup-form__section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--auth-exec-accent);
}

.auth-body .auth-card input[type="email"],
.auth-body .auth-card input[type="password"],
.auth-body .auth-card input[type="text"],
.auth-body .auth-card input[type="tel"],
.auth-body .auth-card select {
  border-color: var(--auth-exec-card-border);
  border-radius: 6px;
  color: var(--auth-exec-text);
}

.auth-body .auth-card input:focus,
.auth-body .auth-card select:focus {
  border-color: var(--auth-exec-accent);
  box-shadow: 0 0 0 2px var(--auth-exec-accent-ring);
}

.auth-body .field--password-toggle .field__password-toggle {
  color: var(--auth-exec-muted);
}

.auth-body .field--password-toggle .field__password-toggle:hover {
  background: rgba(139, 115, 85, 0.1);
  color: var(--auth-exec-heading);
}

.auth-body .field--password-toggle .field__password-toggle:focus {
  box-shadow: 0 0 0 2px var(--auth-exec-accent-ring);
}

.auth-body .auth-card .actions input[type="submit"] {
  border: none;
  border-radius: 4px;
  background: var(--auth-exec-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem;
  letter-spacing: 0.02em;
}

.auth-body .auth-card .actions input[type="submit"]:hover {
  background: var(--auth-exec-accent-hover);
}

.auth-body--signup .auth-signup__card.auth-card .auth-signup-form__actions input[type="submit"] {
  background: var(--auth-exec-cta);
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 14px var(--auth-exec-cta-shadow);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.85rem 1rem;
}

.auth-body--signup .auth-signup__card.auth-card .auth-signup-form__actions input[type="submit"]:hover {
  background: var(--auth-exec-cta-hover);
  box-shadow: 0 4px 16px rgba(44, 40, 37, 0.28);
}

.auth-body .auth-links a {
  color: var(--auth-exec-accent);
  font-weight: 500;
}

.auth-body .auth-links a:hover {
  color: var(--auth-exec-accent-hover);
}

.auth-body .password-requirements-hint {
  color: var(--auth-exec-muted);
}

.auth-body .iti input {
  border-color: var(--auth-exec-card-border);
  border-radius: 6px;
}

.auth-body .iti input:focus {
  border-color: var(--auth-exec-accent);
  box-shadow: 0 0 0 2px var(--auth-exec-accent-ring);
}

/* =========================
   intl-tel-input overrides
   ========================= */

.iti {
  width: 100%;
}

.iti input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 3.2rem; /* space for flag */
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  height: auto;
  box-sizing: border-box;
}

.iti input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.iti__flag-container {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.iti--allow-dropdown input {
  padding-left: 3.2rem;
}
/* =========================
   Flash messages (global)
   ========================= */

.flash-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  /* Below .topbar so the main nav stays clickable; top offset when topbar is present */
  z-index: 9998;
  width: 100%;
  max-width: 720px;
  padding: 0 1rem;
  pointer-events: none;
}

body.app-has-topbar .flash-container {
  top: 5rem;
}

.flash {
  pointer-events: auto;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  animation: flashFadeOut 6s forwards;
  box-shadow: 0 4px 16px rgba(28, 25, 23, 0.08);
}

/* Success / notice */
.flash-notice,
.flash-success {
  background: var(--st-bg-secondary);
  border-color: #c6dfc6;
  color: #2d5a35;
}

/* Errors / alerts */
.flash-alert,
.flash-error {
  background: #faf6f4;
  border-color: #e8cfc9;
  color: #7f1d1d;
}

.flash-warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

/* In-page flash stack (e.g. public layout) */
.flash-container--static {
  position: static;
  transform: none;
  left: auto;
  width: auto;
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  pointer-events: auto;
}

.flash-container--auth {
  max-width: 520px;
  margin-bottom: 0.75rem;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(0.75rem, 3vw, 1.5rem) 0;
  box-sizing: border-box;
}

@keyframes flashFadeOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  /* Invisible elements still intercept clicks unless we disable hit-testing */
  100% {
    opacity: 0;
    transform: translateY(0);
    pointer-events: none;
    visibility: hidden;
  }
}

/* =========================
   Dashboard
   ========================= */

.dashboard {
  max-width: min(1680px, 100%);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

.dashboard-header .subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

/* Class levels index: hint uses full dashboard content width (no narrow max-width). */
.dashboard-header .class-levels-index__list-order {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pagination-footer {
  margin-top: 1.5rem;
}

/* Table/list footers: keep “per page” on the same line as the select; fixed width for 10 / 25 / 50 */
.pagination-per-page-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pagination-per-page-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}

/* Native select (10 / 25 / 50): compact but wide enough for the control + digits */
.pagination-per-page-select {
  padding: 0.22rem 0.12rem 0.22rem 0.28rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  width: 3.35rem;
  min-width: 3.35rem;
  max-width: 3.35rem;
  flex-shrink: 0;
  box-sizing: border-box;
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.25;
  text-align: center;
  background-color: #fff;
  color: #0f172a;
}

/* “per page” — stays on one line via .pagination-per-page-form */
.pagination-per-page-label {
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.25;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Figures index allows 100 items per page — room for three-digit value */
.pagination-per-page-select--wide {
  width: 4rem;
  min-width: 4rem;
  max-width: 4rem;
}

/*
 * List index pagination lives inside `.auth-card` on some pages (assessments, reports, questions).
 * `.auth-card select` uses width:100% and full-width padding — higher specificity than `.pagination-per-page-select` alone.
 */
.auth-card select.pagination-per-page-select {
  width: 3.35rem;
  min-width: 3.35rem;
  max-width: 3.35rem;
  padding: 0.22rem 0.12rem 0.22rem 0.28rem;
  border-radius: 6px;
  appearance: auto;
  -webkit-appearance: menulist;
  background-image: none;
  background-repeat: no-repeat;
  background-position: initial;
  line-height: 1.25;
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  font-size: 0.95rem;
  text-align: center;
  color: #0f172a;
  flex-shrink: 0;
  box-sizing: border-box;
}

.auth-card select.pagination-per-page-select--wide {
  width: 4rem;
  min-width: 4rem;
  max-width: 4rem;
}

/* Dashboard onboarding checklist */
.onboarding-checklist {
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.35rem;
}

.onboarding-checklist__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.onboarding-checklist__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.onboarding-checklist__progress-label {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.onboarding-checklist__toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.95rem 0.45rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.onboarding-checklist__toggle:hover {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.onboarding-checklist__toggle:focus {
  outline: none;
}

.onboarding-checklist__toggle:focus-visible {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px rgba(37, 99, 235, 0.45);
}

.onboarding-checklist__toggle:active {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.onboarding-checklist__toggle-icon {
  display: flex;
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.22s ease, color 0.15s ease;
}

.onboarding-checklist__toggle:hover .onboarding-checklist__toggle-icon {
  color: #2563eb;
}

/* Expanded = panel open → chevron points up (collapse) */
.onboarding-checklist__toggle[aria-expanded="true"] .onboarding-checklist__toggle-icon {
  transform: rotate(180deg);
}

.onboarding-checklist__toggle-label {
  line-height: 1.2;
}

.onboarding-checklist__progress-track {
  height: 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 1rem;
}

.onboarding-checklist__progress-bar {
  height: 100%;
  border-radius: 999px;
  background: #2563eb;
  transition: width 0.25s ease;
}

.onboarding-checklist__next-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: #475569;
}

.onboarding-checklist__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onboarding-checklist__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.onboarding-checklist__step--next .onboarding-checklist__step-link {
  font-weight: 600;
  color: #1d4ed8;
}

.onboarding-checklist__step--done .onboarding-checklist__step-link {
  color: #64748b;
  text-decoration: line-through;
}

.onboarding-checklist__step-status {
  width: 1.25rem;
  text-align: center;
  color: #94a3b8;
  flex-shrink: 0;
}

.onboarding-checklist__step--done .onboarding-checklist__step-status {
  color: #16a34a;
}

/* Data tables: topbar .nav-link uses large padding — inside cells it skews columns vs headers */
table.data-table {
  table-layout: fixed;
}

table.data-table th,
table.data-table td {
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

table.data-table .nav-link {
  display: inline;
  padding: 0.15rem 0.3rem;
  margin: 0 -0.05rem;
  font-size: inherit;
  line-height: 1.45;
  vertical-align: baseline;
}

table.data-table .nav-link:hover {
  border-radius: 4px;
}

/* Assessments / contacts / students / groups / questions: icon-only row actions (Heroicons-style SVG) */
table.data-table .assessment-icon-link,
table.data-table .contact-icon-link,
table.data-table .student-icon-link,
table.data-table .group-icon-link,
table.data-table .question-icon-link,
.contact-card-actions .contact-icon-link,
.student-card-actions .student-icon-link,
.group-card-actions .group-icon-link,
.group-assignment-card-actions .assessment-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: var(--st-radius-sm);
  color: var(--st-accent);
  line-height: 0;
  text-decoration: none;
}

table.data-table .assessment-icon-link:hover,
table.data-table .contact-icon-link:hover,
table.data-table .student-icon-link:hover,
table.data-table .group-icon-link:hover,
table.data-table .question-icon-link:hover,
.contact-card-actions .contact-icon-link:hover,
.student-card-actions .student-icon-link:hover,
.group-card-actions .group-icon-link:hover,
.group-assignment-card-actions .assessment-icon-link:hover {
  background: var(--st-bg-secondary);
  color: var(--st-accent-strong);
}

table.data-table .assessment-icon-link svg,
table.data-table .contact-icon-link svg,
table.data-table .student-icon-link svg,
table.data-table .group-icon-link svg,
table.data-table .question-icon-link svg,
.contact-card-actions .contact-icon-link svg,
.student-card-actions .student-icon-link svg,
.group-card-actions .group-icon-link svg,
.group-assignment-card-actions .assessment-icon-link svg {
  flex-shrink: 0;
}

/* School years: current calendar year (index) or current period (show) */
.school-years-highlight-row {
  background: #eff6ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

.school-years-highlight-row > td {
  background: transparent;
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Context strip */
.dashboard-context-strip {
  display: inline-flex;
  align-items: center;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.775rem;
  box-shadow: 0 1px 2px rgba(28,25,23,0.04);
  margin-top: 0.5rem;
}

.dashboard-context-strip__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-right: 0.5px solid var(--st-border-tertiary);
  color: var(--st-text-secondary);
}

.dashboard-context-strip__item:last-child { border-right: none; }

.dashboard-context-strip__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-text-tertiary);
}

.dashboard-context-strip__value {
  font-weight: 600;
  color: var(--st-text-primary);
}

/* Stat cards */
.metric-card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-left: 3px solid var(--st-accent);
  border-radius: var(--st-radius-lg);
  padding: 1.1rem 1.25rem 1.15rem;
  box-shadow: 0 1px 3px rgba(28,25,23,0.06), 0 4px 12px rgba(28,25,23,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-card--students { border-left-color: #2563eb; }
.metric-card--teachers { border-left-color: #d97706; }
.metric-card--groups   { border-left-color: #0d9488; }
.metric-card--assess   { border-left-color: #7c3aed; }
.metric-card--rate     { border-left-color: #16a34a; }

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f0ede7;
  color: var(--st-accent);
}

.metric-card--students .metric-card__icon { background: #eff6ff; color: #2563eb; }
.metric-card--teachers .metric-card__icon { background: #fffbeb; color: #d97706; }
.metric-card--groups   .metric-card__icon { background: #f0fdfa; color: #0d9488; }
.metric-card--assess   .metric-card__icon { background: #f5f3ff; color: #7c3aed; }
.metric-card--rate     .metric-card__icon { background: #f0fdf4; color: #16a34a; }

.metric-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-text-tertiary);
}

.metric-card h3 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1;
  color: var(--st-accent);
  font-variant-numeric: tabular-nums;
}

.metric-card--students h3 { color: #2563eb; }
.metric-card--teachers h3 { color: #d97706; }
.metric-card--groups   h3 { color: #0d9488; }
.metric-card--assess   h3 { color: #7c3aed; }
.metric-card--rate     h3 { color: #16a34a; }

.metric-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
}

.metric-card p.metric-card__people-context {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-text-tertiary);
}

.metric-card__people-lines {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-card__people-lines .metric-people-line {
  margin: 0;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.metric-card__people-lines .metric-people-line strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--st-accent);
  font-variant-numeric: tabular-nums;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 1rem;
}

.chart-card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 1px 3px rgba(28,25,23,0.06), 0 4px 12px rgba(28,25,23,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-card__header {
  background: var(--st-bg-secondary);
  padding: 0.85rem 1.25rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  flex-shrink: 0;
}

.chart-card h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0;
  color: var(--st-text-primary);
}

.chart-card__hint {
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  margin-top: 0.15rem;
  line-height: 1.45;
}

.chart-card__body {
  padding: 1.25rem;
}

.chart-canvas-wrap {
  position: relative;
  height: 260px;
}

.chart-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.dashboard-status-chart-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-empty-message {
  margin: 0;
  color: var(--st-text-tertiary);
  font-size: 0.875rem;
}

/* Chart tag filter */
.chart-tag-filter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.chart-tag-filter label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--st-text-secondary);
  white-space: nowrap;
}

.chart-tag-filter select {
  height: 30px;
  padding: 0 0.6rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg-primary);
  font-size: 0.775rem;
  color: var(--st-text-primary);
  min-width: 10rem;
  outline: none;
  transition: border-color 0.15s;
}

.chart-tag-filter select:focus {
  border-color: var(--st-accent);
}

/* =========================
   Top navigation
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #e8e4dc;
  background: #f9f8f4;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.topbar .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #5c5346;
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-item:hover .nav-dropdown {
  display: block;
}

.nav-link {
  text-decoration: none;
  font-size: 0.875rem;
  color: #64748b;
  padding: 0.75rem 0.5rem;
  line-height: 1.2;
  font-weight: 500;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.nav-link:hover {
  color: #2563eb;
}

.nav-link.active {
  font-weight: 600;
  color: #2563eb;
}

.topbar .main-nav .nav-link:hover {
  color: #2d6a4f;
  text-decoration: underline;
  text-decoration-color: rgba(45,106,79,0.35);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.topbar .main-nav .nav-link.active {
  color: #2d6a4f;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #2d6a4f;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Top bar only: avoid default :visited colour */
.topbar .main-nav .nav-link:visited {
  color: #64748b;
}

.topbar .main-nav .nav-link:visited:hover {
  color: #2d6a4f;
}

.topbar .main-nav .nav-link.active:visited {
  color: #2d6a4f;
}

.topbar .main-nav .nav-link:focus {
  outline: none;
  color: #64748b;
}

.topbar .main-nav .nav-link.active:focus {
  color: #2d6a4f;
}

.topbar .main-nav .nav-link:focus-visible {
  outline: 2px solid #5c5346;
  outline-offset: 3px;
  border-radius: 6px;
}

.nav-dropdown-link {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #334155;
}

.topbar .nav-dropdown-link:hover {
  background: #f3f0ea;
}

.topbar .nav-dropdown-link.active {
  font-weight: 600;
  color: #433a32;
  background: #ede9e4;
}

.topbar .nav-dropdown-link:visited {
  color: #334155;
}

.topbar .nav-dropdown-link.active:visited {
  color: #433a32;
}

.topbar .nav-dropdown-link:focus {
  outline: none;
}

.topbar .nav-dropdown-link:focus-visible {
  outline: 2px solid #5c5346;
  outline-offset: -2px;
  border-radius: 4px;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #e8e4dc;
  border-radius: 8px;
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 50;
}

/* User dropdown */
.user-menu {
  position: relative;
  cursor: pointer;
  font-size: 0.9rem;
  color: #334155;
}

.user-menu .chevron {
  margin-left: 0.25rem;
  font-size: 0.7rem;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  min-width: 160px;
  padding: 0.5rem 0;
  display: none;
}

.dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
}

.dropdown a:hover {
  background: #f1f5f9;
}

.dropdown hr {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

.user-menu.open .dropdown {
  display: block;
}

/* Main content spacing */
.main-content {
  padding: clamp(0.75rem, 2vw, 2rem);
  background: #f9f8f4;
}

/* Slightly larger type in the signed-in app: rem resolves from html, so this scales tables, forms, and copy together. */
html:has(body.app-has-topbar) {
  font-size: 106.25%;
}

/* =========================
   User dropdown (CSS-only)
   ========================= */

.user-nav {
  position: relative;
}

.user-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  padding: 0.6rem;
  border-radius: 8px;
}

.user-trigger:hover {
  background: rgba(255, 255, 255, 0.65);
}

.user-trigger:focus {
  outline: none;
}

.user-trigger .chevron,
.nav-link .chevron,
.org-trigger .chevron {
  display: inline-flex;
  align-items: center;
  opacity: 0.6;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 120%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  min-width: 160px;
  padding: 0.5rem 0;
  list-style: none;
  display: none;
  z-index: 1000;
}

.user-dropdown li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #334155;
  text-decoration: none;
}

.user-dropdown li a:hover {
  background: #f1f5f9;
}

.user-dropdown .divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}

/* 🔑 SHOW DROPDOWN */
.user-nav:hover .user-dropdown,
.user-nav:focus-within .user-dropdown {
  display: block;
}

/* Logout button styled like a link */
.logout-form {
  margin: 0;
}

.logout-button {
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  color: #334155;
  cursor: pointer;
}

.logout-button:hover {
  background: #f1f5f9;
}

.chart-divider {
  height: 0;
  border: none;
  border-top: 0.5px solid var(--st-border-tertiary);
  margin: 1.25rem 0;
}

/* ── Student form ── */
.sf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
  max-width: 100%;
}

.sf-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Student sidebar card */
.sf-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  box-shadow: 0 1px 3px rgba(28,25,23,0.06), 0 4px 12px rgba(28,25,23,0.04);
  overflow: hidden;
}

.sf-sidebar__header {
  background: var(--st-bg-secondary);
  padding: 0.7rem 1.25rem;
  border-bottom: 0.5px solid var(--st-border-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.sf-sidebar__body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Section cards (enrolments, parents) */
.sf-card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  box-shadow: 0 1px 3px rgba(28,25,23,0.06), 0 4px 12px rgba(28,25,23,0.04);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.sf-card__header {
  background: var(--st-bg-secondary);
  padding: 0.7rem 1.25rem;
  border-bottom: 0.5px solid var(--st-border-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sf-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.sf-card__hint {
  font-size: 0.775rem;
  color: var(--st-text-tertiary);
  margin-top: 0.15rem;
  line-height: 1.45;
}

.sf-card__body {
  padding: 1.25rem 1.5rem;
}

/* Enrollment warning notice */
.sf-notice {
  padding: 0.85rem 1.1rem;
  border-radius: var(--st-radius-sm);
  border: 0.5px solid var(--st-border-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.sf-notice--warn {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

/* Error block */
.sf-errors {
  background: #fef2f2;
  border: 0.5px solid #fecaca;
  border-radius: var(--st-radius-sm);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
}

.sf-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.sf-errors li {
  font-size: 0.875rem;
  color: #991b1b;
  line-height: 1.5;
}

/* Enrolment rows */
.sf-enrolment-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  margin-bottom: 1rem;
}

.sf-enrolment-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sf-remove-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #991b1b;
  cursor: pointer;
  white-space: nowrap;
  padding-bottom: 0.5rem;
}

/* Parents grid */
.sf-parents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.sf-parent-card {
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-sm);
  overflow: hidden;
  min-width: 0;
}

.sf-parent-card__header {
  background: var(--st-bg-secondary);
  padding: 0.65rem 1rem;
  border-bottom: 0.5px solid var(--st-border-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.sf-parent-card__body {
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.sf-parent-card__body .cf-field {
  min-width: 0;
}

.sf-parent-card__body > .sf-adult-label {
  margin: 0;
}

.sf-parent-address-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.15rem;
  padding-top: 0.85rem;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.sf-parent-address-fields[hidden] {
  display: none !important;
}

.sf-parent-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.sf-parent-mini-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.sf-parent-mini-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--st-text-tertiary);
  line-height: 1.35;
}

.sf-parent-mini-field input,
.sf-parent-mini-field select {
  height: 34px;
  padding: 0 0.65rem;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg-primary);
  font-size: 0.775rem;
  color: var(--st-text-primary);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
}

.sf-parent-mini-field input:focus,
.sf-parent-mini-field select:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92,83,70,0.12);
}

.sf-parent-divider {
  border: none;
  border-top: 0.5px solid var(--st-border-tertiary);
  margin: 0.35rem 0 0;
}

@media (max-width: 960px) {
  .sf-parents-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

.sf-perm-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-text-tertiary);
}

.sf-perm-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  color: var(--st-text-secondary);
  cursor: pointer;
}

.sf-perm-label input {
  accent-color: var(--st-accent);
}

.sf-unlink-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  color: #991b1b;
  cursor: pointer;
  margin-top: 0.15rem;
}

.sf-adult-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.sf-adult-label input {
  margin-top: 0.15rem;
  accent-color: var(--st-accent);
}

.btn-danger {
  background: #fff;
  color: #dc2626; /* red-600 */
  border: 1px solid #d1d5db;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-danger:hover {
  background: #fef2f2; /* red-50 */
  border-color: #dc2626;
}

.dropzone-active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  transition: all 0.15s ease;
}

.app-footer {
  padding: 1rem 2rem;
  background: #f9f8f4;
  border-top: 1px solid #e8e4dc;
  font-size: 0.85rem;
  color: #64748b;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.footer-inner {
  max-width: min(1680px, calc(100vw - 2rem));
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.footer-left,
.footer-center,
.footer-right {
  min-width: 0;
}

.footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
}

.footer-sep {
  color: #94a3b8;
  user-select: none;
}

.footer-right a {
  text-decoration: none;
  color: #64748b;
}

.footer-right a:hover {
  color: #5c5346;
}



.page-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.filters-bar {
  margin-bottom: 1.5rem;
}

.filters-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-input,
.filter-select {
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  min-width: 200px;
}

.assessments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.assessment-card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.assessment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assessment-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
}

.assessment-tags {
  margin-top: 0.75rem;
}

.tag-badge {
  background: #eef2ff;
  color: #4338ca;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-right: 0.5rem;
}

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-draft {
  background: #f1f5f9;
  color: #475569;
}

.status-ready {
  background: #e0f2fe;
  color: #0369a1;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-closed {
  background: #fee2e2;
  color: #991b1b;
}

.assessment-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.pagination-wrapper {
  margin-top: 2rem;
  text-align: center;
}

.settings-link {
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  display: block;
  margin-top: 0.75rem;
}

.settings-link:hover {
  text-decoration: underline;
}

.settings-desc {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 1.1rem;
}

/* Settings index: two columns — row 1: Organisation & content | People & customisation; row 2: Data & account | (empty) */
.settings-index .settings-section-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.settings-index__sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  align-items: start;
}

@media (max-width: 768px) {
  .settings-index__sections {
    grid-template-columns: 1fr;
  }
}

/* ── Settings index (stg-*) ── */
.stg-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stg-header__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stg-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stg-header__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.stg-header__subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

.stg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .stg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .stg-grid {
    grid-template-columns: 1fr;
  }
}

.stg-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  overflow: hidden;
}

.stg-card__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #faf8f5;
}

.stg-card__icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stg-card__icon--org  { background: #e6f4ed; color: #2d6a4f; }
.stg-card__icon--people { background: #eef2ff; color: #4f46e5; }
.stg-card__icon--data { background: #fef3c7; color: #b45309; }

.stg-card__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
}

.stg-card__body {
  display: flex;
  flex-direction: column;
}

.stg-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--st-border-tertiary, #e8e2d9);
  transition: background 0.12s ease;
}

.stg-row:last-child {
  border-bottom: none;
}

.stg-row:hover {
  background: #f5f1eb;
}

.stg-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stg-row__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

.stg-row__desc {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.4;
}

.stg-row__chevron {
  color: #bbb;
  flex-shrink: 0;
  transition: color 0.12s ease, transform 0.12s ease;
}

.stg-row:hover .stg-row__chevron {
  color: #666;
  transform: translateX(2px);
}

.stg-row--danger .stg-row__label { color: #b91c1c; }
.stg-row--danger .stg-row__chevron { color: #fca5a5; }
.stg-row--danger:hover { background: #fff5f5; }
.stg-row--danger:hover .stg-row__chevron { color: #b91c1c; }

.stg-hint {
  padding: 0.8rem 1.1rem;
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

/* ── Organisation edit (oe-*) ── */
.oe-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.oe-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.oe-page__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.oe-page__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oe-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.oe-page__subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

.oe-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  overflow: hidden;
}

.oe-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #faf8f5;
}

.oe-card__icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oe-card__icon--org   { background: #e6f4ed; color: #2d6a4f; }
.oe-card__icon--email { background: #eef2ff; color: #4f46e5; }
.oe-card__icon--smtp  { background: #fef3c7; color: #b45309; }

.oe-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.3;
}

.oe-card__subtitle {
  font-size: 0.78rem;
  color: #888;
  margin: 0;
}

.oe-card__body {
  padding: 1.25rem;
}

.oe-card__intro {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

.oe-card__hint {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.4;
}

.oe-field__hint {
  margin: 0 0 0.35rem;
  color: #64748b;
  font-size: 0.85rem;
}

.oe-smtp-verified {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.88rem;
}

/* ── School years (sy-*) ── */
.sy-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sy-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sy-page__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sy-page__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sy-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.sy-page__subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

.sy-page__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sy-rollover-help {
  background: #faf8f5;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
}

.sy-rollover-help__title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1a1a1a;
  margin-bottom: 0.3rem;
}

.sy-rollover-help__body {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #555;
}

.sy-row--current {
  background: #f0f7f3;
  box-shadow: inset 3px 0 0 #2d6a4f;
}

.sy-year-link {
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
}

.sy-year-link:hover {
  color: #2d6a4f;
  text-decoration: underline;
}

.sy-row__actions {
  text-align: right;
  white-space: nowrap;
}

.sy-action-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  transition: background 0.12s ease, color 0.12s ease;
}

.sy-action-link:hover {
  background: #f0ece6;
  color: #1a1a1a;
}

.sy-empty {
  padding: 1.25rem;
  color: #888;
  font-size: 0.9rem;
}

.sy-form-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 42rem;
}

.sy-form__errors {
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.sy-form__field {
  margin-bottom: 1rem;
}

.sy-form__label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: #2d2926;
}

.sy-form__input {
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  font-size: 0.9rem;
  color: #1a1a1a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sy-form__input:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.sy-form__input--name {
  width: 100%;
  max-width: 28rem;
}

.sy-form__date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sy-form__date-row > .sy-form__field {
  flex: 1 1 12rem;
  min-width: 0;
}

/* School year show */
.sy-show__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sy-show__badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  line-height: 1.3;
}

.sy-show__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.sy-show__actions-sep {
  color: #94a3b8;
}

.sy-show__actions .nav-link--danger {
  color: #b91c1c;
  font-weight: 600;
}

.sy-show__periods-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.sy-show__periods-heading {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.sy-show__periods-intro {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.sy-show__periods-empty {
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.sy-show__term-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  justify-content: flex-end;
}

.sy-show__term-actions .nav-link {
  font-size: 0.9rem;
}

.sy-show__term-actions .nav-link--muted {
  color: #64748b;
}

/* ── stg-header actions (used across settings sub-pages) ── */
.stg-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Settings files (sf-*) ── */
.sf-storage-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
}

.sf-storage-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-weight: 700;
  color: #1a1a1a;
}

.sf-storage-card__usage {
  font-size: 0.9rem;
  color: #666;
  text-align: right;
}

.sf-storage-card__usage-muted,
.sf-storage-card__usage-label {
  color: #64748b;
}

.sf-storage-card__usage-muted {
  margin: 0 0.2rem;
}

.sf-storage-card__usage-label {
  margin-left: 0.15rem;
}

.sf-storage-card__pct {
  display: inline-block;
  margin-left: 0.35rem;
  font-weight: 700;
  color: #1a1a1a;
}

.sf-storage-card__usage strong { color: #1a1a1a; }

.sf-storage-card__breakdown {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.45;
}

.sf-storage-card__breakdown-label {
  font-weight: 600;
  color: #334155;
}

.sf-storage-card__breakdown-sep {
  color: #94a3b8;
  margin: 0 0.25rem;
}

.sf-storage-card__breakdown-value {
  color: #1a1a1a;
}

.sf-storage-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--st-border-tertiary, #e8e2d9);
  overflow: hidden;
}

.sf-storage-bar__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.sf-storage-legend {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: #888;
}

.sf-sort-link {
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
}

.sf-sort-link:hover { text-decoration: underline; }

.sf-sort-link__indicator {
  font-size: 0.75rem;
}

.sf-files-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.sf-files-layout__main {
  flex: 1;
  min-width: min(100%, 520px);
}

.settings-files__bulk-bar {
  margin-bottom: 0.75rem;
}

.settings-files__th--check {
  width: 2.75rem;
  text-align: center;
  vertical-align: middle;
}

.settings-files__td--check {
  text-align: center;
  vertical-align: middle;
}

.settings-files__select-all,
.settings-files__cb {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  vertical-align: middle;
}

.settings-files__select-all {
  width: 1.1rem;
  height: 1.1rem;
}

.settings-files__filename {
  cursor: pointer;
  font-weight: 600;
  word-break: break-word;
}

.settings-files__filename-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  word-break: break-word;
}

.settings-files__created {
  color: #475569;
}

.settings-files__attached {
  font-size: 0.88rem;
  color: #64748b;
  word-break: break-word;
}

.sf-bulk-sidebar {
  flex: 0 0 280px;
  max-width: 100%;
  align-self: flex-start;
  position: sticky;
  top: 1rem;
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.sf-bulk-sidebar__title {
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.sf-bulk-sidebar__hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.45;
}

.sf-bulk-delete-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease;
}

.sf-bulk-delete-btn:hover { background: #fee2e2; }

.sf-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  margin-top: 1rem;
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
}

.sf-empty-state {
  padding: 2rem;
  text-align: center;
  color: #888;
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
}

/* ── Settings users (su-*) ── */
.su-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.su-search-form {
  flex: 1 1 16rem;
  min-width: 0;
}

.su-search {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 7px;
  font-size: 0.88rem;
  background: #fff;
  color: #1a1a1a;
  min-width: 16rem;
  width: 100%;
  box-sizing: border-box;
}

.su-search:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.su-role-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.su-role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  background: #f0ece6;
  color: #555;
  transition: background 0.12s ease, color 0.12s ease;
}

.su-role-pill:hover { background: #e8e2d9; color: #1a1a1a; }

.su-role-pill--active {
  background: #2d6a4f;
  color: #fff;
}

.su-role-pill--active:hover { background: #235a41; color: #fff; }

.su-name-link {
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
}

.su-name-link:hover { color: #2d6a4f; text-decoration: underline; }

.su-email { color: #555; font-size: 0.88rem; }

.su-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.su-badge--active  { background: #dcfce7; color: #166534; }
.su-badge--pending { background: #fef9c3; color: #854d0e; }
.su-badge--none    { background: #f0ece6; color: #777; }

.su-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.su-action-form {
  display: inline;
  margin: 0;
}

.su-action-btn {
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  color: #444;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}

.su-action-btn:hover { background: #f0ece6; }

.su-action-btn--primary {
  background: #2d6a4f;
  color: #fff;
  border-color: #2d6a4f;
}

.su-action-btn--primary:hover { background: #235a41; }

.su-action-btn--danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.su-action-btn--danger:hover { background: #fef2f2; }


/* ── Class levels icon actions (cl-*) ── */
.cl-list-order {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.cl-order-actions,
.cl-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.cl-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  color: #555;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.cl-icon-btn:hover {
  background: #f0ece6;
  color: #1a1a1a;
  border-color: #ccc5b8;
}

.cl-icon-btn--disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: default;
}

.cl-icon-btn--edit:hover  { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.cl-icon-btn--delete:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* sy-action-link danger variant */
.sy-action-link--danger { color: #b91c1c; }
.sy-action-link--danger:hover { background: #fef2f2; color: #991b1b; }

/* Settings → Portal: stacked cards (full width within .dashboard) */
.portal-settings__form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.portal-settings__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-settings__header .subtitle {
  max-width: 42rem;
  margin-top: 0.35rem;
}

.portal-settings__errors {
  margin-bottom: 1rem;
}

.portal-settings__stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* One future-friendly row = one white card on the grey main background */
.portal-setting-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.045);
  padding: 1.15rem 1.35rem;
}

.portal-setting-card__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.portal-setting-card__toggle {
  flex-shrink: 0;
}

/* List | switch | Grid */
.portal-setting-card__mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex-wrap: wrap;
}

.portal-setting-card__mode-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  min-width: 2.15rem;
  text-align: center;
  transition: color 0.15s ease;
}

.portal-setting-card__mode-toggle:has(.portal-switch__input:checked) .portal-setting-card__mode-label--grid {
  color: #2d6a4f;
}

.portal-setting-card__mode-toggle:not(:has(.portal-switch__input:checked)) .portal-setting-card__mode-label--list {
  color: #2d6a4f;
}

.portal-setting-card__mode-toggle--boolean:has(.portal-switch__input:checked) .portal-setting-card__mode-label--on {
  color: #2d6a4f;
}

.portal-setting-card__mode-toggle--boolean:not(:has(.portal-switch__input:checked)) .portal-setting-card__mode-label--off {
  color: #2d6a4f;
}

.portal-setting-card__body {
  flex: 1;
  min-width: 0;
}

.portal-setting-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}

.portal-setting-card__hint {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.portal-settings__actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.portal-switch {
  position: relative;
  display: inline-block;
  width: 3.1rem;
  height: 1.7rem;
  flex-shrink: 0;
}

.portal-switch__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.portal-switch__visual {
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
  position: relative;
}

.portal-switch__visual::after {
  content: "";
  position: absolute;
  top: 0.22rem;
  left: 0.22rem;
  width: 1.26rem;
  height: 1.26rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease;
}

.portal-switch__input:checked + .portal-switch__visual {
  background: #2d6a4f;
}

.portal-switch__input:checked + .portal-switch__visual::after {
  transform: translateX(1.36rem);
}

.portal-switch__input:focus-visible + .portal-switch__visual {
  outline: 2px solid #2d6a4f;
  outline-offset: 2px;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green { background:#dcfce7; }
.badge-yellow { background:#fef9c3; }
.badge-gray { background:#f1f5f9; }

.btn-small {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background:#f8fafc;
}

.btn-primary-small {
  background:#2563eb;
  color:white;
  border:none;
  padding:0.25rem 0.6rem;
  border-radius:6px;
}

.btn-danger-small {
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
  padding:0.25rem 0.6rem;
  border-radius:6px;
}

/* Primary button: taupe pill (matches Create Group / students-index primary) */
.btn-primary,
input[type="submit"].btn-primary,
button.btn-primary,
.students-index__btn.students-index__btn--primary,
input[type="submit"].students-index__btn.students-index__btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  height: 36px;
  padding: 0 1rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-accent-strong);
  background: var(--st-accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary:hover,
input[type="submit"].btn-primary:hover,
button.btn-primary:hover,
.students-index__btn.students-index__btn--primary:hover,
input[type="submit"].students-index__btn.students-index__btn--primary:hover {
  background: var(--st-accent-hover);
  color: #fff;
}

input[type="submit"].btn-primary:disabled,
button.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline,
a.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 1rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  background: #fff;
  color: var(--st-text-secondary);
  font-weight: 500;
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-outline:hover,
a.btn-outline:hover {
  background: var(--st-bg-secondary);
  border-color: var(--st-border-mid);
  color: var(--st-text-primary);
}

.btn-primary--block,
.students-index__bulk-btn.btn-primary {
  width: 100%;
}

#question-form-layout .question-form-save-rail .question-form-save-rail__btn.btn-primary {
  width: 100%;
}

/* ── Assessment Results page ── */

/* Assessment results pipeline — horizontal / vertical timeline */
.assessment-pipeline {
  margin: 0 0 1.35rem;
  padding: 0.25rem 0 0;
}

.assessment-pipeline__heading {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.assessment-pipeline__timeline {
  --pipeline-node: 2.25rem;
  --pipeline-track-y: calc(var(--pipeline-node) / 2);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  position: relative;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  gap: 0;
}

/* Base track behind nodes */
.assessment-pipeline__timeline::before {
  content: "";
  position: absolute;
  left: calc(var(--pipeline-node) / 2);
  right: calc(var(--pipeline-node) / 2);
  top: var(--pipeline-track-y);
  height: 2px;
  background: var(--st-border-tertiary);
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

.assessment-pipeline__step {
  position: relative;
  flex: 1 1 0;
  min-width: 10.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0.4rem;
  scroll-snap-align: start;
  z-index: 1;
}

/* Completed segment of track (step → next step) */
.assessment-pipeline__step--complete:not(:last-child)::after {
  content: "";
  position: absolute;
  top: var(--pipeline-track-y);
  left: calc(50% + var(--pipeline-node) / 2);
  width: calc(100% - var(--pipeline-node));
  height: 2px;
  background: #2dd4bf;
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

.assessment-pipeline__node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--pipeline-node);
  height: var(--pipeline-node);
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--st-bg-primary);
  border: 2px solid var(--st-border-tertiary);
  color: var(--st-text-secondary);
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.assessment-pipeline__step--complete .assessment-pipeline__node {
  border-color: #14b8a6;
  background: #ecfdf5;
  color: #0f766e;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.assessment-pipeline__step--current .assessment-pipeline__node {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.assessment-pipeline__step--pending .assessment-pipeline__node {
  border-color: var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  color: var(--st-text-tertiary);
}

.assessment-pipeline__detail {
  margin-top: 0.7rem;
  min-width: 0;
  width: 100%;
  padding: 0 0.15rem;
}

.assessment-pipeline__detail-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.assessment-pipeline__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--st-text-primary);
  line-height: 1.35;
}

.assessment-pipeline__line {
  margin: 0;
  font-size: 0.75rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.assessment-pipeline__line + .assessment-pipeline__line {
  margin-top: 0.12rem;
}

.assessment-pipeline__step--pending .assessment-pipeline__title,
.assessment-pipeline__step--pending .assessment-pipeline__line {
  color: var(--st-text-tertiary);
}

.assessment-pipeline__badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.35;
}

.assessment-pipeline__badge--done {
  background: #dcfce7;
  color: #15803d;
}

.assessment-pipeline__badge--live {
  background: #ffedd5;
  color: #c2410c;
}

.assessment-pipeline__badge--next {
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border: 0.5px solid var(--st-border-tertiary);
}

.assessment-pipeline__badge--pending {
  background: transparent;
  color: var(--st-text-tertiary);
  border: 0.5px solid var(--st-border-tertiary);
}

@media (max-width: 900px) {
  .assessment-pipeline__timeline {
    --pipeline-node-offset: calc(var(--pipeline-node) + 0.85rem);
    flex-direction: column;
    overflow-x: visible;
    padding-left: var(--pipeline-node-offset);
    scroll-snap-type: none;
  }

  .assessment-pipeline__timeline::before {
    left: calc(var(--pipeline-node) / 2);
    right: auto;
    top: calc(var(--pipeline-node) / 2);
    bottom: calc(var(--pipeline-node) / 2);
    width: 2px;
    height: auto;
    transform: translateX(-50%);
  }

  .assessment-pipeline__step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    padding: 0 0 1.25rem;
    scroll-snap-align: none;
  }

  .assessment-pipeline__step:last-child {
    padding-bottom: 0;
  }

  .assessment-pipeline__step--complete:not(:last-child)::after {
    top: var(--pipeline-node);
    left: calc(-1 * var(--pipeline-node-offset) + var(--pipeline-node) / 2);
    width: 2px;
    height: calc(100% - var(--pipeline-node) + 1.25rem);
    transform: translateX(-50%);
  }

  .assessment-pipeline__node {
    position: absolute;
    left: calc(-1 * var(--pipeline-node-offset));
    top: 0;
  }

  .assessment-pipeline__detail {
    margin-top: 0;
    padding-top: 0.1rem;
  }

  .assessment-pipeline__detail-head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem 0.5rem;
  }
}

.ar-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Header */
.ar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ar-header__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--st-text-primary);
  margin: 0 0 0.2rem;
}

.ar-header__assessment {
  margin: 0 0 0.3rem;
}

.ar-header__assessment-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--st-text-secondary);
  text-decoration: none;
  padding: 0;
}

.ar-header__assessment-link:hover {
  color: var(--st-accent);
  text-decoration: underline;
}

.ar-header__groups {
  font-size: 0.82rem;
  color: var(--st-text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.ar-header__groups-label { font-weight: 500; }

.ar-header__group-link {
  font-weight: 600;
  color: var(--st-text-primary);
  text-decoration: none;
  padding: 0;
  font-size: inherit;
}

.ar-header__group-link:hover { color: var(--st-accent); text-decoration: underline; }

.ar-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ar-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 1rem;
  border-radius: var(--st-radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 0.12s;
}

.ar-btn--ghost {
  background: transparent;
  border: 0.5px solid var(--st-border-secondary);
  color: var(--st-text-secondary);
}

.ar-btn--ghost:hover {
  background: var(--st-bg-tertiary);
  color: var(--st-text-primary);
}

/* Remark poll banner */
.ar-banner {
  background: #fff;
  border: 0.5px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: var(--st-radius-lg);
  padding: 0.85rem 1.15rem;
}

.ar-banner__status { margin: 0; font-weight: 700; font-size: 0.9rem; color: var(--st-text-primary); }
.ar-banner__detail { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--st-text-secondary); }

/* Shared card */
.ar-card {
  background: #fff;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.05);
  overflow: hidden;
}

/* Summary card */
.ar-summary {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1.5rem 1.75rem;
  flex-wrap: wrap;
}

.ar-summary__ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.ar-summary__ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ar-summary__ring-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  border: 0.5px solid var(--st-border-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.ar-summary__ring-fraction {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--st-text-primary);
  line-height: 1;
}

.ar-summary__ring-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--st-text-secondary);
  line-height: 1;
}

.ar-summary__status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.ar-summary__status-badge--completed { background: #dcfce7; color: #15803d; }
.ar-summary__status-badge--active    { background: #dbeafe; color: #1d4ed8; }
.ar-summary__status-badge--ended     { background: #ffedd5; color: #c2410c; }

.ar-summary__body { flex: 1; }

.ar-summary__avg-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--st-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.ar-summary__avg-score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--st-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.ar-summary__avg-hint {
  font-size: 0.78rem;
  color: var(--st-text-tertiary);
  margin-top: 0.2rem;
}

.ar-summary__avg-empty {
  font-size: 0.875rem;
  color: var(--st-text-tertiary);
}

/* Student card */
.ar-student__header {
  padding: 1.1rem 1.35rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  background: #faf8f5;
}

.ar-student__info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ar-student__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8e3db;
  color: #5a5248;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ar-student__name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--st-text-primary);
  text-decoration: none;
  padding: 0;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.ar-student__name:hover { color: var(--st-accent); text-decoration: underline; }

.ar-student__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

/* Badges */
.ar-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.ar-badge--completed { background: #dcfce7; color: #15803d; border: 0.5px solid #bbf7d0; }
.ar-badge--assigned  { background: #dbeafe; color: #1d4ed8; border: 0.5px solid #bfdbfe; }
.ar-badge--score     { background: var(--st-bg-tertiary); color: var(--st-text-primary); border: 0.5px solid var(--st-border-secondary); }
.ar-badge--positive  { background: #dcfce7; color: #15803d; border: 0.5px solid #bbf7d0; }
.ar-badge--negative  { background: #fee2e2; color: #991b1b; border: 0.5px solid #fecaca; }

/* Results table */
.ar-table-wrap {
  overflow-x: auto;
}

.ar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
  table-layout: fixed;
}

.ar-table__th {
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #faf8f5;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  white-space: nowrap;
}

.ar-table__th--question { width: 30%; }
.ar-table__th--answer   { width: 14%; }
.ar-table__th--correct  { width: 16%; }
.ar-table__th--marks    { width: 9%; }
.ar-table__th--feedback { width: 31%; }

.ar-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.ar-table tbody tr:last-of-type { border-bottom: none; }

.ar-table tbody td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  color: var(--st-text-primary);
  line-height: 1.5;
}

.ar-table__total-row td {
  background: #faf8f5;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.ar-table__total-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--st-text-secondary);
}

.ar-table__total-value {
  font-weight: 800;
  font-size: 1rem;
  color: var(--st-text-primary);
}

/* Marking summary + per-question tables (assessment / group / contact results) */
.marking-table-wrap,
.ar-table-wrap.marking-table-wrap,
.car-table-wrap.marking-table-wrap,
.gar-marking-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.marking-answers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: fixed;
}

.marking-answers-table .marking-table__cell,
.marking-answers-table.marking-answers-table--legacy-ar tbody td,
.marking-answers-table.marking-answers-table--legacy-car tbody td,
.group-assessment-results .gar-marking-table.marking-answers-table td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  color: var(--st-text-primary);
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.marking-table__sub-label {
  font-weight: 600;
  color: var(--st-text-secondary);
  margin-right: 0.25rem;
}

.marking-table__question-body {
  max-width: 100%;
}

.marking-table__guiding-answer {
  color: var(--st-text-secondary);
}

.marking-table__marks-edit {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.marking-table__marks-input {
  width: 4.5rem;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border-secondary);
  font-size: 0.875rem;
  box-sizing: border-box;
}

.marking-table__marks-total {
  color: var(--st-text-secondary);
  font-size: 0.88rem;
}

.marking-table__feedback-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.5rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
}

.marking-table__stem-row .marking-table__cell--stem {
  font-weight: 600;
  background: var(--st-bg-secondary);
  border-top: 0.5px solid var(--st-border-tertiary);
}

.marking-table__group-footer .marking-table__cell,
.marking-table__total-row .marking-table__cell,
.marking-answers-table tr.gar-marking-total td,
.marking-answers-table tr.marking-table__total-row td {
  background: var(--st-bg-secondary);
  font-weight: 700;
}

.marking-table__total-row .marking-table__cell--total-label,
.ar-table__total-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--st-text-secondary);
}

.marking-table__total-row .marking-table__cell--total-value,
.ar-table__total-value {
  font-weight: 800;
  font-size: 1rem;
  color: var(--st-text-primary);
}

.contact-assessment-results .car-table-wrap.marking-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.group-assessment-results .gar-marking-table-wrap {
  margin-top: 0.5rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  overflow-x: auto;
  background: var(--st-bg-primary);
}

/* Assessment results → re-run marking (dialog + header trigger) */
.assessment-remark-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.assessment-remark-dialog__open,
button.assessment-remark-dialog__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0 1rem;
  height: 34px;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  background: #fff;
  color: var(--st-text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.assessment-remark-dialog__open:hover,
button.assessment-remark-dialog__open:hover {
  background: var(--st-bg-tertiary);
  border-color: var(--st-border-primary);
}

.assessment-remark-dialog__open:focus-visible,
button.assessment-remark-dialog__open:focus-visible {
  outline: 2px solid #2d6a4f;
  outline-offset: 2px;
}

.assessment-remark-dialog__cancel,
button.assessment-remark-dialog__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0.52rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.assessment-remark-dialog__cancel:hover,
button.assessment-remark-dialog__cancel:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.assessment-remark-dialog__cancel:focus-visible,
button.assessment-remark-dialog__cancel:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 2px;
}

/* Support → Support access (token page): secondary / revoke action (pairs with .btn-primary) */
.support-access-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* button_to wraps each control in a form — keep them in the row */
.support-access-actions > form {
  display: inline-flex;
  margin: 0;
}

.btn-support-revoke,
input[type="submit"].btn-support-revoke,
button.btn-support-revoke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  margin: 0;
  background: #fff;
  color: #b91c1c;
  border: 1.5px solid #fecdd3;
  padding: 0.52rem 1.2rem 0.52rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.06);
}

.btn-support-revoke:hover,
input[type="submit"].btn-support-revoke:hover,
button.btn-support-revoke:hover {
  background: #fff1f2;
  border-color: #fb7185;
  color: #991b1b;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.1);
}

.btn-support-revoke:focus-visible,
input[type="submit"].btn-support-revoke:focus-visible,
button.btn-support-revoke:focus-visible {
  outline: 2px solid #f43f5e;
  outline-offset: 2px;
}

.btn-support-revoke:active,
input[type="submit"].btn-support-revoke:active,
button.btn-support-revoke:active {
  background: #ffe4e6;
}

/* ── Support access page (sa-*) ── */
.sa-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
}

.sa-card__intro {
  margin: 0 0 1.25rem;
  color: #4a4540;
  font-size: 0.95rem;
  line-height: 1.6;
}

.sa-card__active-notice {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: #666;
  line-height: 1.5;
}

.sa-token-reveal {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: #f4f9f6;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
}

.sa-token-reveal__notice {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a4731;
}

.sa-token-reveal__code {
  display: block;
  word-break: break-all;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border: 1px solid #d0e8da;
  border-radius: 6px;
  color: #1e3a2d;
  font-family: ui-monospace, monospace;
}

.sa-token-reveal__expiry {
  margin: 0.75rem 0 0;
  font-size: 0.83rem;
  color: #5a7a6a;
}

.pagination {
  display:flex;
  gap:0.4rem;
}

.pagination a, .pagination span {
  padding:0.3rem 0.6rem;
  border-radius:6px;
  border:1px solid #e8e4dc;
  font-size:0.8rem;
}

.pagination a {
  background: #f3f0ea;
  color: #5c5346;
  text-decoration: none;
}

.pagination a:hover {
  background: #ebe4d8;
}

.pagination .current {
  background: #5c5346;
  color: #fafaf9;
  border-color: #433a32;
}

/* Kaminari pager (app/views/kaminari) */
.kaminari-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.4rem;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}

.kaminari-pager__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.35rem;
  max-width: 100%;
}

.kaminari-pager__btn,
.kaminari-pager__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  color: var(--st-accent);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

a.kaminari-pager__btn:hover,
a.kaminari-pager__page:hover {
  background: #ebe4d8;
  color: var(--st-accent-strong);
}

.kaminari-pager__page--current {
  background: var(--st-accent);
  color: #fafaf9;
  font-weight: 600;
  border-color: var(--st-accent-strong);
}

.kaminari-pager__btn--disabled {
  background: var(--st-canvas);
  color: var(--st-text-tertiary);
  border-color: var(--st-border-tertiary);
  cursor: not-allowed;
}

.kaminari-pager__gap,
nav[role="navigation"] .page.gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.35rem;
  color: var(--st-text-tertiary);
  border: none;
  background: transparent;
  font-size: 0.875rem;
}

.kaminari-pager--compact .kaminari-pager__btn,
.kaminari-pager--compact .kaminari-pager__page {
  min-width: 2rem;
  min-height: 2.35rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.8125rem;
}

.students-index__pagination-bar .kaminari-pager,
.bl-pagination .kaminari-pager,
.sf-pagination-wrap .kaminari-pager,
.pagination-footer .kaminari-pager {
  margin-top: 0;
}

.students-index__pagination-bar > div:empty {
  display: none;
}

.students-index__pagination-bar > div:has(.kaminari-pager),
.sf-pagination-wrap > div:has(.kaminari-pager) {
  flex: 1 1 12rem;
  display: flex;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.sf-pagination-wrap > div:empty {
  display: none;
}

.settings-link.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-group-students__img {
  display: block;
}

/* Support impersonation (support staff viewing a school) */
.support-impersonation-banner {
  background: #1e3a5f;
  color: #f1f5f9;
  font-size: 0.9rem;
  border-bottom: 1px solid #0f172a;
}

.support-impersonation-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.support-impersonation-banner__exit {
  flex-shrink: 0;
  background: transparent;
  color: #f1f5f9;
  border: 1px solid rgba(241, 245, 249, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.support-impersonation-banner__exit:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Support requests — new request */
.support-request-new {
  max-width: min(60rem, 100%);
}

.support-request-new__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.support-request-new__error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.support-request-form__stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.support-request-form__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.support-request-form__columns > .support-request-form__card {
  min-height: 100%;
}

.support-request-form__card--description textarea {
  min-height: 10rem;
}

.support-request-form__summary-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  gap: 1.25rem 1.75rem;
  align-items: start;
}

.support-request-form__summary-fields > .field {
  min-width: 0;
}

.support-request-form__field-title .support-request-form__title-input {
  width: 100%;
  max-width: 26rem;
  box-sizing: border-box;
}

.support-request-form__summary-fields select {
  max-width: 100%;
}

@media (max-width: 768px) {
  .support-request-form__summary-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .support-request-form__columns {
    grid-template-columns: 1fr;
  }
}

.support-request-form__card.auth-card {
  padding: 1.25rem 1.5rem;
  margin: 0;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  box-shadow: none;
}

.support-request-form__card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.support-request-form__card-lead {
  margin: 0 0 1.1rem;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.45;
}

.support-request-form .field {
  margin-bottom: 1.25rem;
}

.support-request-form .field--flush-bottom {
  margin-bottom: 0;
}

.support-request-form__card select,
.support-request-form__card textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.support-request-form__card select {
  cursor: pointer;
  appearance: none;
  line-height: 1.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.support-request-form__card textarea {
  resize: vertical;
  min-height: 11rem;
  line-height: 1.5;
}

.support-request-form__card select:focus,
.support-request-form__card textarea:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}

.support-request-form__hint {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.support-request-form__dropzone {
  border: 1.5px dashed var(--st-border-tertiary, #e8e2d9);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: #faf8f5;
  position: relative;
}

.support-request-form__dropzone:hover,
.support-request-form__dropzone.dropzone-active {
  border-color: #2d6a4f;
  background: #f0f7f3;
}

.support-request-form__dropzone:focus-visible {
  outline: 2px solid #2d6a4f;
  outline-offset: 2px;
}

.support-request-form__dropzone-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.support-request-form__dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 7px;
  background: #ede8e1;
  color: #6b6259;
  flex-shrink: 0;
}

.support-request-form__dropzone-copy {
  flex: 1;
  min-width: 10rem;
}

.support-request-form__dropzone-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d2926;
}

.support-request-form__dropzone-hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #888;
}

.support-request-form__choose-btn {
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  color: #2d2926;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.support-request-form__choose-btn:hover {
  background: #f0ece6;
}

.support-request-form__file-input {
  display: none;
}

.support-request-form__preview {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #334155;
}

.support-request-form__actions {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
  gap: 0.75rem;
}

.support-request-form__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  color: #444;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.support-request-form__cancel:hover {
  background: #f5f0eb;
  border-color: #ccc5b8;
}

/* Figures index */
.figures-index__file-input {
  display: none;
}

.figures-index__upload-wrap {
  margin-bottom: 1rem;
}

.figures-index__dropzone {
  border: 1.5px dashed var(--st-border-secondary);
  border-radius: var(--st-radius-lg);
  padding: 1.1rem 1.25rem;
  background: var(--st-bg-primary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.figures-index__dropzone:hover,
.figures-index__dropzone.dropzone-active {
  border-color: var(--fig-primary);
  background: #f7faf8;
}

.figures-index__dropzone-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.figures-index__dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--st-radius-md);
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  flex-shrink: 0;
}

.figures-index__dropzone-copy {
  flex: 1;
  min-width: 12rem;
}

.figures-index__dropzone-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.figures-index__dropzone-hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
}

.figures-index__choose-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.figures-index__choose-btn:hover {
  background: var(--st-bg-secondary);
}

.figures-index__dropzone--uploading {
  pointer-events: none;
  opacity: 0.92;
}

.figures-index__upload-progress {
  margin-top: 1rem;
  max-width: 22rem;
}

.figures-index__upload-progress-track {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--st-border-tertiary);
  overflow: hidden;
}

.figures-index__upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--fig-primary);
  transition: width 0.12s ease-out;
}

.figures-index__upload-progress-bar--indeterminate {
  width: 35% !important;
  animation: figures-upload-progress-roll 1s ease-in-out infinite;
}

@keyframes figures-upload-progress-roll {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

.figures-index__upload-progress-label {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fig-primary);
  font-variant-numeric: tabular-nums;
}

.figures-index__toolbar {
  margin-bottom: 1rem;
}

.figures-index__toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.figures-index__search-wrap {
  flex: 1 1 16rem;
  min-width: 0;
}

.figures-index__scope-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.figures-index__scope-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 0.5px solid var(--fig-primary);
  background: var(--st-bg-primary);
  color: var(--fig-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.figures-index__scope-btn:hover {
  background: #f7faf8;
}

.figures-index__scope-btn--active {
  background: var(--fig-primary);
  color: #fff;
}

.figures-index__layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}

.figures-index__main {
  flex: 1 1 320px;
  min-width: 0;
}

.figures-index__sidebar {
  flex: 0 0 280px;
  max-width: 100%;
  align-self: flex-start;
  position: sticky;
  top: 1rem;
}

.figures-index__grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.figures-index__select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--st-text-secondary);
  cursor: pointer;
}

.figures-index__select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--fig-primary);
  cursor: pointer;
}

.figures-index__count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.figures-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

@media (min-width: 1100px) {
  .figures-index__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.figures-index__card {
  position: relative;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow: hidden;
  background: var(--st-bg-primary);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.figures-index__card:hover {
  border-color: var(--st-border-secondary);
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.08);
}

.figures-index__card-check {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 3;
}

.figures-index__card-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--fig-primary);
  cursor: pointer;
}

.figures-index__card-media {
  display: block;
  text-decoration: none;
}

.figures-index__card img {
  width: 100%;
  height: 8.5rem;
  object-fit: contain;
  display: block;
  background: #faf9f7;
  padding: 0.35rem;
  box-sizing: border-box;
}

.figures-index__card-placeholder {
  width: 100%;
  height: 8.5rem;
  background: var(--st-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--st-text-tertiary);
  font-size: 0.8rem;
}

.figures-index__card-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.figures-index__card-name {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fig-primary);
  text-decoration: none;
  line-height: 1.35;
  word-break: break-word;
}

.figures-index__card-name:hover {
  color: var(--fig-primary-hover);
  text-decoration: underline;
}

.figures-index__card-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--st-text-secondary);
  line-height: 1.4;
}

.figures-index__card-author {
  color: var(--st-text-secondary);
  text-decoration: none;
}

.figures-index__card-author:hover {
  color: var(--st-text-primary);
  text-decoration: underline;
}

.figures-index__meta-sep {
  margin: 0 0.15rem;
  color: var(--st-text-tertiary);
}

.figures-index__footer {
  margin-top: 1.25rem;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow: hidden;
  background: var(--st-bg-primary);
}

.figures-index__pagination-bar {
  margin-top: 0;
  border: none;
  border-radius: 0;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.figures-index__footer-per {
  padding: 0.65rem 0.9rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.figures-index__range {
  margin-top: 0;
  border: none;
  border-radius: 0;
  background: var(--st-bg-secondary);
}

.figures-index__footer nav[role="navigation"][aria-label="pager"] {
  margin-top: 0 !important;
}

.figures-index__bulk-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 4px 18px rgba(28, 25, 23, 0.08);
}

.figures-index__bulk-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--st-text-primary);
}

.figures-index__bulk-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--st-text-secondary);
}

.figures-index__bulk-delete {
  width: 100%;
  justify-content: center;
}

.figures-edit {
  max-width: 56rem;
  margin: 0 auto;
}

.figures-edit__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.figures-edit__back {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.figures-edit__back:hover {
  text-decoration: underline;
}

.figures-edit__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .figures-edit__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.figures-edit__preview {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.figures-edit__preview img {
  width: 100%;
  object-fit: contain;
  max-height: 480px;
  background: #f9fafb;
  display: block;
}

.figures-edit__placeholder {
  width: 100%;
  height: 16rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.figures-edit__meta p {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0 0 0.35rem 0;
}

.figures-edit__meta a {
  color: #2563eb;
  text-decoration: none;
}

.figures-edit__meta a:hover {
  text-decoration: underline;
}

.figures-edit__form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.figures-edit__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.figures-edit__input,
.figures-edit__textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 0.95rem;
  font-family: inherit;
}

.figures-edit__textarea {
  min-height: 6rem;
  resize: vertical;
}

.figures-edit__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.figures-edit__btn-secondary {
  display: inline-block;
  padding: 0.55rem 1rem;
  background: #e5e7eb;
  color: #1f2937;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}

.figures-edit__btn-secondary:hover {
  background: #d1d5db;
}

.figures-edit__section {
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.figures-edit__section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.figures-edit__code {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 0.875rem;
  word-break: break-all;
}

.figures-edit__copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.figures-edit__btn-copy {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  background: #e5e7eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.figures-edit__btn-copy:hover {
  background: #d1d5db;
}

.figures-edit__btn-danger {
  padding: 0.55rem 1rem;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}

.figures-edit__btn-danger:hover {
  background: #b91c1c;
}

/* =========================
   BILLING (/billing)
   ========================= */

.billing-page {
  max-width: 1120px;
  margin: 0 auto;
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  color: #1a1a1a;
}

.billing-page__header {
  margin-bottom: 1.75rem;
}

.billing-page__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.billing-page__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.billing-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.billing-page__subtitle {
  margin: 0;
  color: #888;
  font-size: 0.82rem;
}

.billing-page__status-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.billing-page__status-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.billing-page__status-links {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  margin-bottom: 0.35rem;
}

.billing-page__status-heading {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
}

.billing-page__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2d6a4f;
  text-decoration: none;
}

.billing-page__link:hover {
  text-decoration: underline;
}

.billing-page__status-sep {
  color: #ccc5b8;
  font-size: 0.9rem;
}

.billing-page__credits-balance {
  font-size: 2rem;
  font-weight: 700;
  color: #2d6a4f;
  line-height: 1.2;
}

.billing-page__subscription-active {
  color: #2d6a4f;
  font-weight: 600;
  font-size: 0.9rem;
}

.billing-page__subscription-inactive {
  color: #888;
  font-size: 0.9rem;
}

.billing-page__section-label {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
}

.billing-how-credits {
  margin-bottom: 2rem;
}

.billing-how-credits__card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  overflow: hidden;
}

.billing-how-credits__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.billing-how-credits__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.billing-how-credits__item:last-child {
  border-bottom: none;
}

.billing-how-credits__badge {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.billing-how-credits__badge--tone1 {
  background: #e6f4ed;
  color: #2d6a4f;
}

.billing-how-credits__badge--tone2 {
  background: #fef3c7;
  color: #92400e;
}

.billing-how-credits__badge--tone3 {
  background: #d1fae5;
  color: #065f46;
}

.billing-how-credits__badge--tonePdf {
  background: #ffedd5;
  color: #9a3412;
}

.billing-how-credits__badge--toneEmail {
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.82rem;
}

.billing-how-credits__body {
  min-width: 0;
}

.billing-how-credits__item-title {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
}

.billing-how-credits__item-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #888;
}

.billing-bundles {
  margin-bottom: 2rem;
}

.billing-bundles__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 960px) {
  .billing-bundles__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .billing-bundles__grid {
    grid-template-columns: 1fr;
  }
}

.billing-bundles__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.billing-bundles__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.08);
}

.billing-bundles__card--featured {
  background: #f0faf5;
  border-color: #86c9a2;
  box-shadow: 0 0 0 1px #b7dfc6;
}

.billing-bundles__card--featured .billing-bundles__credits {
  color: #2d6a4f;
}

.billing-bundles__card--featured .billing-bundles__price {
  color: #1f4d38;
}

.billing-bundles__card--featured .billing-bundles__per {
  color: #2d6a4f;
}

.billing-bundles__card-body {
  flex: 1 1 auto;
}

.billing-bundles__credits {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-bundles__price {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.billing-bundles__per {
  margin: 0;
  font-size: 0.78rem;
  color: #888;
}

.billing-bundles__card form {
  margin: 0.85rem 0 0;
  width: 100%;
}

.billing-bundles__buy {
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid #2d6a4f;
  background: #2d6a4f;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.billing-bundles__buy:hover {
  background: #1f4d38;
  border-color: #1f4d38;
}

.billing-bundles__card--featured .billing-bundles__buy {
  background: #1f4d38;
  border-color: #1f4d38;
}

.billing-bundles__card--featured .billing-bundles__buy:hover {
  background: #155e38;
  border-color: #155e38;
}

.billing-subscribe-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  padding: 1.5rem;
}

.billing-subscribe-card__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.billing-subscribe-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.billing-subscribe-card__lead {
  margin: 0 0 0.4rem;
  color: #888;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 40rem;
}

.billing-subscribe-card__note {
  margin: 0 0 0.75rem;
  color: #888;
  font-size: 0.82rem;
}

.billing-subscribe-card__price-line {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.billing-subscribe-card__per-year {
  font-size: 0.9rem;
  font-weight: 400;
  color: #888;
  margin-left: 0.25rem;
}

.billing-subscribe-card__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
  max-width: 24rem;
}

.billing-subscribe-card__notice {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.85rem;
  line-height: 1.45;
}

.billing-subscribe-card__notice--ok {
  background: #ecfdf5;
  border: 1px solid #2d6a4f;
  color: #065f46;
}

.billing-subscribe-card__notice--warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.billing-subscribe-card__cancel {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px solid #fca5a5;
  background: #fff;
  color: #b91c1c;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s;
}

.billing-subscribe-card__cancel:hover {
  background: #fef2f2;
}

.billing-subscribe-card__cta {
  align-self: center;
}

.billing-subscribe-card__subscribe-btn {
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  border: 1px solid #2d6a4f;
  background: #2d6a4f;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.billing-subscribe-card__subscribe-btn:hover {
  background: #1f4d38;
}

/* =========================
   CONTACT SHOW (profile: main tabs + right sidebar)
   Warm beige / taupe to align with students index
   ========================= */

.contact-show {
  --cs-canvas: #f9f8f4;
  --cs-text: #1c1917;
  --cs-text-secondary: #57534e;
  --cs-text-muted: #78716c;
  --cs-bg: #ffffff;
  --cs-bg-soft: #f3f0ea;
  --cs-border: #e8e4dc;
  --cs-accent: #5c5346;
  --cs-accent-strong: #433a32;
  --cs-radius: 12px;
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--cs-canvas);
  border-radius: var(--cs-radius);
}

.contact-show__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.contact-show__title {
  margin-bottom: 0.25rem;
  color: var(--cs-text);
}

.contact-show__subtitle {
  margin: 0;
  color: var(--cs-text-secondary);
}

.contact-show__header-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.contact-show__header .nav-link {
  color: var(--cs-accent);
}

.contact-show__header .nav-link:hover {
  color: var(--cs-accent-strong);
}

.contact-show__banner-warn {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.1rem;
  background: #fef9e8;
  border: 1px solid #e8d5a8;
  border-radius: var(--cs-radius);
  color: #5c4d24;
  font-size: 0.92rem;
  line-height: 1.5;
}

.contact-show__banner-cta {
  font-weight: 600;
  margin-left: 0.35rem;
}

.contact-show__layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 1.25rem;
  align-items: start;
}

/* ── Account page ── */
.account-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: start;
  max-width: min(960px, 100%);
  margin: 0 auto;
}

.contact-show .auth-card.contact-show__main {
  padding: 0;
  border-radius: var(--cs-radius);
  border: 0.5px solid var(--cs-border);
  box-shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  overflow: hidden;
}

.contact-show__main {
  min-width: 0;
}

.contact-show__body,
.groups-show__body {
  padding: 1.1rem 1.25rem;
  min-width: 0;
}

/* ── Contact assessment results (marking / insights / AI / student reports tabs) ── */
.car-results-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.car-results-page-header__actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.car-results-page-header h1 {
  margin-bottom: 0.25rem;
}

.car-results-page-header .subtitle {
  margin: 0;
}

.car-results-page-header .car-results-page-header__sep {
  color: var(--st-text-tertiary);
}

.contact-assessment-results.auth-card {
  padding: 0;
  margin-bottom: 1.25rem;
  border-radius: var(--st-radius-lg);
  border: 0.5px solid var(--st-border-secondary);
  box-shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  overflow: hidden;
}

.contact-assessment-results .contact-results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.75rem 1rem 0.85rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  background: linear-gradient(180deg, #fdfcfa 0%, #f7f5f0 100%);
}

.contact-assessment-results .contact-results-tabs [role="tab"] {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--st-text-secondary);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.contact-assessment-results .contact-results-tabs [role="tab"]:hover {
  background: rgba(92, 83, 70, 0.06);
  color: var(--st-text-primary);
}

.contact-assessment-results .contact-results-tabs [role="tab"][aria-selected="true"] {
  background: var(--st-bg-primary);
  color: var(--st-accent-strong);
  border-color: var(--st-border-secondary);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.06);
}

.contact-assessment-results .contact-results-tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--st-accent);
  outline-offset: 2px;
}

.contact-assessment-results__body {
  padding: 1.35rem 1.5rem 1.65rem;
  background: var(--st-canvas);
  min-width: 0;
}

.contact-assessment-results .car-tab-h2 {
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--st-text-primary);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.contact-assessment-results .car-tab-h2--tight {
  margin-bottom: 0.75rem;
}

.contact-assessment-results .car-tab-lead {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  line-height: 1.55;
}

.contact-assessment-results .car-tab-lead.car-tab-lead--flush {
  margin-bottom: 0;
}

.contact-assessment-results .car-tab-lead.car-tab-lead--short {
  margin-bottom: 1rem;
}

.contact-assessment-results .car-tab-lead .car-tab-lead__block {
  display: block;
  margin-top: 0.5rem;
}

.contact-assessment-results .car-edit-marks {
  padding: 0 0 1.15rem;
  margin-bottom: 1.15rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contact-assessment-results .car-edit-marks h3 {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--st-text-primary);
}

.contact-assessment-results .car-edit-marks__intro {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.55;
}

.contact-assessment-results .car-edit-marks__intro .car-edit-marks__intro-extra {
  display: block;
  margin-top: 0.5rem;
}

.contact-assessment-results .car-lock-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fdf6e9;
  border: 0.5px solid #e8d4b0;
  border-radius: var(--st-radius-md);
  color: #7c5e1a;
  font-size: 0.875rem;
  line-height: 1.5;
}

.contact-assessment-results .car-table-wrap {
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  overflow-x: auto;
  overflow-y: visible;
  background: var(--st-bg-primary);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
}

.contact-assessment-results .car-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  table-layout: fixed;
}

.contact-assessment-results .car-table thead tr {
  background: var(--st-bg-secondary);
}

.contact-assessment-results .car-table th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contact-assessment-results .car-mark-actions {
  margin-top: 1.25rem;
}

.contact-assessment-results .result-lock-toggle-wrap .result-lock-rail {
  background: #22c55e;
}

.contact-assessment-results .result-lock-toggle-wrap input.result-lock-cb:checked ~ .result-lock-rail {
  background: #dc2626;
}

.contact-assessment-results .result-lock-toggle-wrap input.result-lock-cb:checked ~ .result-lock-rail .result-lock-knob {
  transform: translateX(1.4rem);
}

.contact-assessment-results .result-lock-toggle-wrap input.result-lock-cb:focus-visible ~ .result-lock-rail {
  outline: 2px solid var(--st-accent);
  outline-offset: 2px;
}

.contact-assessment-results .insights-metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

.contact-assessment-results .insights-metadata-grid--with-charts {
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

@media (max-width: 900px) {
  .contact-assessment-results .insights-metadata-grid {
    grid-template-columns: 1fr;
  }
}

/* Wider table column when cohort comparison + bar chart share a row */
.contact-assessment-results .car-insight-section--with-chart .car-insight-split {
  grid-template-columns: minmax(0, 1.15fr) minmax(200px, 0.85fr);
}

@media (max-width: 900px) {
  .contact-assessment-results .car-insight-section--with-chart .car-insight-split {
    grid-template-columns: 1fr;
  }
}

.contact-assessment-results .car-insights-overall {
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-lg);
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
}

.contact-assessment-results .car-insights-overall__label {
  font-weight: 650;
  color: var(--st-text-primary);
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-assessment-results .car-insights-overall__score {
  font-size: 1.15rem;
  color: var(--st-text-primary);
  font-weight: 600;
}

.contact-assessment-results .car-insights-overall__score-note {
  color: var(--st-text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

.contact-assessment-results .car-insights-overall__cohort {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 0.5px solid var(--st-border-tertiary);
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.contact-assessment-results .car-ai-generate-btn {
  white-space: normal;
  height: auto;
  min-height: 36px;
  padding: 0.5rem 1rem;
  text-align: center;
  max-width: 100%;
}

.contact-assessment-results .car-ai-status {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  font-weight: 600;
  min-height: 1.35em;
}

.contact-assessment-results .car-ai-error {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #b45309;
  font-weight: 600;
}

.contact-assessment-results .car-ai-output {
  margin-top: 1rem;
  padding: 1.15rem 1.35rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  border-left: 3px solid var(--st-accent-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--st-text-primary);
  white-space: pre-wrap;
  min-height: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.contact-assessment-results .car-ai-intro-note {
  display: block;
  margin-top: 0.35rem;
}

.contact-assessment-results .car-ai-intro-muted {
  display: block;
  margin-top: 0.35rem;
  color: var(--st-text-secondary);
}

.contact-assessment-results .car-sr-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.35rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-lg);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
}

.contact-assessment-results .car-sr-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--st-text-primary);
}

.contact-assessment-results .car-sr-card .car-sr-intro {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.55;
}

.contact-assessment-results .car-sr-card .car-sr-textarea {
  width: 100%;
  max-width: 40rem;
  margin-top: 0.25rem;
  box-sizing: border-box;
}

.contact-assessment-results .car-sr-save-row {
  margin-top: 0.65rem;
}

.contact-assessment-results .car-sr-options-form {
  padding: 1.25rem 1.35rem;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-lg);
}

.contact-assessment-results .car-sr-options-form h3 {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--st-text-primary);
}

.contact-assessment-results .car-sr-options-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.contact-assessment-results .car-sr-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--st-radius-sm);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-assessment-results .car-sr-option:hover {
  border-color: var(--st-border-mid);
  background: #fff;
}

.contact-assessment-results .car-sr-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.contact-assessment-results .car-sr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.contact-assessment-results .car-sr-lead-between {
  margin: 1.25rem 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.55;
}

.contact-assessment-results .car-sr-table-section h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--st-text-primary);
}

.contact-assessment-results .car-sr-table-wrap {
  overflow-x: auto;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
}

.contact-assessment-results .car-sr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.contact-assessment-results .car-sr-table thead tr {
  background: var(--st-bg-secondary);
}

.contact-assessment-results .car-sr-table th {
  padding: 0.65rem 1rem;
  font-weight: 650;
  color: var(--st-text-secondary);
  font-size: 0.8125rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contact-assessment-results .car-sr-table td {
  padding: 0.65rem 1rem;
  color: var(--st-text-primary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contact-assessment-results .car-sr-table tbody tr:last-child td {
  border-bottom: none;
}

.car-insight-section {
  margin-top: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  padding: 1rem 1rem 1.05rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.car-insight-section--stacked {
  margin-top: 1.25rem;
}

.car-insight-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--st-text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.car-insight-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
}

.car-insight-section .car-insight-scroll {
  overflow-x: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}

.car-insight-table {
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.car-insight-table thead tr {
  background: var(--st-bg-secondary);
}

.car-insight-table th {
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  vertical-align: bottom;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.car-insight-table th.car-insight-table__num {
  text-align: center;
  white-space: nowrap;
}

.car-insight-table tbody tr {
  border-top: 0.5px solid var(--st-border-tertiary);
}

.car-insight-table tbody tr:first-child {
  border-top: none;
}

.car-insight-table td {
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  vertical-align: middle;
}

.car-insight-table td.car-insight-table__key {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.car-insight-table td.car-insight-table__num {
  white-space: nowrap;
  text-align: center;
}

.car-insight-table td.car-insight-table__gap {
  text-align: center;
  line-height: 1.25;
}

.car-insight-table .car-insight-gap-label {
  font-size: 0.72rem;
  color: var(--st-text-secondary);
  font-weight: 600;
}

/* Tab panel: undo global .nav-link / .auth-card form styles inside main card */
.contact-show__body .nav-link,
.groups-show__body .nav-link {
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--cs-accent);
  line-height: 1.35;
}

.contact-show__body .nav-link:hover,
.groups-show__body .nav-link:hover {
  color: var(--cs-accent-strong);
}

.groups-show .auth-card.groups-show__main {
  padding: 0;
  border-radius: var(--cs-radius);
  border: 0.5px solid var(--cs-border);
  box-shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  overflow: hidden;
  min-width: 0;
}

.contact-show .auth-card.contact-show__main select.cp-filter-select,
.contact-show .auth-card.contact-show__main .cp-add-group-select,
.groups-show .auth-card.groups-show__main select.cp-filter-select {
  width: auto;
  min-width: 12.5rem;
  max-width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  font-size: 0.875rem;
  line-height: 1.35;
  background-color: var(--st-bg-primary);
  color: var(--st-text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2357534e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  box-sizing: border-box;
}

.contact-show .auth-card.contact-show__main .cp-add-group-select {
  width: 100%;
  max-width: 440px;
}

.contact-show .auth-card.contact-show__main select.cp-filter-select:focus,
.contact-show .auth-card.contact-show__main .cp-add-group-select:focus,
.groups-show .auth-card.groups-show__main select.cp-filter-select:focus {
  outline: none;
  border-color: var(--cs-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.groups-show .auth-card.groups-show__main textarea.cp-notes__textarea,
.contact-show .auth-card.contact-show__main textarea.cp-notes__textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: var(--st-radius-sm);
  border: 0.5px solid var(--st-border-secondary);
  box-sizing: border-box;
}

.groups-show .auth-card.groups-show__main textarea.cp-notes__textarea:focus,
.contact-show .auth-card.contact-show__main textarea.cp-notes__textarea:focus {
  outline: none;
  border-color: var(--cs-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.contact-show .auth-card.contact-show__sidebar {
  background: var(--cs-bg);
  border: 0.5px solid var(--cs-border);
  border-radius: var(--cs-radius);
  box-shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  padding: 1.25rem 1.25rem 1.35rem;
}

.contact-show__sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.contact-show__avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  border: 0.5px solid var(--cs-border);
}

.contact-show__avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--cs-bg-soft);
  border: 0.5px solid var(--cs-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--cs-text-muted);
}

.contact-show__sidebar-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--cs-text);
}

.contact-show__sidebar-role {
  color: var(--cs-text-secondary);
  font-size: 0.9rem;
}

.contact-show__sidebar-block {
  margin-bottom: 1rem;
}

.contact-show__muted-label {
  color: var(--cs-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.contact-show__muted-label--section {
  margin-bottom: 0.4rem;
}

.contact-show__sidebar-divider {
  border-top: 1px solid var(--cs-border);
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.contact-show__sidebar-section-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--cs-text);
}

.contact-show__hint {
  color: var(--cs-text-secondary);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.contact-show__checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--cs-text);
}

.contact-show__checkbox {
  margin-top: 0.2rem;
  accent-color: var(--cs-accent);
}

.contact-show__details-grid {
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--cs-text);
}

.contact-show__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
}

.contact-show__detail-sub {
  margin-top: 0.4rem;
}

.contact-show__link-stack {
  display: grid;
  gap: 0.12rem;
}

.contact-show__parent-slots {
  display: grid;
  gap: 0.45rem;
}

.contact-show__parent-slot {
  text-align: left;
}

.contact-show__sibling-reason {
  font-size: 0.8rem;
  line-height: 1.15;
  color: var(--cs-text-secondary);
}

.contact-show__extra-fields {
  display: grid;
  gap: 0.35rem;
}

.contact-show__sidebar-link {
  display: block;
  padding: 0;
  margin: 0;
  text-align: left;
  line-height: 1.2;
  color: var(--cs-accent);
  font-size: inherit;
  font-weight: inherit;
}

.contact-show__sidebar .nav-link.contact-show__sidebar-link {
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  color: var(--cs-accent);
}

.contact-show__sidebar .nav-link.contact-show__sidebar-link:hover {
  color: var(--cs-accent-strong);
}

.contact-show__sidebar-link:hover {
  color: var(--cs-accent-strong);
}

.contact-show__sidebar-link--strong {
  font-weight: 600;
  display: inline-flex;
  justify-content: flex-start;
}

.contact-show__status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.contact-show__status-pill--on {
  background: #eaf3de;
  color: #3b6d11;
}

.contact-show__status-pill--off {
  background: #fee2e2;
  color: #991b1b;
}

.contact-show__btn {
  display: inline-block;
  box-sizing: border-box;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.25;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.contact-show__btn--spaced {
  margin-top: 0.75rem;
}

.contact-show__btn--primary,
.contact-show button.contact-show__btn--primary,
.contact-show input[type="submit"].contact-show__btn--primary {
  background: var(--cs-accent);
  color: #fafaf9;
  padding: 0.4rem 1rem;
  border: none;
}

.contact-show__btn--primary:hover,
.contact-show button.contact-show__btn--primary:hover,
.contact-show input[type="submit"].contact-show__btn--primary:hover {
  background: var(--cs-accent-strong);
}

.contact-show__btn--secondary,
.contact-show button.contact-show__btn--secondary {
  background: var(--cs-bg-soft);
  border: 1px solid var(--cs-border);
  color: var(--cs-text);
  padding: 0.3rem 0.75rem;
}

.contact-show__btn--secondary:hover,
.contact-show button.contact-show__btn--secondary:hover {
  background: #ebe4d8;
}

.contact-show__btn--danger,
.contact-show button.contact-show__btn--danger {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.3rem 0.75rem;
}

.contact-show__btn--danger:hover,
.contact-show button.contact-show__btn--danger:hover {
  background: #fecaca;
}

.contact-show__portal-block {
  margin-top: 0.6rem;
}

.contact-show__portal-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.contact-show__portal-badge--pending {
  background: #fef9e8;
  border: 1px solid #e8d5a8;
  color: #5c4d24;
}

.contact-show__portal-badge--active {
  background: #eaf3de;
  color: #3b6d11;
  border: 1px solid #c9dcb8;
}

.contact-show__portal-badge--neutral {
  background: var(--cs-bg-soft);
  color: var(--cs-text-secondary);
  border: 0.5px solid var(--cs-border);
  margin-bottom: 0.4rem;
}

.contact-show__portal-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.contact-show__portal-invite {
  margin-top: 0.4rem;
}

@media (max-width: 960px) {
  .contact-show__layout {
    grid-template-columns: 1fr;
  }
}

/* ── Profile / group tab nav (shared cp-tab) ── */
.contact-show__tabs-bar,
.groups-show__tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
}

.contact-show__tabs-bar .cp-tab,
.groups-show__tabs-bar .cp-tab {
  text-decoration: none;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: var(--st-radius-sm);
  display: inline-block;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  transition: background 0.12s, color 0.12s;
}

.contact-show__tabs-bar .cp-tab:hover,
.groups-show__tabs-bar .cp-tab:hover {
  background: var(--st-border-tertiary);
  color: var(--st-text-primary);
}

.contact-show__tabs-bar .cp-tab--active,
.groups-show__tabs-bar .cp-tab--active {
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.08);
}

/* ── Group show sidebar ── */
.gs-sidebar { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; overflow: hidden; }
.gs-card {
  background: var(--st-bg-primary);
  border: 1px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  padding: 1rem;
  overflow: hidden;
}
.gs-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--st-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.gs-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--st-border-tertiary);
  font-size: 0.82rem;
}
.gs-stat-row:last-child { border-bottom: none; }
.gs-stat-label { color: var(--st-text-secondary); }
.gs-stat-value { font-weight: 700; color: var(--st-text-primary); }
.gs-action-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.7rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border-secondary);
  background: var(--st-bg-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  margin-bottom: 0.4rem;
  overflow: hidden;
  white-space: nowrap;
}
.gs-action-btn:last-child { margin-bottom: 0; }
.gs-action-btn:hover { background: var(--st-border-tertiary); color: var(--st-text-primary); }
.gs-action-btn svg { opacity: 0.5; flex-shrink: 0; }

/* ── Group members tab ── */
.gm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.gm-search-wrap {
  position: relative;
  flex: 1;
  max-width: 280px;
}
.gm-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--st-text-tertiary);
  pointer-events: none;
}
.gm-search-wrap input.gm-search-input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem 0 2rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.8125rem;
  box-sizing: border-box;
}
.gm-search-wrap input.gm-search-input:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}
.gm-search-wrap input.gm-search-input::placeholder { color: var(--st-text-tertiary); }
.gm-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  border-radius: var(--st-radius-sm);
  border: none;
  background: var(--st-accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.gm-add-btn:hover { background: var(--st-accent-strong); color: #fff; }
.gm-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0.6rem;
}
.gm-section:first-of-type { margin-top: 0; }
.gm-section__title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--st-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.gm-section__count {
  background: var(--st-bg-secondary);
  color: var(--st-text-tertiary);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--st-border-secondary);
}
.gm-section__line {
  flex: 1;
  height: 1px;
  background: var(--st-border-secondary);
}
.gm-list { display: flex; flex-direction: column; gap: 2px; }
.gm-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.gm-row:hover {
  background: var(--st-bg-secondary);
  border-color: var(--st-border-secondary);
}
.gm-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.gm-avatar--teacher { background: #dbeafe; color: #1d4ed8; }
.gm-avatar--student { background: #dcfce7; color: #166534; }
.gm-info { min-width: 0; }
.gm-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--st-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gm-email {
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.gm-enrolment {
  font-size: 0.73rem;
  color: var(--st-text-tertiary);
  white-space: nowrap;
}
.gm-view-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--st-accent-strong);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border-secondary);
  background: var(--st-bg-secondary);
  white-space: nowrap;
  transition: background 0.12s;
}
.gm-view-btn:hover { background: var(--st-border-tertiary); }

/* Group show page header tags */
.gs-tag-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--st-bg-secondary);
  border: 1px solid var(--st-border-secondary);
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 0.72rem;
  color: var(--st-text-tertiary);
  font-weight: 500;
}
.gs-tag-chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--st-text-tertiary); font-weight: 700;
  padding: 0; line-height: 1; font-size: 0.75rem;
}
.gs-tag-chip-remove:hover { color: var(--st-text-primary); }
.gs-tags-wrap {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  margin-top: 0.35rem;
}

/* ── Tab section heading / empty state ── */
.cp-tab-heading {
  font-weight: 800;
  margin-bottom: 0.8rem;
  color: var(--st-text-primary);
}
.cp-tab-empty {
  color: var(--st-text-secondary);
  font-size: 0.9rem;
}
.cp-tab-hint {
  color: var(--st-text-secondary);
  font-size: 0.875rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.cp-tab-stack .cp-tab-hint {
  margin-bottom: 0;
}

.cp-tab-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.cp-tab-meta {
  font-size: 0.775rem;
  color: var(--st-text-tertiary);
  line-height: 1.45;
}

.cp-chart-wrap {
  max-width: 100%;
  overflow-x: auto;
  position: relative;
  min-height: 220px;
  margin-top: 0.5rem;
}

.cp-chart-wrap canvas {
  max-height: 320px;
}

.cp-assignment-card__badge-row {
  margin-top: 0.35rem;
}

.cp-assignment-card__actions {
  margin-top: 0.35rem;
}

.cp-assignment-progress {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cp-assignment-progress__inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.cp-assignment-progress__count {
  font-weight: 900;
  color: var(--st-text-primary);
  font-size: 0.68rem;
}

.cp-assignment-progress__pct {
  font-weight: 800;
  color: var(--st-text-secondary);
  font-size: 0.6rem;
}

.cp-assignment-card__link--strong {
  font-weight: 700;
}

.cp-table .nav-link {
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--st-accent);
}

.cp-table .nav-link:hover {
  color: var(--st-accent-strong);
}

/* ── Groups tab ── */
.cp-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.cp-group-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-secondary);
  padding: 0.3rem 0.55rem 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--st-text-primary);
  font-size: 0.875rem;
}
.cp-chip-link {
  text-decoration: none;
  color: var(--st-text-primary);
  font-weight: 700;
}
.cp-chip-link:hover { color: var(--st-accent); }
.cp-chip-link--muted {
  color: var(--st-text-secondary);
}
.cp-chip-meta {
  font-weight: 500;
  color: var(--st-text-tertiary);
  font-size: 0.775rem;
}
.cp-chip-remove {
  background: none;
  border: none;
  color: var(--st-text-tertiary);
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  font-size: 0.8rem;
}
.cp-chip-remove:hover { color: #991b1b; }

.cp-add-group-form {
  margin-top: 1rem;
  max-width: 440px;
}

.cp-add-group-form form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.cp-inline-form {
  display: inline;
  margin: 0;
}
.cp-add-group-select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: var(--st-radius-sm);
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.875rem;
  outline: none;
}
.cp-add-group-select:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92,83,70,0.12);
}

/* ── Notes tab ── */
.cp-notes {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cp-notes__title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--st-text-primary);
  font-size: 0.9rem;
}
.cp-notes__textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--st-radius-sm);
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-primary);
  resize: vertical;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--st-text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.cp-notes__textarea:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92,83,70,0.12);
}
.cp-notes__submit { margin-top: 0.6rem; }

.cp-note-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cp-note-card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-sm);
  padding: 0.9rem 1rem;
}
.cp-note-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.cp-note-card__author {
  color: var(--st-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.groups-show__body .cp-note-card__author.nav-link,
.contact-show__body .cp-note-card__author.nav-link {
  display: inline;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
}
.cp-note-card__dot { color: var(--st-text-tertiary); }
.cp-note-card__body {
  margin-top: 0.6rem;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.9rem;
}
.cp-note-delete {
  background: #fef2f2;
  border: 0.5px solid #fecaca;
  color: #991b1b;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.775rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.cp-note-delete:hover { background: #fecaca; }

/* ── Shared filter form (assignments + performance) ── */
.cp-filter-form {
  margin-bottom: 0;
}

.cp-filter-form .cp-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 0;
}

.cp-filter-form .cp-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
}

.cp-filter-form .cp-filter-label {
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-text-tertiary);
}

.cp-filter-form .cp-filter-select {
  width: 100%;
  min-width: 12.5rem;
  max-width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  font-size: 0.875rem;
  line-height: 1.35;
  background-color: var(--st-bg-primary);
  color: var(--st-text-primary);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2357534e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  box-sizing: border-box;
}

.cp-filter-form .cp-filter-select:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

/* ── Assignments tab ── */
.cp-assignments-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.cp-assignments-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--st-text-primary);
}
.cp-assignments-subtitle {
  color: var(--st-text-secondary);
  font-size: 0.875rem;
  margin-top: 0.1rem;
}
.cp-assignments-empty {
  text-align: center;
  padding: 3rem 2rem;
  border: 1.5px dashed var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-secondary);
}
.cp-assignments-empty__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.cp-assignments-empty__title { font-weight: 700; margin-bottom: 0.35rem; color: var(--st-text-primary); }
.cp-assignments-empty__body { color: var(--st-text-secondary); font-size: 0.9rem; }

/* Student contact + group show: assignments / performance tabs */
.cp-assignments-tab,
.cp-performance-tab {
  gap: 1.25rem;
}

.cp-performance-tab .cp-chart-wrap {
  margin-top: 0;
}

/* Group show: assignments tab cards */
.gp-assignments-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.gp-assignments-header__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--st-text-primary);
  margin-bottom: 0.15rem;
}

.gp-assignments-header__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.gp-assignment-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gp-assignment-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
}

.gp-assignment-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.gp-assignment-card__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--st-accent);
}

.gp-assignment-card__title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}

.gp-assignment-card__title-link {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--st-text-primary);
  text-decoration: none;
}

.gp-assignment-card__title-link:hover {
  color: var(--st-accent);
}

.gp-assignment-card__deadline {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.gp-assignment-card__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.gp-progress-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gp-ring-color, var(--st-accent)) var(--gp-ring-percent, 0%),
    var(--st-border-tertiary) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gp-progress-ring__inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.gp-progress-ring__count {
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--st-text-primary);
}

.gp-progress-ring__pct {
  font-weight: 700;
  font-size: 0.6rem;
  color: var(--st-text-secondary);
}

.gp-assignment-card__actions {
  margin-top: 0.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
  line-height: 0;
}

.cp-assignments-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
  overflow: hidden;
}

.cp-assignments-summary__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.85rem 0.75rem;
  text-align: center;
}

.cp-assignments-summary__stat + .cp-assignments-summary__stat {
  border-left: 0.5px solid var(--st-border-tertiary);
}

.cp-assignments-summary__value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--st-text-primary);
}

.cp-assignments-summary__label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.02em;
}

.cp-assignments-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cp-assignments-section__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-text-tertiary);
}

.cp-assignments-section__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cp-assignment-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0 1rem;
  align-items: center;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
  overflow: hidden;
  min-width: 0;
}

.cp-assignment-row__accent {
  align-self: stretch;
  width: 4px;
  min-height: 100%;
}

.cp-assignment-row--completed .cp-assignment-row__accent { background: #16a34a; }
.cp-assignment-row--pending .cp-assignment-row__accent { background: #2563eb; }
.cp-assignment-row--closed .cp-assignment-row__accent { background: #94a3b8; }

.cp-assignment-row__main {
  min-width: 0;
  padding: 0.85rem 0 0.85rem 0.25rem;
}

.cp-assignment-row__title {
  margin: 0 0 0.25rem;
  font-size: inherit;
  font-weight: inherit;
}

.cp-assignment-row__title-link {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--st-text-primary);
  text-decoration: none;
}

.cp-assignment-row__title-link:hover {
  color: var(--st-accent);
}

.cp-assignment-row__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.2rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.cp-assignment-row__meta-icon {
  flex-shrink: 0;
  color: var(--st-text-tertiary);
}

.cp-assignment-row__group-link {
  font-weight: 600;
  color: var(--st-text-secondary);
  text-decoration: none;
}

.cp-assignment-row__group-link:hover {
  color: var(--st-accent);
}

.cp-assignment-row__date {
  margin: 0;
  font-size: 0.775rem;
  color: var(--st-text-tertiary);
}

.cp-assignment-row__date--warn {
  color: #b91c1c;
  font-weight: 500;
}

.cp-assignment-row__trailing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 0.85rem;
  padding: 0.85rem 0.85rem 0.85rem 0;
  min-width: 0;
}

.cp-assignment-row__pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.cp-assignment-row__pill--completed {
  background: #dcfce7;
  color: #15803d;
}

.cp-assignment-row__pill--active {
  background: #dbeafe;
  color: #1d4ed8;
}

.cp-assignment-row__pill--closed {
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border: 0.5px solid var(--st-border-tertiary);
}

.cp-assignment-row__marks {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--st-text-secondary);
  white-space: nowrap;
}

.cp-assignment-row__marks-score {
  font-weight: 600;
  color: var(--st-text-secondary);
}

.cp-assignment-row__marks-pct {
  margin-left: 0.35rem;
  font-weight: 500;
  color: var(--st-text-tertiary);
}

.cp-assignment-row__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.cp-assignment-row__btn--results {
  padding: 0.4rem 0.9rem;
  border-radius: var(--st-radius-sm);
  background: var(--st-bg-primary);
  border: 1px solid #16a34a;
  color: #15803d;
}

.cp-assignment-row__btn--results:hover {
  background: #f0fdf4;
  color: #166534;
  border-color: #15803d;
}

.cp-assignment-row__btn--resend {
  padding: 0.4rem 0.9rem;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-secondary);
  color: var(--st-text-primary);
}

.cp-assignment-row__btn--resend:hover {
  background: #ebe6dc;
  border-color: var(--st-border-mid, var(--st-border-secondary));
}

.contact-show .cp-assignment-row__btn--resend {
  margin: 0;
}

.cp-assignment-row__action-muted {
  font-size: 0.8125rem;
  color: var(--st-text-tertiary);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .cp-assignments-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cp-assignments-summary__stat:nth-child(odd) {
    border-left: none;
  }

  .cp-assignments-summary__stat:nth-child(n+3) {
    border-top: 0.5px solid var(--st-border-tertiary);
  }

  .cp-assignment-row {
    grid-template-columns: 4px 1fr;
    grid-template-rows: auto auto;
  }

  .cp-assignment-row__trailing {
    grid-column: 2;
    justify-content: flex-start;
    padding: 0 0.85rem 0.85rem 0.25rem;
  }
}

.cp-assignments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.cp-assignment-card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cp-assignment-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.cp-assignment-card__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--st-accent);
}
.cp-assignment-card__body { flex: 1; min-width: 0; }
.cp-assignment-card__name {
  font-weight: 700;
  font-size: 0.975rem;
  line-height: 1.35;
}
.cp-assignment-card__meta {
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}
.cp-assignment-card__footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Status badges */
.cp-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-block;
}
.cp-badge--draft    { background: var(--st-bg-secondary); color: var(--st-text-secondary); }
.cp-badge--ready    { background: #e0f7fa; color: #0e7490; }
.cp-badge--active   { background: #dcfce7; color: #15803d; }
.cp-badge--closed   { background: #fee2e2; color: #991b1b; }
.cp-badge--completed{ background: #dcfce7; color: #15803d; }
.cp-badge--ended    { background: #ffedd5; color: #9a3412; }
.cp-badge--assigned { background: var(--st-bg-secondary); color: var(--st-text-secondary); }
.cp-badge--done     { background: #dcfce7; color: #15803d; }
.cp-badge--score    { background: var(--st-bg-secondary); color: var(--st-text-secondary); }
.cp-badge--neutral  { background: var(--st-bg-secondary); color: var(--st-text-secondary); border: 0.5px solid var(--st-border-secondary); }

.cp-resend-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}
.cp-resend-btn:hover { background: var(--st-bg-secondary); }

/* Non-student assignments table */
.cp-assignments-table-empty {
  padding: 1.25rem;
  border: 1.5px dashed var(--st-border-secondary);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  font-size: 0.9rem;
}
.cp-table-wrap {
  overflow-x: auto;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg-primary);
}
.cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.cp-table thead tr { background: var(--st-bg-secondary); text-align: left; }
.cp-table th {
  padding: 0.6rem 1rem;
  font-weight: 700;
  color: var(--st-text-secondary);
  border-bottom: 0.5px solid var(--st-border-secondary);
  white-space: nowrap;
}
.cp-table td {
  padding: 0.6rem 1rem;
  color: var(--st-text-primary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}
.cp-table tbody tr:last-child td { border-bottom: none; }
.cp-table td.cp-table__muted { color: var(--st-text-tertiary); font-size: 0.85rem; }

/* Contact show: list tables (reports, assignments) — match contacts index */
.contact-show__table-wrap,
.groups-show .contact-show__table-wrap,
.group-assessment-results .contact-show__table-wrap {
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--st-bg-primary);
}

.contact-show table.data-table,
.groups-show table.data-table,
.group-assessment-results table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  table-layout: auto;
}

.contact-show table.data-table thead tr,
.groups-show table.data-table thead tr,
.group-assessment-results table.data-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contact-show table.data-table thead th,
.groups-show table.data-table thead th,
.group-assessment-results table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.03em;
  vertical-align: middle;
  white-space: nowrap;
}

.contact-show table.data-table thead th.contact-show__th--actions,
.groups-show table.data-table thead th.contact-show__th--actions,
.group-assessment-results table.data-table thead th.contact-show__th--actions {
  text-align: right;
}

.contact-show table.data-table tbody tr,
.groups-show table.data-table tbody tr,
.group-assessment-results table.data-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contact-show table.data-table tbody tr:hover,
.groups-show table.data-table tbody tr:hover,
.group-assessment-results table.data-table tbody tr:hover {
  background: var(--st-bg-secondary);
}

.contact-show table.data-table tbody tr:last-child,
.groups-show table.data-table tbody tr:last-child,
.group-assessment-results table.data-table tbody tr:last-child {
  border-bottom: none;
}

.contact-show table.data-table tbody td,
.groups-show table.data-table tbody td,
.group-assessment-results table.data-table tbody td {
  padding: 11px 12px;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
  vertical-align: middle;
}

.contact-show table.data-table tbody td.contact-show__td--muted,
.groups-show table.data-table tbody td.contact-show__td--muted,
.group-assessment-results table.data-table tbody td.contact-show__td--muted {
  color: var(--st-text-tertiary);
  font-size: 0.8125rem;
}

.contact-show table.data-table tbody td.contact-show__td--actions,
.groups-show table.data-table tbody td.contact-show__td--actions,
.group-assessment-results table.data-table tbody td.contact-show__td--actions {
  text-align: right;
}

.contact-show table.data-table tbody td.contact-show__td--subject,
.groups-show table.data-table tbody td.contact-show__td--subject,
.group-assessment-results table.data-table tbody td.contact-show__td--subject {
  font-weight: 600;
  word-break: break-word;
}

.contact-show table.data-table .contact-show__table-link,
.groups-show table.data-table .contact-show__table-link,
.group-assessment-results table.data-table .contact-show__table-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--st-text-primary);
}

.contact-show table.data-table .contact-show__table-link:hover,
.groups-show table.data-table .contact-show__table-link:hover,
.group-assessment-results table.data-table .contact-show__table-link:hover {
  color: var(--st-accent);
}

.contact-show__table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  line-height: 0;
}

.contact-show table.data-table .contact-icon-link.contact-show__icon-btn,
.contact-show table.data-table button.contact-show__icon-btn,
.groups-show table.data-table .contact-icon-link.contact-show__icon-btn,
.groups-show table.data-table button.contact-show__icon-btn,
.group-assessment-results table.data-table .contact-icon-link.contact-show__icon-btn,
.group-assessment-results table.data-table button.contact-show__icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: transparent;
  color: var(--st-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  cursor: pointer;
  text-decoration: none;
}

.contact-show table.data-table .contact-icon-link.contact-show__icon-btn:hover,
.contact-show table.data-table button.contact-show__icon-btn:hover,
.groups-show table.data-table .contact-icon-link.contact-show__icon-btn:hover,
.groups-show table.data-table button.contact-show__icon-btn:hover,
.group-assessment-results table.data-table .contact-icon-link.contact-show__icon-btn:hover,
.group-assessment-results table.data-table button.contact-show__icon-btn:hover {
  background: var(--st-bg-secondary);
  color: var(--st-accent);
  border-color: var(--st-border-secondary);
}

.contact-show table.data-table .contact-icon-link.contact-show__icon-btn.contact-show__icon-btn--delete,
.contact-show table.data-table button.contact-show__icon-btn.contact-show__icon-btn--delete,
.groups-show table.data-table .contact-icon-link.contact-show__icon-btn.contact-show__icon-btn--delete,
.groups-show table.data-table button.contact-show__icon-btn.contact-show__icon-btn--delete,
.group-assessment-results table.data-table .contact-icon-link.contact-show__icon-btn.contact-show__icon-btn--delete,
.group-assessment-results table.data-table button.contact-show__icon-btn.contact-show__icon-btn--delete {
  color: #b91c1c;
  border-color: #fecaca;
}

.contact-show table.data-table .contact-icon-link.contact-show__icon-btn.contact-show__icon-btn--delete:hover,
.contact-show table.data-table button.contact-show__icon-btn.contact-show__icon-btn--delete:hover,
.groups-show table.data-table .contact-icon-link.contact-show__icon-btn.contact-show__icon-btn--delete:hover,
.groups-show table.data-table button.contact-show__icon-btn.contact-show__icon-btn--delete:hover,
.group-assessment-results table.data-table .contact-icon-link.contact-show__icon-btn.contact-show__icon-btn--delete:hover,
.group-assessment-results table.data-table button.contact-show__icon-btn.contact-show__icon-btn--delete:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.contact-show table.data-table .contact-show__icon-btn--disabled,
.groups-show table.data-table .contact-show__icon-btn--disabled,
.group-assessment-results table.data-table .contact-show__icon-btn--disabled {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--st-text-tertiary);
  cursor: not-allowed;
  line-height: 0;
}

/* =========================
   Group assessment results (/groups/:id/assessments/:id/results)
   Warm palette — matches contact-show / groups-show
   ========================= */

.group-assessment-results {
  --gar-accent: var(--st-accent);
  --gar-accent-strong: var(--st-accent-strong);
}

.group-assessment-results .gar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.group-assessment-results .gar-header__title {
  margin-bottom: 0.25rem;
}

.group-assessment-results .gar-header__subtitle {
  margin: 0;
  color: var(--st-text-secondary);
  font-size: 0.95rem;
}

.group-assessment-results .gar-header .nav-link {
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--st-accent);
  line-height: 1.35;
}

.group-assessment-results .gar-header .nav-link:hover {
  color: var(--st-accent-hover, var(--st-accent-strong));
}

.group-assessment-results .gar-header-actions .nav-link {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--st-accent);
}

.group-assessment-results .gar-header-actions .nav-link:hover {
  color: var(--st-accent-hover, var(--st-accent-strong));
}

.group-assessment-results .gar-header__sep {
  color: var(--st-text-tertiary);
}

.group-assessment-results .gar-header-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.group-assessment-results .gar-main-card {
  padding: 0;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--st-radius-lg);
  border: 0.5px solid var(--st-border-tertiary);
  box-shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  overflow: hidden;
}

/* Tab bar — same pattern as groups-show__tabs-bar / cp-tab */
.group-assessment-results .group-results-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem 1rem !important;
  padding: 0.85rem 1rem !important;
  border-bottom: 0.5px solid var(--st-border-tertiary) !important;
  background: var(--st-bg-secondary) !important;
}

.group-assessment-results .group-results-tabs [role="tab"] {
  text-decoration: none !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.8rem !important;
  border-radius: var(--st-radius-sm) !important;
  display: inline-block !important;
  border: none !important;
  background: transparent !important;
  color: var(--st-text-secondary) !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
}

.group-assessment-results .group-results-tabs [role="tab"]:hover {
  background: var(--st-border-tertiary) !important;
  color: var(--st-text-primary) !important;
}

.group-assessment-results .group-results-tabs [role="tab"][aria-selected="true"] {
  background: var(--st-bg-primary) !important;
  color: var(--st-text-primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.08) !important;
}

.group-assessment-results .group-results-tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--st-accent) !important;
  outline-offset: 2px !important;
}

.group-assessment-results .gar-panel-body {
  padding: 1.1rem 1.25rem 1.35rem;
}

.group-assessment-results .gar-heading {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-subheading {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
}

.group-assessment-results .gar-insights-data-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-sm);
}

.group-assessment-results .gar-hint--tight {
  margin-bottom: 0.75rem;
}

.group-assessment-results .gar-status {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  font-weight: 600;
  min-height: 1.35em;
}

.group-assessment-results .gar-status--ok {
  color: #15803d;
}

.group-assessment-results .gar-status--warn {
  color: #b45309;
}

.group-assessment-results .gar-error {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #991b1b;
  font-weight: 600;
}

.group-assessment-results .gar-divider {
  margin: 1.25rem 0;
  border: none;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.group-assessment-results .gar-soft-panel {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--st-bg-secondary) !important;
  border: 0.5px solid var(--st-border-tertiary) !important;
  border-radius: var(--st-radius-md) !important;
}

.group-assessment-results .gar-student-card {
  padding: 1.5rem 1.35rem !important;
  margin-top: 1.25rem !important;
  border: 0.5px solid var(--st-border-tertiary) !important;
  border-radius: var(--st-radius-md) !important;
  box-shadow: 0 2px 12px rgba(28, 25, 23, 0.04) !important;
}

.group-assessment-results .gar-student-card__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-student-card__name.nav-link {
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
}

.group-assessment-results .gar-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.group-assessment-results .gar-badge--neutral {
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border: 0.5px solid var(--st-border-tertiary);
}

.group-assessment-results .gar-badge--score {
  background: var(--st-bg-secondary);
  color: var(--st-text-primary);
  font-weight: 700;
}

.group-assessment-results .gar-badge--positive {
  background: #dcfce7;
  color: #15803d;
}

.group-assessment-results .gar-badge--negative {
  background: #fef2f2;
  color: #991b1b;
}

.group-assessment-results .gar-badge--assigned {
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border: 0.5px solid var(--st-border-tertiary);
}

.group-assessment-results .gar-badge--spaced {
  margin-left: 0.5rem;
}

.group-assessment-results .gar-student-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.group-assessment-results .gar-student-card__badges {
  margin-top: 0.35rem;
}

.group-assessment-results .gar-student-card__lock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.group-assessment-results .gar-student-card__lock-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.group-assessment-results .gar-marking-table th:nth-child(1) { width: 30%; }
.group-assessment-results .gar-marking-table th:nth-child(2) { width: 15%; }
.group-assessment-results .gar-marking-table th:nth-child(3) { width: 15%; }
.group-assessment-results .gar-marking-table th:nth-child(4) { width: 10%; }
.group-assessment-results .gar-marking-table th:nth-child(5) { width: 30%; }

.group-assessment-results .gar-marking-actions {
  margin-top: 1.25rem;
}

.group-assessment-results .gar-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.group-assessment-results .gar-progress-ring {
  --gar-ring-color: var(--st-accent);
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-assessment-results .gar-progress-ring--completed {
  --gar-ring-color: #16a34a;
}

.group-assessment-results .gar-progress-ring--ended {
  --gar-ring-color: #d97706;
}

.group-assessment-results .gar-progress-ring--assigned {
  --gar-ring-color: #5c5346;
}

.group-assessment-results .gar-progress-ring__inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
}

.group-assessment-results .gar-progress-ring__count {
  font-weight: 800;
  color: var(--st-text-primary);
  font-size: 0.85rem;
}

.group-assessment-results .gar-progress-ring__pct {
  font-weight: 700;
  color: var(--st-text-secondary);
  font-size: 0.7rem;
}

.group-assessment-results .gar-status-badge--completed {
  background: #dcfce7;
  color: #15803d;
}

.group-assessment-results .gar-status-badge--ended {
  background: #ffedd5;
  color: #9a3412;
}

.group-assessment-results .gar-status-badge--assigned {
  background: var(--st-bg-secondary);
  color: var(--st-text-primary);
  border: 0.5px solid var(--st-border-tertiary);
}

.group-assessment-results .gar-status-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.group-assessment-results .gar-insights-side {
  flex: 1;
  min-width: 240px;
}

.group-assessment-results .gar-insights-side--narrow {
  min-width: 200px;
}

.group-assessment-results .gar-score-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--st-text-primary);
  line-height: 1.55;
}

.group-assessment-results .gar-score-list__label {
  color: var(--st-text-secondary);
}

.group-assessment-results .gar-score-list__value {
  font-weight: 600;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-score-list__hint {
  color: var(--st-text-tertiary);
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.group-assessment-results .gar-overall-box__title {
  font-weight: 700;
  color: var(--st-text-primary);
  margin-bottom: 0.35rem;
}

.group-assessment-results .gar-overall-box__pct {
  color: var(--st-text-secondary);
}

.group-assessment-results .gar-overall-box__meta {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--st-text-secondary);
  font-weight: 600;
}

.group-assessment-results .gar-overall-box__score {
  font-size: 1.05rem;
}

.group-assessment-results .gar-insights-stat-value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.group-assessment-results .gar-insights-muted--tight {
  margin-top: 0.15rem;
}

.group-assessment-results .gar-insights-stat-label--loose {
  margin-bottom: 0.4rem;
}

.group-assessment-results .gar-body-muted {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
}

.group-assessment-results .gar-hint__block {
  display: block;
  margin-top: 0.35rem;
}

.group-assessment-results .gar-hint__block--muted {
  color: var(--st-text-secondary);
}

.group-assessment-results .gar-subheading--spaced {
  margin-bottom: 0.75rem;
}

.group-assessment-results .gar-lock-label {
  font-weight: 600;
  color: var(--st-text-secondary);
  font-size: 0.875rem;
}

.group-assessment-results .gar-lock-unlocked {
  font-size: 0.8125rem;
  color: #15803d;
  font-weight: 600;
  min-width: 4.25rem;
}

.group-assessment-results .gar-lock-locked {
  font-size: 0.8125rem;
  color: #b91c1c;
  font-weight: 600;
  min-width: 3.5rem;
}

.group-assessment-results .gar-notice-warn {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fffbeb !important;
  border: 0.5px solid #fcd34d !important;
  border-radius: var(--st-radius-sm) !important;
  color: #78350f !important;
  font-size: 0.875rem;
}

.group-assessment-results .gar-empty-muted {
  margin-top: 1rem;
  color: var(--st-text-secondary);
  font-weight: 600;
}

.group-assessment-results .gar-marking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: fixed;
}

.group-assessment-results .gar-marking-table thead tr {
  background: var(--st-bg-secondary) !important;
  text-align: left;
}

.group-assessment-results .gar-marking-table th,
.group-assessment-results .gar-marking-table td {
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  color: var(--st-text-primary);
  vertical-align: top;
}

.group-assessment-results .gar-marking-table tbody tr:last-child td {
  border-bottom: none;
}

.group-assessment-results .gar-marking-table tfoot td,
.group-assessment-results .gar-marking-table tr.gar-marking-total td {
  background: var(--st-bg-secondary) !important;
  font-weight: 700;
}

/* Insights summary card: KPIs row + distribution / support panels */
.group-assessment-results .gar-insights-summary {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.group-assessment-results .gar-insights-summary__kpis {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

.group-assessment-results .gar-insights-kpi {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.group-assessment-results .gar-insights-kpi--progress {
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding-right: 1.25rem;
  border-right: 0.5px solid var(--st-border-tertiary);
}

.group-assessment-results .gar-insights-kpi--average {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  flex: 1 1 160px;
}

.group-assessment-results .gar-insights-summary__panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.15rem;
  padding-top: 1.1rem;
  border-top: 0.5px solid var(--st-border-tertiary);
  align-items: stretch;
}

.group-assessment-results .gar-insights-summary__panels > :only-child {
  grid-column: 1 / -1;
}

@media (max-width: 820px) {
  .group-assessment-results .gar-insights-summary__panels {
    grid-template-columns: 1fr;
  }

  .group-assessment-results .gar-insights-kpi--progress {
    padding-right: 0;
    border-right: none;
    flex: 1 1 100%;
  }
}

.group-assessment-results .gar-insights-stat-label {
  color: var(--st-text-secondary);
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

.group-assessment-results .gar-insights-stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-insights-muted {
  color: var(--st-text-tertiary);
  font-size: 0.8125rem;
}

.group-assessment-results .gar-overall-box {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--st-bg-secondary) !important;
  border: 0.5px solid var(--st-border-tertiary) !important;
  border-radius: var(--st-radius-sm) !important;
  text-align: center;
  box-sizing: border-box;
}

.group-assessment-results .gar-ai-output {
  margin-top: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--st-bg-secondary) !important;
  border: 0.5px solid var(--st-border-tertiary) !important;
  border-radius: var(--st-radius-md) !important;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--st-text-primary) !important;
  white-space: pre-wrap;
  min-height: 0;
}

.group-assessment-results .group-class-insights-metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}

.group-assessment-results .group-class-insights-metadata-grid--with-charts {
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

@media (max-width: 700px) {
  .group-assessment-results .group-class-insights-metadata-grid {
    grid-template-columns: 1fr;
  }
}

/* Table + horizontal bar chart (group insights breakdown rows) */
.car-insight-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.95fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .car-insight-split {
    grid-template-columns: 1fr;
  }
}

.car-insight-split__chart {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-sm);
}

.insight-bar-chart__heading {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--st-text-secondary);
  margin-bottom: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.insight-bar-chart__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.insight-bar-chart__row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 28%) minmax(0, 1fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  font-size: 0.8125rem;
}

.insight-bar-chart__label {
  color: var(--st-text-secondary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-bar-chart__track {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--st-border-tertiary);
  overflow: hidden;
}

.insight-bar-chart__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.2s ease;
}

.insight-bar-chart__value {
  font-weight: 700;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Score distribution (bar chart) */
.group-assessment-results .gar-score-distribution {
  min-width: 0;
  padding: 0.85rem 1rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
}

.group-assessment-results .gar-score-distribution__title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-score-distribution__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.group-assessment-results .gar-score-distribution__row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  font-size: 0.8125rem;
}

.group-assessment-results .gar-score-distribution__label {
  font-weight: 600;
  color: var(--st-text-secondary);
  font-variant-numeric: tabular-nums;
}

.group-assessment-results .gar-score-distribution__track {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--st-border-tertiary);
  overflow: hidden;
}

.group-assessment-results .gar-score-distribution__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.group-assessment-results .gar-score-distribution__count {
  font-weight: 700;
  font-size: 0.8125rem;
  text-align: right;
  white-space: nowrap;
}

.group-assessment-results .gar-score-distribution__hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  line-height: 1.4;
}

/* Students needing support */
.group-assessment-results .gar-support-card {
  position: relative;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  background: var(--st-bg-primary);
  border: 0.5px solid #fcd34d;
  border-radius: var(--st-radius-md);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
  overflow: hidden;
}

.group-assessment-results .gar-support-card__accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #f59e0b;
  border-radius: var(--st-radius-md) 0 0 var(--st-radius-md);
}

.group-assessment-results .gar-support-card__body {
  padding: 0.85rem 1rem 0.9rem 1.1rem;
}

.group-assessment-results .gar-support-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.group-assessment-results .gar-support-card__icon {
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #d97706;
  margin-top: 0.1rem;
}

.group-assessment-results .gar-support-card__heading-text {
  min-width: 0;
  flex: 1;
}

.group-assessment-results .gar-support-card__title {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--st-text-primary);
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.group-assessment-results .gar-support-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #fef3c7;
  border: 0.5px solid #fcd34d;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 800;
}

.group-assessment-results .gar-support-card__desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.group-assessment-results .gar-support-card__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.group-assessment-results .gar-support-card__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.45rem;
}

.group-assessment-results .gar-support-chip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--st-radius-sm);
  background: #fffbeb;
  border: 0.5px solid #fde68a;
  min-width: 0;
}

.group-assessment-results .gar-support-chip__name.nav-link {
  font-weight: 700;
  color: #92400e;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.group-assessment-results .gar-support-chip__name.nav-link:hover {
  color: #78350f;
}

.group-assessment-results .gar-support-chip__detail {
  color: var(--st-text-tertiary);
  font-size: 0.7rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Topic gaps section */
.group-assessment-results .gar-topic-gaps {
  margin: 0 0 1.35rem;
  padding: 1rem 1.1rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.03);
}

.group-assessment-results .gar-topic-gaps__header {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.group-assessment-results .gar-topic-gaps__icon {
  font-size: 1.15rem;
  line-height: 1.2;
  opacity: 0.85;
}

.group-assessment-results .gar-topic-gaps__title {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-topic-gaps__intro {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.group-assessment-results .gar-topic-gaps__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.group-assessment-results .gar-topic-gaps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .group-assessment-results .gar-topic-gaps__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.group-assessment-results .gar-topic-gap-item {
  padding: 0.65rem 0.75rem;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-sm);
}

.group-assessment-results .gar-topic-gap-item__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.group-assessment-results .gar-topic-gap-item__topic {
  font-weight: 650;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-topic-gap-item__avg {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.group-assessment-results .gar-topic-gap-item__track {
  display: block;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--st-border-tertiary);
  overflow: hidden;
}

.group-assessment-results .gar-topic-gap-item__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.group-assessment-results .gar-topic-gap-item__affected {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--st-text-secondary);
  font-weight: 600;
}

.group-assessment-results .group-class-insights-metadata-grid h3 {
  margin: 0 0 0.5rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--st-text-primary) !important;
  background: var(--st-bg-secondary) !important;
  border: 0.5px solid var(--st-border-tertiary) !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--st-radius-sm) !important;
}

.group-assessment-results .group-class-insights-metadata-grid table thead tr {
  background: var(--st-bg-secondary) !important;
}

.group-assessment-results .group-class-insights-metadata-grid th {
  color: var(--st-text-secondary) !important;
  border-bottom: 0.5px solid var(--st-border-tertiary) !important;
}

.group-assessment-results .group-class-insights-metadata-grid td {
  color: var(--st-text-primary) !important;
  border-top: 0.5px solid var(--st-border-tertiary) !important;
}

.group-assessment-results #generate-group-ai-report-btn,
.group-assessment-results #bulk-student-ai-reports-btn,
.group-assessment-results #bulk-student-pdf-reports-btn {
  padding: 0.5rem 1.15rem !important;
  border-radius: var(--st-radius-sm) !important;
  border: none !important;
  background: var(--st-accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-size: 0.875rem !important;
  font-family: inherit !important;
}

.group-assessment-results #generate-group-ai-report-btn:hover:not(:disabled),
.group-assessment-results #bulk-student-ai-reports-btn:hover:not(:disabled),
.group-assessment-results #bulk-student-pdf-reports-btn:hover:not(:disabled) {
  background: var(--st-accent-hover) !important;
}

.group-assessment-results #generate-group-ai-report-btn:disabled,
.group-assessment-results #bulk-student-ai-reports-btn:disabled,
.group-assessment-results #bulk-student-pdf-reports-btn:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

.group-assessment-results .gar-report-options {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--st-bg-secondary) !important;
  border: 0.5px solid var(--st-border-tertiary) !important;
  border-radius: var(--st-radius-md) !important;
}

.group-assessment-results .gar-report-options--disabled {
  opacity: 0.6;
}

.group-assessment-results .gar-report-options fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.group-assessment-results .gar-report-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--st-text-primary);
}

.group-assessment-results .gar-report-options__grid {
  display: grid;
  gap: 0.65rem;
}

.group-assessment-results .gar-empty-dashed {
  padding: 1.25rem;
  border: 1.5px dashed var(--st-border-secondary) !important;
  border-radius: var(--st-radius-md) !important;
  background: var(--st-bg-secondary) !important;
  color: var(--st-text-secondary) !important;
}

.group-assessment-results .contact-show__table-wrap.gar-reports-table {
  margin-top: 0.75rem;
}


.group-assessment-results .result-lock-toggle-wrap {
  position: relative;
  width: 3.15rem;
  height: 1.7rem;
  flex-shrink: 0;
}

.group-assessment-results .result-lock-toggle-wrap input.result-lock-cb {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.group-assessment-results .result-lock-toggle-wrap .result-lock-rail {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 999px;
  transition: background 0.2s ease;
  background: #16a34a;
}

.group-assessment-results .result-lock-toggle-wrap input.result-lock-cb:checked ~ .result-lock-rail {
  background: #b91c1c;
}

.group-assessment-results .result-lock-toggle-wrap input.result-lock-cb:checked ~ .result-lock-rail .result-lock-knob {
  transform: translateX(1.4rem);
}

.group-assessment-results .result-lock-toggle-wrap .result-lock-knob {
  position: absolute;
  top: 0.22rem;
  left: 0.22rem;
  width: 1.26rem;
  height: 1.26rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.15);
  transition: transform 0.2s ease;
}

.group-assessment-results .result-lock-toggle-wrap input.result-lock-cb:focus-visible ~ .result-lock-rail {
  outline: 2px solid var(--st-accent);
  outline-offset: 2px;
}

/* =========================
   STUDENTS INDEX (/students)
   Reference: masterybyte_students_list / masterybyte_students_grid
   ========================= */

.students-index,
.contacts-index,
.groups-index,
.groups-form,
.questions-index,
.questions-show,
.questions-form,
.figures-index,
.assessments-form,
.assessments-index,
.reports-index {
  /* Beige canvas + warm neutrals (replacing cool blues) */
  --st-canvas: #f9f8f4;
  --st-text-primary: #1c1917;
  --st-text-secondary: #57534e;
  --st-text-tertiary: #a8a29e;
  --st-bg-primary: #ffffff;
  --st-bg-secondary: #f3f0ea;
  --st-border-secondary: #ddd8cf;
  --st-border-tertiary: #e8e4dc;
  --st-accent: #5c5346;
  --st-accent-strong: #433a32;
  --st-accent-soft: #8a7d6e;
  --st-badge-active-bg: #eaf3de;
  --st-badge-active-fg: #3b6d11;
  --st-radius-md: 8px;
  --st-radius-lg: 12px;
}

.students-index {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.contacts-index {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.assessments-index,
.reports-index {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.groups-index {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.groups-form {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.questions-index {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.figures-index {
  --fig-primary: #2d6a4f;
  --fig-primary-hover: #245a41;
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.assessments-form {
  --af-primary: #2d6a4f;
  --af-primary-hover: #245a41;
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.assessments-form .students-index__lead {
  max-width: none;
}

.assessments-index .assessments-index__lead {
  max-width: none;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .assessments-index .assessments-index__lead {
    white-space: normal;
  }
}

.assessments-form__errors {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--st-radius-md);
  background: #fef2f2;
  border: 0.5px solid #fecaca;
  color: #991b1b;
  font-size: 0.875rem;
}

.assessments-form__errors ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.assessments-form__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assessments-form__card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.assessments-form__card-head {
  padding: 0.65rem 1rem;
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.assessments-form__card-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--st-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.assessments-form__card-body {
  padding: 1rem 1.1rem 1.1rem;
}

.assessments-form__field {
  margin-bottom: 1rem;
}

.assessments-form__field:last-child {
  margin-bottom: 0;
}

.assessments-form__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.assessments-form__hint {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.assessments-form__input,
.assessments-form__select,
.assessments-form__textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--st-text-primary);
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  padding: 0.55rem 0.7rem;
}

.assessments-form__input:focus,
.assessments-form__select:focus,
.assessments-form__textarea:focus {
  outline: none;
  border-color: var(--st-accent-soft);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.assessments-form__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  padding-right: 1.75rem;
}

.assessments-form__tip--intro {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #f0faf4;
  border: 0.5px solid #b7e4c7;
  border-radius: var(--st-radius-md);
  font-size: 0.78rem;
  color: #1b4332;
  line-height: 1.5;
}

.assessments-form__tip--intro p {
  margin: 0;
}

.assessments-form__tip--intro svg {
  flex-shrink: 0;
  color: var(--af-primary);
  margin-top: 1px;
}

.assessments-form__settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .assessments-form__settings-grid {
    grid-template-columns: 1fr;
  }
}

.assessments-form__time-row,
.assessments-form__deadline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.assessments-form__input--time {
  width: 5.5rem;
  max-width: 100%;
}

.assessments-form__input--date,
.assessments-form__input--time {
  width: auto;
  min-width: 9rem;
}

.assessments-form__time-suffix {
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.assessments-form__options {
  padding: 0;
}

.assessments-form__toggle-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1.1rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.assessments-form__toggle-row:last-child {
  border-bottom: none;
}

.assessments-form__toggle {
  position: relative;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  margin-top: 1px;
}

.assessments-form__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.assessments-form__toggle-track {
  position: absolute;
  inset: 0;
  background: var(--st-border-secondary);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.assessments-form__toggle-track::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.assessments-form__toggle input:checked + .assessments-form__toggle-track {
  background: var(--af-primary);
}

.assessments-form__toggle input:checked + .assessments-form__toggle-track::before {
  transform: translateX(17px);
}

.assessments-form__toggle-copy {
  flex: 1;
  min-width: 0;
}

.assessments-form__toggle-title {
  margin: 0 0 0.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.assessments-form__toggle-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.assessments-form__card-body--builder {
  padding: 1rem 1.1rem 1.1rem;
}

.assessments-form__builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .assessments-form__builder-grid {
    grid-template-columns: 1fr;
  }
}

.assessments-form__builder-panel {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  padding: 0.85rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-secondary);
}

.assessments-form__builder-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.assessments-form__builder-panel-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--st-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.assessments-form__builder-panel-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--st-text-tertiary);
  white-space: nowrap;
}

.assessments-form__builder-search-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  margin-bottom: 0.65rem;
}

.assessments-form__builder-search {
  width: 100%;
}

.assessments-form__builder-bank {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 28rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.15rem 0.1rem 0.15rem 0;
}

.assessments-form__builder-dropzone {
  flex: 1;
  min-height: 14rem;
  max-height: 20rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem;
  border: 1.5px dashed var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
}

.assessments-form__builder-dropzone:has(.builder-item) {
  padding: 0.15rem 0.1rem 0.15rem 0;
  border-style: solid;
  border-width: 0.5px;
  background: transparent;
}

.assessments-form__builder-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 12rem;
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--st-text-tertiary);
  line-height: 1.45;
}

.assessments-form__builder-dropzone:has(.builder-item) .assessments-form__builder-empty {
  display: none;
}

.assessments-form__builder-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
  padding: 0.55rem 0.6rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
  cursor: grab;
}

.builder-item.assessments-form__builder-row {
  background: #f7faf8;
  border-color: #cfe8d8;
}

.assessments-form__builder-drag {
  flex-shrink: 0;
  color: var(--st-text-tertiary);
  align-self: center;
}

.assessments-form__builder-row-main {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.assessments-form__builder-ref {
  flex-shrink: 0;
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--af-primary);
  white-space: nowrap;
}

.assessments-form__builder-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.05rem 0 0;
  border-radius: 50%;
  background: var(--af-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.assessments-form__builder-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
  line-height: 1.4;
}

.assessments-form__builder-row-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.assessments-form__builder-row .questions-index__type-badge {
  flex-shrink: 0;
}

.assessments-form__builder-pts {
  font-size: 0.72rem;
  color: var(--st-text-secondary);
  white-space: nowrap;
}

.assessments-form__builder-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: 50%;
  background: var(--st-bg-primary);
  color: var(--af-primary);
  cursor: pointer;
}

.assessments-form__builder-add:hover {
  background: #f0faf4;
  border-color: var(--af-primary);
}

.assessments-form__builder-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--st-text-tertiary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.assessments-form__builder-remove:hover {
  color: #b91c1c;
  background: #fef2f2;
}

.assessments-form__builder-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.55rem 0.75rem;
  background: #f0faf4;
  border-radius: var(--st-radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.assessments-form__builder-total-value {
  color: var(--af-primary);
}

.assessments-form__builder-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--st-text-tertiary);
  text-align: center;
}

.assessments-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.assessments-form__delete-zone {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.assessments-form__btn-danger {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.assessments-form__btn-danger:hover {
  background: #b91c1c;
}

.assessments-form .EasyMDEContainer {
  margin-top: 0.35rem;
}

.assessments-form .editor-toolbar {
  border-color: var(--st-border-secondary);
  background: var(--st-bg-secondary);
}

.assessments-form .CodeMirror {
  border-color: var(--st-border-secondary);
  border-radius: 0 0 var(--st-radius-md) var(--st-radius-md);
}

.figures-index .students-index__lead {
  max-width: none;
}

.questions-show {
  max-width: min(1680px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

/* Side-by-side: question (left) | teacher guide (right) */
.questions-show__body-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.questions-show__body-grid .questions-show__card {
  margin-bottom: 0;
}

@media (max-width: 780px) {
  .questions-show__body-grid {
    grid-template-columns: 1fr;
  }
}

.questions-show__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.questions-show__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--st-text-primary);
  letter-spacing: -0.02em;
}

.questions-show__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.questions-show__header-actions {
  flex-shrink: 0;
}

.questions-show__card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.questions-show__card--teacher {
  background: var(--st-bg-secondary);
  border-style: dashed;
  border-color: var(--st-border-secondary);
}

.questions-show__card-heading {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.questions-show .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.questions-show__body {
  margin-bottom: 1.25rem;
}

.questions-show__sub-part {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.questions-show__sub-heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.questions-show__marks-line {
  margin: 1rem 0 0;
  text-align: right;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.questions-show__marks-line--total {
  margin-top: 1.5rem;
}

.questions-show__metadata {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.questions-show__metadata-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.questions-show__metadata-list {
  margin: 0;
  padding-left: 1.25rem;
}

.questions-show__divider {
  margin: 1rem 0;
  border: none;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.questions-show__intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.questions-show__teacher-part {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.questions-show__teacher-part:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.questions-show__marks-note {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.questions-show__label {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.questions-show__prose {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
}

.questions-show__answer-line {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
}

.questions-show__correct-list {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.questions-show__simulate {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--st-bg-secondary);
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
}

.questions-show__simulate-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.questions-show__simulate-intro {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.questions-show__mc-options {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.questions-show__mc-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--st-text-primary);
}

.questions-show__mc-option > input[type="radio"] {
  flex-shrink: 0;
  margin: 0;
  margin-top: 0.35rem;
  align-self: flex-start;
}

.questions-show__mc-option-text {
  flex: 1;
  min-width: 0;
  font-size: inherit;
  color: inherit;
  line-height: 1.5;
}

/* Option bodies are markdown (block elements); keep radio aligned with first line */
.questions-show__mc-option-text.question-body-markdown > :first-child {
  margin-top: 0;
}

.questions-show__mc-option-text.question-body-markdown > :last-child {
  margin-bottom: 0;
}

.questions-show__answer-field {
  margin-bottom: 1.25rem;
}

.questions-show__field-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--st-text-primary);
  margin-bottom: 0.4rem;
}

.questions-show__numeric-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.questions-show__input,
.questions-show__textarea {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--st-text-primary);
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  padding: 0.5rem 0.65rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.questions-show__input:focus,
.questions-show__textarea:focus {
  outline: none;
  border-color: var(--st-accent-soft);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.questions-show__input--numeric {
  width: 12rem;
  max-width: 100%;
}

.questions-show__textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 0.75rem;
  resize: vertical;
  min-height: 4.5rem;
}

.questions-show__units {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.questions-show__credit-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  margin: 0.5rem 0;
  cursor: pointer;
}

.questions-show__credit-label input {
  margin-top: 0.15rem;
  accent-color: var(--st-accent);
}

.questions-show__simulate-btn {
  margin-top: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-accent-strong);
  background: var(--st-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.questions-show__simulate-btn:hover {
  background: var(--st-accent-hover);
}

.questions-show__simulate-status {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.questions-show__simulate-output {
  display: none;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
  font-size: 0.78rem;
  white-space: pre-wrap;
  max-height: 22rem;
  overflow: auto;
  color: var(--st-text-primary);
}

.questions-show__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.questions-show__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.questions-show__nav .students-index__btn--primary {
  margin-left: auto;
}

/* =========================
   QUESTIONS FORM (new / edit)
   ========================= */

.questions-form {
  --qf-canvas: #f5f0eb;
  --qf-primary: #2d6a4f;
  --qf-primary-hover: #245a41;
  --qf-border: #ddd8cf;
  --qf-border-light: #e5e0d8;
  --qf-border-faint: #f0ebe3;
  --qf-text-muted: #999;
  --qf-tip-bg: #faf7f3;
  --qf-tip-text: #7c6c57;
}

.questions-form {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  background: var(--qf-canvas);
  border-radius: var(--st-radius-lg);
}

.questions-form .students-index__lead,
.questions-form.qb-form .qb-topbar__lead,
.questions-form.qb-form .qb-question-intro,
.questions-form__hint {
  max-width: none;
}

.questions-form__hint {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

#question-form-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

#question-form-layout .question-form-save-rail {
  flex: 0 0 11.5rem;
  position: sticky;
  top: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #fff;
  border: 0.5px solid var(--qf-border);
  border-radius: var(--st-radius-md);
  box-shadow: 0 2px 12px rgba(60, 45, 30, 0.08);
}

#question-form-layout .question-form-save-rail__btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.questions-form__btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 1rem;
  border-radius: 7px;
  border: 0.5px solid var(--qf-border);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 500;
  color: #555;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}

.questions-form__btn-ghost:hover {
  background: #ede8e0;
  color: var(--st-text-primary);
}

.questions-form__btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 34px;
  padding: 0 1.125rem;
  border-radius: 7px;
  border: none;
  background: var(--qf-primary);
  color: #fff;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
}

.questions-form__btn-primary:hover {
  background: var(--qf-primary-hover);
  color: #fff;
}

.questions-form__errors {
  background: #fef2f2;
  border: 0.5px solid #fecaca;
  border-radius: var(--st-radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  color: #991b1b;
  font-size: 0.875rem;
}

.questions-form__errors ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.questions-form__content {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.125rem;
  align-items: start;
}

@media (max-width: 900px) {
  #question-form-layout .question-form-save-rail {
    flex: 1 1 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  #question-form-layout .question-form-save-rail__btn {
    flex: 1 1 auto;
    width: auto;
    min-width: 7rem;
  }

  .questions-form__content {
    grid-template-columns: 1fr;
  }
}

.questions-form__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.questions-form__sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.questions-form__card {
  background: #fff;
  border: 0.5px solid var(--qf-border-light);
  border-radius: 10px;
  overflow: hidden;
}

.questions-form__card-head {
  padding: 0.7rem 1rem 0.55rem;
  border-bottom: 0.5px solid var(--qf-border-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.questions-form__card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.questions-form__card-hint {
  font-size: 0.73rem;
  color: #bbb;
}

.questions-form__card-body {
  padding: 0.875rem 1rem;
}

.questions-form__card-body > p {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.questions-form__tip {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--qf-tip-bg);
  border: 0.5px solid var(--qf-border-light);
  border-radius: 7px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.74rem;
  color: var(--qf-tip-text);
  line-height: 1.6;
}

.questions-form__tip svg {
  flex-shrink: 0;
  color: #b09070;
  margin-top: 1px;
}

.questions-form__tip code {
  background: #ede8e0;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
  font-size: 0.71rem;
  color: #555;
}

.questions-form__toggle-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem 1rem;
  border-bottom: 0.5px solid var(--qf-border-faint);
}

.questions-form__toggle-copy {
  flex: 1;
  min-width: 0;
}

.questions-form__toggle {
  position: relative;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  margin-top: 1px;
}

.questions-form__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.questions-form__toggle-track {
  position: absolute;
  inset: 0;
  background: var(--qf-border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.questions-form__toggle-track::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.questions-form__toggle input:checked + .questions-form__toggle-track {
  background: var(--qf-primary);
}

.questions-form__toggle input:checked + .questions-form__toggle-track::before {
  transform: translateX(17px);
}

.questions-form__toggle-title {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.questions-form__toggle-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
  max-width: none;
}

.questions-form__marking-fields {
  padding: 0.875rem 1rem 1rem;
  border-top: 0.5px solid var(--qf-border-faint);
}

.questions-form__marking-intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--st-text-primary);
  line-height: 1.45;
}

.questions-form__field--stacked {
  margin-bottom: 1rem;
}

.questions-form__field--stacked:last-child {
  margin-bottom: 0;
}

.questions-form__field--stacked .questions-form__field-label {
  display: block;
  margin-bottom: 0.35rem;
}

.questions-form__field--stacked .questions-form__select {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.questions-form__marking-fields .questions-form__field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--st-text-primary);
  text-transform: none;
  letter-spacing: normal;
}

.questions-form__fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .questions-form__fields-row {
    grid-template-columns: 1fr;
  }
}

.questions-form__field label,
.questions-form__field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--qf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.questions-form__input,
.questions-form__select,
.questions-form__textarea,
.questions-form select,
.questions-form input[type="text"],
.questions-form input[type="number"],
.questions-form textarea:not(.CodeMirror textarea) {
  width: 100%;
  font-family: inherit;
  font-size: 0.83rem;
  color: #333;
  background: #fff;
  border: 0.5px solid var(--qf-border);
  border-radius: 7px;
  padding: 0.4rem 0.65rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.questions-form__select,
.questions-form select {
  height: 34px;
  padding-right: 2rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.questions-form__input:focus,
.questions-form__select:focus,
.questions-form__textarea:focus,
.questions-form select:focus,
.questions-form input:focus,
.questions-form textarea:focus {
  outline: none;
  border-color: var(--qf-primary);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12);
}

.questions-form__math-panel {
  background: var(--qf-tip-bg);
  border: 0.5px solid var(--qf-border-light);
  border-radius: 7px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.65rem;
}

.questions-form__math-panel-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.45rem;
}

.questions-form__math-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.questions-form__math-row math-field {
  flex: 1 1 12rem;
  min-height: 2rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 0.5px solid var(--qf-border);
  background: #fff;
  box-sizing: border-box;
}

.questions-form__btn-sm {
  height: 32px;
  padding: 0 0.75rem;
  border-radius: 6px;
  border: 0.5px solid var(--qf-border);
  background: #fff;
  font-size: 0.77rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.questions-form__btn-sm:hover {
  background: #ede8e0;
}

.questions-form__btn-sm--primary {
  background: var(--qf-primary);
  border-color: var(--qf-primary);
  color: #fff;
}

.questions-form__btn-sm--primary:hover {
  background: var(--qf-primary-hover);
  color: #fff;
}

.questions-form__validation-panel {
  margin-top: 1rem;
  padding: 0.875rem;
  background: var(--qf-tip-bg);
  border-radius: 7px;
  border: 0.5px solid var(--qf-border-light);
}

.questions-form__mc-options {
  padding: 0 1rem 1rem;
  border-top: 0.5px solid var(--qf-border-faint);
}

.questions-form__mc-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--qf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.75rem 0 0.5rem;
}

.questions-form .option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.questions-form .option-row input[type="text"] {
  flex: 1;
}

.questions-form__mc-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.questions-form__link-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 0.5px solid var(--qf-primary);
  color: var(--qf-primary);
  background: transparent;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.questions-form__link-btn:hover {
  background: rgba(45, 106, 79, 0.08);
}

.questions-form__link-btn--danger {
  border-color: #fecaca;
  color: #be123c;
}

.questions-form__link-btn--danger:hover {
  background: #fff1f2;
}

.questions-form__sidebar-card {
  background: #fff;
  border: 0.5px solid var(--qf-border-light);
  border-radius: 10px;
  overflow: hidden;
}

.questions-form__sidebar-head {
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 0.5px solid var(--qf-border-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.questions-form__sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.questions-form__sidebar-sub {
  font-size: 0.69rem;
  color: #bbb;
}

.questions-form__sidebar-body {
  padding: 0.65rem 0.75rem;
}

.questions-form__sidebar-body > p {
  font-size: 0.73rem;
  color: #bbb;
  margin: 0 0 0.55rem;
  line-height: 1.5;
}

.questions-form__tags-hint {
  font-size: 0.71rem;
  color: #bbb;
  margin: 0.35rem 0 0;
}

.questions-form__curriculum-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.questions-form__field--full {
  grid-column: 1 / -1;
}

.questions-form__curriculum-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.questions-form__curriculum-grid .questions-form__tags-hint {
  margin: 0.25rem 0 0.35rem;
}

.questions-form__sidebar [data-controller="figure-picker"] {
  position: sticky;
  top: 3.5rem;
  flex: none;
  min-width: 0;
  max-width: none;
  max-height: calc(100vh - 5rem);
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.questions-form__sidebar [data-controller="figure-picker"] > div[style*="grid"] {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
}

.questions-form__sidebar [data-controller="figure-picker"] button[type="button"] {
  border: 0.5px solid var(--qf-border-light) !important;
  border-radius: 6px !important;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.questions-form__sidebar [data-controller="figure-picker"] button[type="button"]:hover {
  border-color: var(--qf-primary) !important;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.14);
}

.questions-form__sidebar [data-controller="figure-picker"] button[type="button"] img {
  height: 52px !important;
  object-fit: cover;
}

.questions-form__sidebar [data-controller="figure-picker"] button[type="button"] span {
  font-size: 0.64rem !important;
  color: #bbb !important;
  background: #fff !important;
  padding: 3px 4px 5px !important;
}

.questions-form .EasyMDEContainer {
  border: 0.5px solid var(--qf-border);
  border-radius: 7px;
  overflow: hidden;
}

.questions-form .editor-toolbar {
  background: var(--qf-tip-bg);
  border-bottom: 0.5px solid var(--qf-border-light);
  opacity: 1;
}

.questions-form .editor-toolbar button {
  color: #666 !important;
  border: none !important;
}

.questions-form .editor-toolbar button:hover {
  background: #ede8e0 !important;
  color: var(--st-text-primary) !important;
}

.questions-form .CodeMirror {
  border: none;
  background: #fff;
  min-height: 140px;
  font-size: 0.87rem;
}

.questions-form .CodeMirror-scroll {
  min-height: 140px;
}

.questions-form__delete-zone {
  margin-top: 1.5rem;
  padding: 1.25rem 1.25rem 0;
  border-top: 0.5px solid var(--qf-border);
}

.questions-form__btn-danger {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 1.125rem;
  border-radius: 7px;
  border: 0.5px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}

.questions-form__btn-danger:hover {
  background: #fee2e2;
}

.questions-form__ai-hint {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--qf-tip-bg);
  border-radius: 7px;
  border: 0.5px solid var(--qf-border-light);
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.questions-form__sub-question-card {
  padding: 1rem;
  margin-bottom: 0.875rem;
  border: 0.5px solid var(--qf-border-light);
  border-radius: 10px;
  background: #fff;
}

/* Grouped question builder mockup-matched layout */
.dashboard.questions-form.qb-form {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1rem 0 2.5rem;
  background: #f3eee8;
  border-radius: 0;
  color: #292723;
}

.qb-form * {
  box-sizing: border-box;
}

.qb-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qb-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  color: #a09890;
  text-transform: uppercase;
}

.qb-topbar__title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
  color: #272420;
}

.qb-topbar__copy {
  width: 100%;
  max-width: none;
  padding-left: 1.25rem;
}

.qb-topbar__lead {
  margin: 0.45rem 0 0;
  max-width: none;
  font-size: 0.93rem;
  color: #6b6259;
  line-height: 1.35;
}

.qb-topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.qb-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.9rem;
  border-radius: 7px;
  border: 0.5px solid #ddd6cd;
  background: #fffdfa;
  color: #4a433b;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.qb-btn--primary {
  border-color: #2f7657;
  background: #2d6a4f;
  color: #fff;
}

.qb-btn--primary:hover {
  background: #245a41;
  color: #fff;
}

.qb-btn--soft:hover {
  background: #f6f2ed;
}

.qb-btn--ai {
  border-color: #d8c8ff;
  background: #f4efff;
  color: #5426d8;
}

.qb-btn--ai:disabled {
  opacity: 1;
  cursor: default;
}

.qb-form #question-form-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 284px 12.25rem;
  gap: 0.875rem;
  align-items: start;
  margin: 0;
}

.qb-form #question-form-layout .question-form-save-rail {
  position: sticky;
  top: 0.75rem;
  align-self: start;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #fff;
  border: 0.5px solid #ded6cc;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(60, 45, 30, 0.08);
}

.qb-form #question-form-layout .question-form-save-rail__btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  height: 38px;
}

.qb-form .qb-btn--block {
  width: 100%;
  justify-content: center;
}

.qb-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qb-rail,
.qb-panel,
.qb-metadata,
.qb-subq {
  background: #fffdf9;
  border: 0.5px solid #ded6cc;
  border-radius: 8px;
  overflow: hidden;
}

.qb-rail,
.qb-metadata {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
  overflow-y: auto;
}

.qb-section-head {
  min-height: 42px;
  padding: 0.8rem 0.75rem 0.55rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 0.5px solid #eee8df;
}

.qb-section-title,
.qb-label,
.questions-form__mc-label {
  display: block;
  margin: 0 0 0.35rem;
  color: #8f877d;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.qb-section-title {
  margin: 0;
  color: #6f675e;
}

.qb-section-note {
  color: #aaa29a;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.qb-section-head--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.qb-section-intro {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  color: #6b6259;
  text-transform: none;
  letter-spacing: normal;
}

.qb-section-body {
  padding: 0.75rem;
}

.qb-panel > .qb-section-body {
  padding: 0.75rem 0.75rem 0.85rem;
}

.qb-textarea,
.questions-form.qb-form .questions-form__input,
.questions-form.qb-form .questions-form__select,
.questions-form.qb-form input[type="text"],
.questions-form.qb-form input[type="number"],
.questions-form.qb-form input[type="search"],
.questions-form.qb-form textarea:not(.CodeMirror textarea),
.questions-form.qb-form select {
  width: 100%;
  min-width: 0;
  border: 0.5px solid #d8d0c6;
  border-radius: 7px;
  background: #fff;
  color: #2f2c28;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 0.6rem 0.7rem;
  box-shadow: none;
}

.questions-form.qb-form .questions-form__select,
.questions-form.qb-form select,
.questions-form.qb-form input[type="text"],
.questions-form.qb-form input[type="number"],
.questions-form.qb-form input[type="search"] {
  height: 39px;
}

.qb-textarea:focus,
.questions-form.qb-form input:focus,
.questions-form.qb-form textarea:focus,
.questions-form.qb-form select:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12);
}

.qb-question-intro {
  margin: 0 0 0.75rem;
  max-width: none;
  font-size: 0.86rem;
  color: #6b6259;
  line-height: 1.45;
}

.qb-question-body .questions-form__tip {
  margin-bottom: 0.65rem;
}

.qb-question-body .questions-form__math-panel {
  margin-top: 0.65rem;
}

.qb-rich-text-field .questions-form__tip {
  margin-bottom: 0.65rem;
}

.qb-rich-text-field .questions-form__math-panel {
  margin-top: 0.65rem;
}

.qb-explanation-block.qb-rich-text-field,
.qb-explanation-block .qb-rich-text-field {
  margin-top: 0;
}

.qb-subq .EasyMDEContainer {
  margin-bottom: 0;
}

.qb-stem-tools {
  margin-top: 0.7rem;
}

.qb-math-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem;
  background: #faf7f3;
  border: 0.5px solid #e5ded4;
  border-radius: 7px;
}

.qb-math-inline math-field {
  min-height: 34px;
  border: 0.5px solid #d8d0c6;
  border-radius: 6px;
  background: #fff;
  font-size: 0.95rem;
}

.qb-math-actions {
  display: flex;
  gap: 0.6rem;
}

.qb-figure-search {
  margin-bottom: 0.6rem;
}

.qb-figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.qb-figure-tile {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0.5px solid #e2dbd1;
  border-radius: 7px;
  overflow: hidden;
  background: #fbf8f4;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.qb-figure-tile:hover {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 1px rgba(45, 106, 79, 0.2);
}

.qb-figure-tile:focus-visible {
  outline: 2px solid #2d6a4f;
  outline-offset: 2px;
}

.qb-figure-thumb {
  position: relative;
  display: block;
  height: 76px;
  background: #f5efe7;
  overflow: hidden;
}

.qb-figure-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.qb-figure-name {
  display: block;
  padding: 0.3rem 0.45rem 0;
  color: #524b43;
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qb-figure-hint {
  display: block;
  padding: 0.15rem 0.45rem 0.35rem;
  color: #857c72;
  font-size: 0.65rem;
  font-weight: 600;
}

.qb-parts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qb-subq {
  margin: 0;
}

.qb-subq-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 54px;
  padding: 0.75rem;
  border-bottom: 0.5px solid #eee8df;
}

.qb-subq-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: #292723;
}

.qb-subq-title strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.2;
  font-weight: 800;
}

.qb-subq-title span[data-sub-summary] {
  display: block;
  margin-top: 0.1rem;
  color: #696159;
  font-size: 0.78rem;
  line-height: 1.2;
}

.qb-part-pill {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2d6a4f;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 850;
  flex: 0 0 auto;
}

.qb-icon-btn {
  width: 31px;
  height: 31px;
  border: 0.5px solid #ded6cc;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #776d63;
  font-size: 0.9rem;
}

button.qb-icon-btn {
  padding: 0;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

button.qb-icon-btn:hover {
  background: #faf7f3;
  color: #4a433c;
}

.qf-part-remove-btn svg {
  display: block;
}

.qb-subq-body {
  padding: 0.8rem 0.75rem 0.75rem;
}

.qb-field {
  min-width: 0;
}

.qb-field--wide {
  grid-column: 1 / -1;
}

.qb-subq-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px 94px;
  gap: 0.6rem;
  align-items: end;
  margin-top: 0.75rem;
}

.qb-field--type .questions-form__select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.qb-type-tabs {
  height: 42px;
  padding: 0.22rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.22rem;
  border: 0.5px solid #d8d0c6;
  border-radius: 7px;
  background: #fbf8f4;
}

.qb-type-tab {
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #685f56;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.qb-type-tab.is-active {
  background: #fff;
  color: #2d6a4f;
  box-shadow: 0 1px 4px rgba(51, 44, 35, 0.08);
}

.qb-answer-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 0.5px solid #e0d8ce;
  border-radius: 7px;
  background: #faf7f3;
}

.qb-answer-grid {
  display: grid;
  gap: 0.65rem;
  align-items: end;
}

.qb-answer-grid--three {
  grid-template-columns: minmax(0, 1fr) 142px 142px;
}

.qb-answer-grid--two {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.8fr);
}

.qb-answer-note {
  margin: 0.35rem 0 0;
  color: #6d655c;
  font-size: 0.8rem;
  line-height: 1.4;
}

.qb-check-row,
.qb-equivalence-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
  color: #5e564e;
  font-size: 0.8rem;
}

.qb-mcq-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 0.75rem;
}

.sub-option-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 32px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sub-option-row input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: #2d6a4f;
}

.qb-option-delete {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 0.5px solid #ded6cc;
  background: #fff;
  color: #7b7167;
  font-size: 1.05rem;
  cursor: pointer;
}

.qb-marking-preview {
  min-height: 140px;
  padding: 0.75rem;
  border: 0.5px solid #e3dbd1;
  border-radius: 7px;
  background: #fffaf5;
  color: #635a51;
  font-size: 0.8rem;
  line-height: 1.45;
}

.qb-marking-preview strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #2d2925;
  font-size: 0.82rem;
  font-weight: 850;
}

.qb-marking-preview ol {
  margin: 0;
  padding-left: 1.15rem;
}

.qb-explanation-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 0.5px solid #eee8df;
}

.qb-rich-text-field .qb-field-intro {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.86rem;
  color: #6b6259;
  line-height: 1.45;
}

.qb-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  border: 0.5px dashed #d5ccbf;
  border-radius: 8px;
  background: #fffdf9;
}

.qb-add-row strong {
  display: block;
  font-size: 0.94rem;
  color: #272420;
}

.qb-add-row span {
  display: block;
  margin-top: 0.15rem;
  color: #7a7168;
  font-size: 0.78rem;
}

.qb-metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 0.55rem;
}

.qb-meta-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.qb-metric {
  min-height: 56px;
  padding: 0.6rem 0.65rem;
  border: 0.5px solid #ded6cc;
  border-radius: 7px;
  background: #faf7f3;
}

.qb-metric span {
  display: block;
  color: #a09890;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qb-metric strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  color: #2c2925;
}

.qb-ai-panel--pending {
  border-color: #e2dbd1;
  background: #faf8f5;
}

.qb-ai-panel--pending strong {
  color: #6f675e;
}

.qb-ai-status {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.35;
}

.qb-ai-panel {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 0.5px solid #cdbfff;
  border-radius: 7px;
  background: #f2edff;
  color: #5524d7;
}

.qb-ai-panel strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #2f2a33;
  font-size: 0.98rem;
  font-weight: 850;
}

.qb-ai-panel p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.qb-ai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.qb-ai-tags span {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #fff;
  color: #5524d7;
  font-size: 0.7rem;
  font-weight: 850;
}

.qb-compact-textarea {
  min-height: 74px;
}

@media (max-width: 1120px) {
  .qb-form #question-form-layout {
    grid-template-columns: 220px minmax(0, 1fr) 11.5rem;
  }

  .qb-form .qb-metadata {
    position: static;
    grid-column: 1 / 3;
    max-height: none;
  }

  .qb-form .question-form-save-rail {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 820px) {
  .qb-topbar {
    flex-direction: column;
  }

  .qb-form #question-form-layout,
  .qb-subq-grid,
  .qb-mcq-grid,
  .qb-answer-grid--two,
  .qb-answer-grid--three {
    grid-template-columns: 1fr;
  }

  .qb-rail,
  .qb-metadata {
    position: static;
    max-height: none;
  }

  .qb-form .question-form-save-rail {
    position: sticky;
    top: 0.5rem;
    grid-column: 1;
    z-index: 50;
  }
}

.questions-index__layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.questions-index__main {
  flex: 1;
  min-width: min(100%, 520px);
}

.questions-index__sidebar {
  flex: 0 0 280px;
  max-width: 100%;
  align-self: flex-start;
  position: sticky;
  top: 1rem;
}

.questions-index__bulk-sidebar-inner {
  width: 100%;
}

.questions-index__bulk-link {
  font-weight: 600;
  color: var(--st-accent);
  text-decoration: none;
}

.questions-index__bulk-link:hover {
  color: var(--st-accent-strong);
}

.questions-index__bulk-card--danger {
  background: #fef8f8;
  border-color: #fecaca;
}

.students-index__bulk-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  font-size: 0.875rem;
}

.students-index__bulk-input:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.students-index__bulk-input::placeholder {
  color: var(--st-text-tertiary);
}

.students-index__bulk-btn--danger {
  background: #b91c1c;
  color: #fafaf9;
}

.students-index__bulk-btn--danger:hover {
  background: #991b1b;
}

.questions-index__bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
}

.questions-index__bulk-bar-start {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}

.questions-index__bulk-bar-start input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--st-accent);
  cursor: pointer;
}

.questions-index__bulk-select-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--st-text-secondary);
  margin: 0;
  cursor: pointer;
}

.questions-index__bulk-divider {
  color: var(--st-border-secondary);
  font-weight: 300;
}

.questions-index__bulk-summary {
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.questions-index__bulk-summary strong {
  color: var(--st-text-primary);
  font-weight: 700;
}

.questions-index__bulk-summary-sep {
  margin: 0 0.15rem;
  color: var(--st-text-tertiary);
}

.questions-index__bulk-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.questions-index__btn--danger {
  color: #b91c1c !important;
  border-color: #fecaca !important;
}

.questions-index__btn--danger:hover:not(:disabled) {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

.questions-index__table-wrap {
  border-radius: var(--st-radius-lg);
  overflow: hidden;
}

.questions-index__footer {
  margin-top: 1.25rem;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow: hidden;
  background: var(--st-bg-primary);
}

.questions-index__footer--list {
  margin-top: 0;
}

.questions-index__table-wrap--with-footer {
  border-radius: var(--st-radius-lg) var(--st-radius-lg) 0 0;
  border-bottom: none;
}

.questions-index__footer .students-index__pagination-bar {
  margin-top: 0;
  border: none;
  border-radius: 0;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-primary);
}

.questions-index__footer .questions-index__range {
  margin-top: 0;
  border: none;
  border-radius: 0;
  background: var(--st-bg-secondary);
}

.questions-index__footer:not(:has(.questions-index__pagination-bar)) .questions-index__range {
  border-top: none;
}

.questions-index__footer .kaminari-pager,
.questions-index__footer .questions-pagination-nav {
  margin-top: 0 !important;
}

.questions-index__footer .students-index__pagination-bar > div:nth-child(2) {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.questions-index table.data-table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

.questions-index table.data-table thead th.questions-index__th--ref,
.questions-index table.data-table tbody td.students-index__td--ref {
  width: 6.5rem;
}

.questions-index table.data-table thead th.questions-index__th--question,
.questions-index table.data-table tbody td.questions-index__td--question {
  width: 34%;
  min-width: 12rem;
}

.questions-index table.data-table thead th.questions-index__th--type,
.questions-index table.data-table tbody td.questions-index__td--type {
  width: 9.5rem;
}

.questions-index table.data-table thead th.questions-index__th--difficulty,
.questions-index table.data-table tbody td.questions-index__td--difficulty {
  width: 7.5rem;
}

.questions-index table.data-table thead th.questions-index__th--marks,
.questions-index table.data-table tbody td.questions-index__td--marks {
  width: 5.5rem;
  white-space: nowrap;
}

.questions-index__question-title {
  display: block;
  font-weight: 600;
  color: var(--st-text-primary);
  margin-bottom: 0.2rem;
}

.questions-index__question-meta {
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
  line-height: 1.35;
}

.questions-index__meta-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.questions-index__meta-link:hover {
  color: var(--st-accent);
}

.questions-index__question-trigger {
  cursor: pointer;
}

.questions-index__type-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  border: 0.5px solid transparent;
}

.questions-index__type-badge--mc {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.questions-index__type-badge--open {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.questions-index__type-badge--grouped {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.questions-index__type-badge--math {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.questions-index__type-badge--other {
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border-color: var(--st-border-tertiary);
}

.questions-index__difficulty-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border: 0.5px solid var(--st-border-tertiary);
}

.questions-index__td--marks {
  font-weight: 700;
  color: var(--st-text-primary);
}

/* Questions index — warm icon action buttons (list + grid) */
.questions-index table.data-table a.question-icon-link.students-index__action-btn,
.questions-index table.data-table button.students-index__action-btn,
.questions-index .questions-grid-card a.question-icon-link.students-index__action-btn,
.questions-index .questions-grid-card button.students-index__action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.questions-index table.data-table a.question-icon-link.students-index__action-btn:hover,
.questions-index table.data-table button.students-index__action-btn:hover:not(:disabled),
.questions-index .questions-grid-card a.question-icon-link.students-index__action-btn:hover,
.questions-index .questions-grid-card button.students-index__action-btn:hover:not(:disabled) {
  background: #ebe6de;
  color: var(--st-text-primary);
  border-color: var(--st-border-secondary);
}

.questions-index table.data-table a.question-icon-link,
.questions-index .questions-grid-card a.question-icon-link {
  color: var(--st-text-secondary);
}

.questions-index table.data-table button.questions-index__action-btn--delete:hover:not(:disabled),
.questions-index .questions-grid-card button.questions-index__action-btn--delete:hover:not(:disabled) {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.questions-index__tags-filter {
  position: relative;
  display: inline-block;
}

.questions-index__tags-summary {
  list-style: none;
  cursor: pointer;
  min-width: 7.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.questions-index__tags-summary::-webkit-details-marker {
  display: none;
}

.questions-index__tags-panel {
  position: absolute;
  z-index: 20;
  margin-top: 0.35rem;
  width: 220px;
  max-height: 14rem;
  overflow: auto;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.08);
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.questions-index__tags-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
  cursor: pointer;
}

.questions-index__preview {
  position: absolute;
  display: block;
  max-width: min(640px, calc(100vw - 2rem));
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  box-shadow: 0 10px 25px rgba(28, 25, 23, 0.1);
  border-radius: var(--st-radius-lg);
  padding: 1rem;
  z-index: 9999;
  font-size: 0.875rem;
  overflow-x: auto;
  white-space: normal;
  word-break: break-word;
}

.questions-index__preview[hidden] {
  display: none !important;
}

.questions-index__preview mjx-container[display="true"] {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto;
}

.questions-index .questions-index__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.25rem;
  row-gap: 1.75rem;
}

/* Grid column breakpoints: zz_responsive.css stacks layout and refines card chrome */
@media (min-width: 1024px) and (max-width: 1279px) {
  .questions-index .questions-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.questions-index__grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.questions-index__grid-toolbar-start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.questions-index__grid-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.questions-grid-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  border-left-width: 4px;
  border-left-style: solid;
  padding: 1rem 1.1rem 0.9rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.questions-grid-card--mc {
  border-left-color: #3b82f6;
}

.questions-grid-card--open {
  border-left-color: #d97706;
}

.questions-grid-card--grouped {
  border-left-color: #7c3aed;
}

.questions-grid-card--math {
  border-left-color: #16a34a;
}

.questions-grid-card--other {
  border-left-color: var(--st-border-secondary);
}

.questions-grid-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.questions-grid-card__ref {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--st-text-primary);
  letter-spacing: 0.01em;
}

.questions-grid-card__check {
  flex-shrink: 0;
}

.questions-grid-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.questions-grid-card__body {
  flex: 1 1 auto;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--st-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.questions-grid-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.questions-grid-card__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--st-text-secondary);
}

.questions-grid-card__marks {
  font-weight: 600;
  color: var(--st-text-primary);
  white-space: nowrap;
}

.questions-grid-card__date {
  white-space: nowrap;
}

.questions-grid-card__meta-sep {
  opacity: 0.55;
}

.questions-grid-card__author {
  color: var(--st-text-secondary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.questions-grid-card__author:hover {
  color: var(--st-accent);
  text-decoration: underline;
}

.questions-grid-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  line-height: 0;
}

.questions-index__difficulty-badge--easy {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.questions-index__difficulty-badge--medium {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.questions-index__difficulty-badge--hard {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.questions-index__difficulty-badge--olympiad {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.groups-form__layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.groups-form__card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

/* Members card: notice+search padded, table edge-to-edge */
.groups-form__card--members {
  padding: 0;
  overflow: hidden;
}

.groups-form__members-inner {
  padding: 1.25rem 1.5rem 0.75rem;
}

.groups-form__card--members .groups-form__members-wrap {
  border: none;
  border-top: 0.5px solid var(--st-border-tertiary);
  border-radius: 0;
  max-height: 520px;
}

.groups-form__errors {
  background: #fef2f2;
  border: 0.5px solid #fecaca;
  border-radius: var(--st-radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  color: #991b1b;
  font-size: 0.875rem;
}

.groups-form__errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.groups-form__field {
  margin-bottom: 1.35rem;
}

.groups-form__field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--st-text-primary);
  margin-bottom: 0.4rem;
}

.groups-form__input,
.groups-form__select {
  display: block;
  max-width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.8125rem;
  box-sizing: border-box;
}

.groups-form__input {
  width: 100%;
}

.groups-form__select {
  width: min(220px, 100%);
  padding-right: 1.75rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.groups-form__input:focus,
.groups-form__select:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.groups-form__input--invalid {
  border-color: #dc2626;
}

.groups-form__hint {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.groups-form__tag-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.groups-form__tag-btn {
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--st-text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.groups-form__tag-btn:hover {
  background: var(--st-bg-primary);
  border-color: var(--st-border-secondary);
  color: var(--st-accent-strong);
}

.groups-form__notice {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--st-text-secondary);
}

.groups-form__notice-warn {
  display: block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: #b45309;
}

.groups-form__search {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.8125rem;
  box-sizing: border-box;
}

.groups-form__search:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.groups-form__members-wrap {
  width: 100%;
  max-height: 420px;
  overflow: auto;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  background: var(--st-bg-primary);
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.groups-form table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.groups-form table.data-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.groups-form table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.groups-form table.data-table thead th.groups-form__th--check {
  width: 2.75rem;
  text-align: center;
}

.groups-form table.data-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.groups-form table.data-table tbody tr:hover {
  background: var(--st-bg-secondary);
}

.groups-form table.data-table tbody tr.contact-row--no-enrollment {
  background: #fffbeb;
}

.groups-form table.data-table tbody tr.contact-row--no-enrollment:hover {
  background: #fef3c7;
}

.groups-form table.data-table tbody td {
  padding: 11px 12px;
  color: var(--st-text-primary);
  vertical-align: middle;
}

.groups-form table.data-table tbody td.groups-form__td--check {
  text-align: center;
}

.groups-form table.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--st-accent);
  cursor: pointer;
  vertical-align: middle;
}

.groups-form table.data-table .nav-link {
  display: inline;
  padding: 0;
  margin: 0;
  font-weight: 600;
  font-size: inherit;
  color: var(--st-text-primary);
}

.groups-form table.data-table .nav-link:hover {
  color: var(--st-accent);
}

.groups-form__actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.groups-form__delete {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 0.5px solid var(--st-border-tertiary);
  display: flex;
  justify-content: flex-end;
}

.groups-form__btn--danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  border: 0.5px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.groups-form__btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.groups-form .edit-public-id-line {
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--st-text-tertiary);
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ── Contact form (new/edit) ── */
.cf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 1.25rem;
  align-items: start;
  max-width: 100%;
}

.cf-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cf-card {
  background: #fff;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28,25,23,0.04);
}

.cf-card__header {
  background: var(--st-bg-secondary);
  padding: 0.7rem 1.25rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cf-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.cf-card__hint {
  font-size: 0.775rem;
  color: var(--st-text-tertiary);
}

.cf-card__req,
.cf-req {
  color: #dc2626;
}

.cf-card__body {
  padding: 1.25rem 1.5rem;
}

.cf-fields {
  display: grid;
  gap: 1rem;
}

.cf-fields--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cf-field--full {
  grid-column: 1 / -1;
}

.cf-field label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--st-text-secondary);
}

.cf-input {
  display: block;
  width: 100%;
  height: 34px;
  padding: 0 0.7rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: #fff;
  color: var(--st-text-primary);
  font-size: 0.8125rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cf-input:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92,83,70,0.12);
}

textarea.cf-input {
  height: auto;
  padding: 0.55rem 0.7rem;
  resize: vertical;
}

/* Sidebar */
.cf-sidebar .cf-card__body {
  padding: 1.25rem;
}

.cf-sidebar__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Photo upload zone */
.cf-upload-zone {
  position: relative;
  border: 1.5px dashed var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--st-bg-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  overflow: hidden;
}

.cf-upload-zone:hover {
  border-color: var(--st-accent);
  background: #ede9e2;
}

.cf-upload-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.cf-upload-zone__icon  { font-size: 1.35rem; }
.cf-upload-zone__label { font-size: 0.775rem; font-weight: 600; color: var(--st-text-primary); }
.cf-upload-zone__hint  { font-size: 0.7rem; color: var(--st-text-tertiary); }
.cf-upload-zone__preview {
  width: 100%;
  border-radius: var(--st-radius-sm);
  border: 0.5px solid var(--st-border-tertiary);
}

.cf-hint {
  font-size: 0.775rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

.cf-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
}

.cf-errors {
  max-width: 960px;
  background: #fef2f2;
  border: 0.5px solid #fecaca;
  border-radius: var(--st-radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  color: #991b1b;
  font-size: 0.875rem;
}

.cf-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.cf-actions {
  max-width: 960px;
  margin-top: 1.25rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

/* ── Contacts / students import ── */
.contacts-import,
.students-import {
  padding: 1rem 1rem 2.5rem;
  margin-bottom: 0;
  background-color: var(--st-canvas);
  border-radius: var(--st-radius-lg);
}

.contacts-import .students-index__header,
.students-import .students-index__header {
  margin-bottom: 1.5rem;
}

.ci-actions__form {
  margin: 0;
  display: inline-flex;
}

.ci-actions--secondary {
  margin-top: 0.75rem;
}

.ci-table__select {
  width: 100%;
  min-width: 10rem;
  min-height: 2.5rem;
  height: auto;
}

.ci-card {
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28,25,23,0.04);
  margin-bottom: 1.25rem;
}

.ci-card__header {
  background: var(--st-bg-secondary);
  padding: 0.7rem 1.25rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.ci-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--st-text-primary);
}

.ci-card__body {
  padding: 1.25rem 1.5rem;
  min-width: 0;
}

.ci-card__footer {
  padding: 1rem 1.5rem;
  border-top: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
}

/* Paste step */
.ci-paste-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.ci-paste-body .cf-field {
  min-width: 0;
  width: 100%;
}

.ci-role-select {
  width: 220px;
  max-width: 100%;
  box-sizing: border-box;
}

.ci-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ci-textarea:focus {
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92,83,70,0.12);
}

/* Mapping table */
.ci-table-wrap {
  overflow-x: auto;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.ci-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.ci-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.ci-table thead th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--st-text-secondary);
  white-space: nowrap;
  border-right: 0.5px solid var(--st-border-tertiary);
}

.ci-table thead th:last-child { border-right: none; }

.ci-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
  transition: background 0.1s;
}

.ci-table tbody tr:last-child { border-bottom: none; }
.ci-table tbody tr:hover { background: var(--st-bg-secondary); }

.ci-table tbody td {
  padding: 0.6rem 0.75rem;
  color: var(--st-text-primary);
  vertical-align: middle;
  border-right: 0.5px solid var(--st-border-tertiary);
}

.ci-table tbody td:last-child { border-right: none; }

.ci-table__num {
  width: 48px;
  text-align: center;
  font-weight: 600;
  color: var(--st-text-tertiary) !important;
}

.ci-table__skip {
  width: 90px;
  text-align: center;
}

.ci-table__cell {
  min-width: 180px;
  word-break: break-word;
}

/* Actions row */
.ci-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.ci-actions__back { margin-left: auto; }

/* Confirmation summary */
.ci-summary {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.ci-summary__item {
  padding: 0.6rem 1rem;
  border-radius: var(--st-radius-md);
  background: var(--st-bg-secondary);
  border: 0.5px solid var(--st-border-tertiary);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.ci-summary__item--warn  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ci-summary__item--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.ci-flagged-rows {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-secondary);
  font-size: 0.8125rem;
}

.ci-flagged-rows__row + .ci-flagged-rows__row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.ci-flagged-rows__heading {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.ci-flagged-rows__error {
  margin: 0.15rem 0;
  color: #991b1b;
}

.ci-flagged-rows__warning {
  margin: 0.15rem 0;
  color: #92400e;
}

/* Help footer */
.ci-help {
  margin-top: 1rem;
  color: var(--st-text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Groups index: list + grid + tag filters aligned with students/contacts */
.groups-index__tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.groups-index__tag {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  color: var(--st-text-primary);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.groups-index__tag:hover:not(.groups-index__tag--active) {
  background: var(--st-bg-primary);
  border-color: var(--st-border-secondary);
  color: var(--st-accent-strong);
}

.groups-index__tag--active {
  background: var(--st-accent);
  color: #fffaf5;
  border-color: var(--st-accent-strong);
}

.groups-index table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.groups-index table.data-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.groups-index table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.groups-index table.data-table thead th.groups-index__th--narrow {
  width: 2.75rem;
  text-align: center;
}

.groups-index table.data-table thead th.groups-index__th--actions {
  white-space: nowrap;
}

.groups-index table.data-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.groups-index table.data-table tbody tr:hover {
  background: var(--st-bg-secondary);
}

.groups-index table.data-table tbody td {
  padding: 11px 12px;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
  vertical-align: middle;
}

.groups-index table.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--st-accent);
  cursor: pointer;
  vertical-align: middle;
}

.groups-index__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--st-text-secondary);
}

.groups-index__name-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--st-text-primary);
}

.groups-index__name-link:hover {
  color: var(--st-accent);
}

.groups-index__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  line-height: 0;
}

.groups-index table.data-table .group-icon-link.groups-index__icon-btn,
.groups-index .group-card-actions .group-icon-link.groups-index__icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: transparent;
  color: var(--st-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.groups-index table.data-table .group-icon-link.groups-index__icon-btn:hover,
.groups-index .group-card-actions .group-icon-link.groups-index__icon-btn:hover {
  background: var(--st-bg-secondary);
  color: var(--st-accent);
  border-color: var(--st-border-secondary);
}

.groups-index__inline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.groups-index__chip {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.groups-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.groups-index__card {
  position: relative;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: border-color 0.15s;
  height: 100%;
  box-sizing: border-box;
}

.groups-index__card:hover {
  border-color: var(--st-border-secondary);
}

.groups-index__card-bulk-row {
  margin-bottom: 0.75rem;
  width: 100%;
}

.groups-index__card input.group-bulk-cb {
  width: 16px;
  height: 16px;
  accent-color: var(--st-accent);
  cursor: pointer;
}

.groups-index__card-ref {
  margin: 0 0 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
}

.groups-index__card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.groups-index__card-head .icon-group-students {
  flex-shrink: 0;
  margin-top: 0.1rem;
  line-height: 0;
}

.groups-index__card-name {
  margin: 0;
  line-height: 1.3;
  font-size: 1.05rem;
  font-weight: 600;
}

.groups-index__card-name a {
  text-decoration: none;
  color: var(--st-text-primary);
  font-weight: 600;
}

.groups-index__card-name a:hover {
  color: var(--st-accent);
}

.groups-index__card-meta {
  color: var(--st-text-secondary);
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.groups-index__card-meta-sep {
  color: var(--st-text-tertiary);
  margin: 0 0.2rem;
}

.groups-index__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.groups-index__card .group-card-actions {
  margin-top: auto;
  width: 100%;
  justify-content: flex-end;
  padding-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  line-height: 0;
}

/* Contacts index: list + grid aligned with students index (warm palette) */
.contacts-index table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.contacts-index table.data-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contacts-index table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.contacts-index table.data-table thead th.contacts-index__th--narrow {
  width: 2.75rem;
  text-align: center;
}

.contacts-index table.data-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.contacts-index table.data-table tbody tr:hover {
  background: var(--st-bg-secondary);
}

.contacts-index table.data-table tbody td {
  padding: 11px 12px;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
  vertical-align: middle;
}

.contacts-index table.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--st-accent);
  cursor: pointer;
  vertical-align: middle;
}

.contacts-index table.data-table thead th.contacts-index__th--sortable .contacts-index__sort-link {
  text-decoration: none;
  color: var(--st-accent);
  font-weight: 600;
}

.contacts-index table.data-table thead th.contacts-index__th--sortable .contacts-index__sort-link:hover {
  color: var(--st-accent-strong);
}

.contacts-index table.data-table thead th.contacts-index__th--sorted .contacts-index__sort-link {
  color: var(--st-accent-strong);
}

.contacts-index__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--st-text-secondary);
}

.contacts-index__name-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--st-text-primary);
}

.contacts-index__name-link:hover {
  color: var(--st-accent);
}

.contacts-index__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  line-height: 0;
}

.contacts-index table.data-table .contact-icon-link.contacts-index__icon-btn,
.contacts-index .contact-card-actions .contact-icon-link.contacts-index__icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: transparent;
  color: var(--st-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contacts-index table.data-table .contact-icon-link.contacts-index__icon-btn:hover,
.contacts-index .contact-card-actions .contact-icon-link.contacts-index__icon-btn:hover {
  background: var(--st-bg-secondary);
  color: var(--st-accent);
  border-color: var(--st-border-secondary);
}

/* Assessments index (/assessments) */
.assessments-index table.data-table,
.reports-index table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  table-layout: fixed;
}

.assessments-index table.data-table thead tr,
.reports-index table.data-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.assessments-index table.data-table thead th,
.reports-index table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.assessments-index table.data-table tbody tr,
.reports-index table.data-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
  transition: background 0.1s;
}

.assessments-index table.data-table tbody tr:hover,
.reports-index table.data-table tbody tr:hover {
  background: #faf9f7;
}

.assessments-index table.data-table tbody td,
.reports-index table.data-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--st-text-primary);
}

.assessments-index table.data-table input[type="checkbox"],
.reports-index table.data-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--st-accent);
  cursor: pointer;
}

.assessments-index table.data-table thead th.assessments-index__th--sortable .assessments-index__sort-link,
.assessments-index table.data-table thead th.assessments-index__th--sortable .assessments-index__sort-link:hover {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

.assessments-index table.data-table thead th.assessments-index__th--sortable .assessments-index__sort-link:hover {
  color: var(--st-text-primary);
}

.assessments-index table.data-table thead th.assessments-index__th--sorted,
.assessments-index table.data-table thead th.assessments-index__th--sorted .assessments-index__sort-link {
  color: var(--st-accent);
}

.assessments-index__mono,
.reports-index__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--st-text-secondary);
}

.assessments-index__title-link,
.reports-index__name-link {
  font-weight: 600;
  color: var(--st-text-primary);
  text-decoration: none;
}

.assessments-index__title-link:hover,
.reports-index__name-link:hover {
  color: var(--st-accent);
}

.assessments-index__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.assessments-index__tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border: 0.5px solid var(--st-border-secondary);
}

.assessments-index__statuses {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.assessments-index__badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  border: 0.5px solid transparent;
}

.assessments-index__badge--draft {
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  border-color: var(--st-border-secondary);
}

.assessments-index__badge--ready {
  background: #e8f0fa;
  color: #1e4a7a;
  border-color: #c5d9f0;
}

.assessments-index__badge--ended {
  background: #fff4e6;
  color: #9a3412;
  border-color: #fed7aa;
}

.assessments-index__badge--scheduled {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.assessments-index table.data-table tbody .assessments-index__actions,
.reports-index table.data-table tbody .reports-index__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  line-height: 0;
}

/* Assessments list table — flexible columns; scroll only when viewport is narrow on desktop */
.assessments-index table.assessments-index__list-table {
  table-layout: auto;
  width: 100%;
  min-width: min(100%, 52rem);
}

.assessments-index__list-title-link {
  font-weight: 600;
  word-break: break-word;
}

.assessments-index table.data-table thead th.students-index__th--narrow,
.assessments-index table.data-table tbody td.students-index__td--check {
  width: 2.25rem;
  box-sizing: border-box;
}

.assessments-index table.data-table thead th.students-index__th--ref,
.assessments-index table.data-table thead th.assessments-index__th--ref,
.assessments-index table.data-table tbody td.students-index__td--ref {
  width: 3.75rem;
  max-width: 4rem;
  padding-left: 8px;
  padding-right: 6px;
  box-sizing: border-box;
}

.assessments-index table.data-table thead th.assessments-index__th--sortable {
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
  overflow: hidden;
}

.assessments-index table.data-table thead th.assessments-index__th--sortable .assessments-index__sort-link {
  display: inline;
  word-break: break-word;
}

.assessments-index table.data-table thead th.assessments-index__th--title,
.assessments-index table.data-table tbody td.assessments-index__td--title {
  width: 13%;
  min-width: 6.5rem;
}

.assessments-index table.data-table thead th.assessments-index__th--tags,
.assessments-index table.data-table tbody td.assessments-index__td--tags {
  width: 9%;
  min-width: 5rem;
}

.assessments-index table.data-table thead th.assessments-index__th--created,
.assessments-index table.data-table tbody td.assessments-index__td--created,
.assessments-index table.data-table thead th.assessments-index__th--time,
.assessments-index table.data-table tbody td.assessments-index__td--time {
  white-space: nowrap;
}

.assessments-index table.data-table tbody td.assessments-index__td--marks {
  white-space: nowrap;
}

.assessments-index table.data-table thead th.assessments-index__th--created,
.assessments-index table.data-table tbody td.assessments-index__td--created {
  width: 6.25rem;
}

.assessments-index table.data-table thead th.assessments-index__th--author,
.assessments-index table.data-table tbody td.assessments-index__td--author {
  width: 10%;
  min-width: 5.5rem;
}

.assessments-index table.data-table thead th.assessments-index__th--status,
.assessments-index table.data-table tbody td.assessments-index__td--status {
  width: 8%;
  min-width: 6.5rem;
  max-width: 11rem;
}

.assessments-index table.data-table thead th.assessments-index__th--marks,
.assessments-index table.data-table tbody td.assessments-index__td--marks {
  width: 3.75rem;
  max-width: 4rem;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.assessments-index table.data-table thead th.assessments-index__th--time,
.assessments-index table.data-table tbody td.assessments-index__td--time {
  width: 4rem;
}

.assessments-index table.data-table thead th.assessments-index__th--actions,
.assessments-index table.data-table thead th.students-index__th--actions,
.assessments-index table.data-table tbody td.students-index__td--actions {
  width: 12rem;
  min-width: 9rem;
  max-width: 20rem;
  text-align: right;
  white-space: normal;
  overflow: visible;
  vertical-align: middle;
}

.assessments-index table.data-table thead th.assessments-index__th--actions,
.assessments-index table.data-table thead th.students-index__th--actions {
  color: var(--st-text-secondary);
  font-weight: 500;
  vertical-align: middle;
  background: var(--st-bg-secondary);
}

.assessments-index table.data-table tbody td.assessments-index__td--title,
.assessments-index table.data-table tbody td.assessments-index__td--author {
  overflow: hidden;
  text-overflow: ellipsis;
}

.assessments-index table.data-table tbody td.assessments-index__td--tags {
  overflow: hidden;
}

/* Reports index column widths (desktop table only) */
@media (min-width: 1024px) {
  .reports-index .reports-index__list-table {
    min-width: 58rem;
  }
}

.reports-index table.data-table thead th.students-index__th--narrow,
.reports-index table.data-table tbody td.students-index__td--check {
  width: 2.25rem;
  box-sizing: border-box;
}

.reports-index table.data-table thead th.reports-index__th--created,
.reports-index table.data-table tbody td.reports-index__td--created,
.reports-index table.data-table thead th.reports-index__th--emailed,
.reports-index table.data-table tbody td.reports-index__td--emailed {
  width: 6.25rem;
  white-space: nowrap;
}

.reports-index table.data-table thead th.students-index__th--ref,
.reports-index table.data-table tbody td.students-index__td--ref {
  width: 5.25rem;
  max-width: 5.5rem;
}

.reports-index table.data-table thead th.reports-index__th--student,
.reports-index table.data-table tbody td.reports-index__td--student {
  width: 12%;
  min-width: 6rem;
}

.reports-index table.data-table thead th.reports-index__th--assessment,
.reports-index table.data-table tbody td.reports-index__td--assessment {
  width: 16%;
  min-width: 7rem;
}

.reports-index table.data-table thead th.reports-index__th--title,
.reports-index table.data-table tbody td.reports-index__td--title {
  width: 14%;
  min-width: 6rem;
}

.reports-index table.data-table thead th.students-index__th--actions,
.reports-index table.data-table tbody td.students-index__td--actions {
  width: 9.25rem;
  min-width: 9.25rem;
  text-align: right;
  white-space: nowrap;
}

.reports-index table.data-table tbody td.reports-index__td--student,
.reports-index table.data-table tbody td.reports-index__td--assessment,
.reports-index table.data-table tbody td.reports-index__td--title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assessments-index table.data-table a.assessment-icon-link {
  color: var(--st-text-secondary);
}

.assessments-index table.data-table .assessment-icon-link.assessments-index__icon-btn,
.reports-index table.data-table .reports-index__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-primary);
  color: var(--st-text-secondary);
  line-height: 0;
  box-sizing: border-box;
}

.assessments-index table.data-table .assessment-icon-link.assessments-index__icon-btn:hover,
.reports-index table.data-table .reports-index__icon-btn:hover {
  background: var(--st-bg-secondary);
  color: var(--st-accent);
  border-color: var(--st-border-secondary);
}

.assessments-index table.data-table .assessment-icon-link.assessments-index__icon-btn--danger:hover,
.reports-index table.data-table .reports-index__icon-btn--danger:hover {
  color: var(--st-accent);
  background: var(--st-bg-secondary);
  border-color: var(--st-border-secondary);
}

.assessments-index table.data-table .assessment-icon-link.assessments-index__icon-btn--email:hover,
.reports-index table.data-table .reports-index__icon-btn--email:hover {
  color: #0f766e;
  background: #f0fdfa;
  border-color: #99f6e4;
}

.reports-index__empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--st-text-secondary);
  font-size: 0.875rem;
}

.assessments-index__muted,
.reports-index__muted {
  color: var(--st-text-tertiary);
}

.reports-index__icon-btn--disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--st-text-tertiary);
  cursor: not-allowed;
  opacity: 0.55;
}

.students-index__bulk-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.assessments-index__table-wrap--with-footer,
.reports-index__table-wrap--with-footer {
  border-radius: var(--st-radius-lg) var(--st-radius-lg) 0 0;
}

.assessments-index__footer .students-index__pagination-bar,
.reports-index__footer .students-index__pagination-bar {
  border: 0.5px solid var(--st-border-tertiary);
  border-top: none;
  border-radius: 0 0 var(--st-radius-lg) var(--st-radius-lg);
  background: var(--st-bg-primary);
}

/* ── Assessments grid view ── */
.assessments-index__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1024px) {
  .assessments-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .assessments-index__grid {
    grid-template-columns: 1fr;
  }
}

.assessments-grid-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-left-width: 3px;
  border-left-style: solid;
  border-left-color: var(--st-border-secondary);
  border-radius: var(--st-radius-lg);
  padding: 1rem 1.1rem 0.9rem;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.assessments-grid-card:hover {
  box-shadow: 0 3px 10px rgba(28, 25, 23, 0.08);
}

/* Status-coloured left border */
.assessments-grid-card--draft    { border-left-color: var(--st-border-secondary); }
.assessments-grid-card--ready    { border-left-color: #0e7490; }
.assessments-grid-card--active   { border-left-color: #16a34a; }
.assessments-grid-card--completed{ border-left-color: #16a34a; }
.assessments-grid-card--closed   { border-left-color: #dc2626; }
.assessments-grid-card--ended    { border-left-color: #ea580c; }

.assessments-grid-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.assessments-grid-card__ref {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--st-text-tertiary);
  letter-spacing: 0.05em;
  font-family: ui-monospace, monospace;
  text-transform: uppercase;
}

.assessments-grid-card__check {
  cursor: pointer;
  flex-shrink: 0;
}

.assessments-grid-card__icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.assessments-grid-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Status-coloured icon backgrounds */
.assessments-grid-card__icon--draft     { background: var(--st-bg-tertiary);  color: var(--st-text-secondary); }
.assessments-grid-card__icon--ready     { background: #dbeafe; color: #1d4ed8; }
.assessments-grid-card__icon--active    { background: #dcfce7; color: #15803d; }
.assessments-grid-card__icon--completed { background: #dcfce7; color: #15803d; }
.assessments-grid-card__icon--closed    { background: #fee2e2; color: #b91c1c; }
.assessments-grid-card__icon--ended     { background: #ffedd5; color: #c2410c; }

.assessments-grid-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.assessments-grid-card__title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.65rem;
}

.assessments-grid-card__title-link {
  display: inline;
  color: var(--st-text-primary);
  text-decoration: none;
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
  line-height: inherit;
}

.assessments-grid-card__title-link:hover {
  color: var(--st-accent);
  text-decoration: underline;
}

.assessments-grid-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.assessments-grid-card__tag--more {
  background: var(--st-bg-tertiary);
  color: var(--st-text-secondary);
}

.assessments-grid-card__footer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 0.5px solid var(--st-border-tertiary);
}

.assessments-grid-card__meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.assessments-grid-card__meta-item {
  font-size: 0.72rem;
  color: var(--st-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.22rem;
}

.assessments-grid-card__meta-sep {
  color: var(--st-border-secondary);
  font-size: 0.72rem;
  opacity: 0.6;
}

.assessments-grid-card__actions {
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 0;
}

/* Icon buttons inside the grid cards */
.assessments-index__grid .assessment-icon-link.assessments-index__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-secondary);
  color: var(--st-text-secondary);
  line-height: 0;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.assessments-index__grid .assessment-icon-link.assessments-index__icon-btn:hover {
  background: #ebe6de;
  color: var(--st-text-primary);
  border-color: var(--st-border-secondary);
}

.assessments-index__grid .assessment-icon-link.assessments-index__icon-btn--danger:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.contacts-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.contacts-index__card {
  position: relative;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color 0.15s;
  height: 100%;
  box-sizing: border-box;
}

.contacts-index__card:hover {
  border-color: var(--st-border-secondary);
}

.contacts-index__card-avatar-wrap {
  margin-bottom: 1rem;
}

.contacts-index__card-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--st-border-tertiary);
}

.contacts-index__card-photo-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--st-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 2.25rem;
  color: var(--st-text-tertiary);
}

.contacts-index__card-ref {
  margin: 0 0 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--st-text-tertiary);
}

.contacts-index__card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.contacts-index__card-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.contacts-index__card-name a {
  text-decoration: none;
  color: var(--st-text-primary);
  font-weight: 600;
}

.contacts-index__card-name a:hover {
  color: var(--st-accent);
}

.contacts-index__card-meta {
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  width: 100%;
  margin-bottom: 0.5rem;
}

.contacts-index__card-meta strong {
  color: var(--st-text-primary);
}

.contacts-index__card-portal-row {
  margin: 0.75rem 0;
}

.contacts-index__card-bulk-row {
  margin-bottom: 0.75rem;
  width: 100%;
}

.contacts-index__card input.contact-bulk-cb {
  width: 16px;
  height: 16px;
  accent-color: var(--st-accent);
  cursor: pointer;
}

.contacts-index__card .contact-card-actions {
  margin-top: auto;
  width: 100%;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

.students-index__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.students-index__title {
  margin: 0 0 0.35rem;
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--st-text-primary);
  letter-spacing: -0.02em;
}

.students-index__lead {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--st-text-secondary);
  max-width: 36rem;
}

.students-index__btn-row {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.students-index__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 36px;
  padding: 0 1rem;
  border-radius: var(--st-radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 0.5px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
}

.students-index__btn--primary {
  background: var(--st-accent);
  color: #fff;
  border-color: var(--st-accent-strong);
}

.students-index__btn--primary:hover {
  background: var(--st-accent-hover);
  color: #fff;
}

.students-index__btn--outline {
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  border-color: var(--st-border-secondary);
}

.students-index__btn--outline:hover {
  border-color: var(--st-text-tertiary);
  background: var(--st-bg-secondary);
}

.students-index__toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.students-index__filters-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

.students-index__search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.students-index__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--st-text-tertiary);
  pointer-events: none;
}

.students-index__search-input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem 0 2rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.8125rem;
  box-sizing: border-box;
}

.students-index__search-input:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px rgba(92, 83, 70, 0.12);
}

.students-index__select {
  height: 36px;
  padding: 0 1.75rem 0 0.65rem;
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

/* Per-page control: extra width for digits + custom chevron padding */
.students-index__pagination-bar .pagination-per-page-select.students-index__select,
.figures-index__footer .pagination-per-page-select.students-index__select {
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 4.75rem;
  height: 36px;
  padding: 0 1.75rem 0 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-align: left;
  box-sizing: border-box;
}

.figures-index__footer .pagination-per-page-label {
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.figures-index__footer-per {
  padding: 0.85rem 1.1rem;
}

.students-index__view-toggle {
  display: flex;
  background: var(--st-bg-secondary);
  border-radius: var(--st-radius-md);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.students-index__view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--st-text-secondary);
  border: none;
  background: none;
  white-space: nowrap;
}

.students-index__view-btn:hover {
  color: var(--st-text-primary);
}

.students-index__view-btn--active {
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  border: 0.5px solid var(--st-border-tertiary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.students-index__view-icon {
  flex-shrink: 0;
}

.students-index__alpha-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 1rem;
  align-items: center;
}

.students-index__alpha-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--st-text-secondary);
  border: none;
  background: none;
  box-sizing: border-box;
}

.students-index__alpha-btn:hover:not(.students-index__alpha-btn--dim):not(.students-index__alpha-btn--active) {
  background: var(--st-bg-secondary);
  color: var(--st-text-primary);
}

.students-index__alpha-btn--active {
  background: var(--st-accent);
  color: #fff;
}

.students-index__alpha-btn--dim {
  color: #c4bfb6;
  cursor: default;
  pointer-events: none;
}

.students-index__select-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: var(--st-bg-secondary);
  border-radius: var(--st-radius-md);
  margin-bottom: 1rem;
  border: 0.5px solid var(--st-border-tertiary);
}

.students-index__select-bar label {
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin: 0;
}

.students-index__select-bar input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--st-accent);
  cursor: pointer;
}

.students-index__table-wrap,
.contacts-index__table-wrap,
.groups-index__table-wrap,
.questions-index__table-wrap,
.assessments-index__table-wrap,
.reports-index__table-wrap {
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--st-bg-primary);
}

.students-index table.data-table,
.questions-index table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  table-layout: fixed;
}

.students-index table.data-table thead tr {
  background: var(--st-bg-secondary);
  border-bottom: 0.5px solid var(--st-border-tertiary);
}

.students-index table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--st-text-secondary);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* Column widths: keep content in its lane (ellipsis where needed) */
.students-index table.data-table thead th.students-index__th--ref,
.students-index table.data-table tbody td.students-index__td--ref {
  width: 5.75rem;
  max-width: 6.25rem;
  box-sizing: border-box;
}

.students-index table.data-table thead th.students-index__th--name,
.students-index table.data-table tbody td.students-index__td--name {
  width: 11%;
  min-width: 6.5rem;
}

.students-index table.data-table thead th.students-index__th--email,
.students-index table.data-table tbody td.students-index__td--email {
  width: 24%;
  min-width: 10.5rem;
}

.students-index table.data-table thead th.students-index__th--phone,
.students-index table.data-table tbody td.students-index__td--phone {
  width: 9.5rem;
  min-width: 9rem;
}

.students-index table.data-table thead th.students-index__th--class,
.students-index table.data-table tbody td.students-index__td--class {
  width: 7rem;
  min-width: 5.75rem;
}

.students-index table.data-table thead th.students-index__th--status,
.students-index table.data-table tbody td.students-index__td--status {
  width: 7.25rem;
  min-width: 7rem;
}

.students-index table.data-table thead th.students-index__th--portal,
.students-index table.data-table tbody td.students-index__td--portal {
  width: 9.5rem;
  min-width: 8.75rem;
}

.students-index table.data-table tbody td.students-index__td--status,
.students-index table.data-table tbody td.students-index__td--portal {
  white-space: nowrap;
}

.students-index table.data-table thead th.students-index__th--narrow {
  width: 2.25rem;
  text-align: center;
}

.students-index table.data-table thead th.students-index__th--actions,
.students-index table.data-table tbody td.students-index__td--actions {
  text-align: right;
  width: 6rem;
  min-width: 5.75rem;
}

.students-index table.data-table thead th.students-index__th--sortable .students-index__sort-link {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

.students-index table.data-table thead th.students-index__th--sortable .students-index__sort-link:hover {
  color: var(--st-text-primary);
}

.students-index table.data-table thead th.students-index__th--sorted,
.students-index table.data-table thead th.students-index__th--sorted .students-index__sort-link {
  color: var(--st-accent);
}

.students-index table.data-table tbody tr {
  border-bottom: 0.5px solid var(--st-border-tertiary);
  transition: background 0.1s;
}

.students-index table.data-table tbody tr:last-child {
  border-bottom: none;
}

.students-index table.data-table tbody tr:hover {
  background: var(--st-bg-secondary);
}

.students-index table.data-table tbody td {
  padding: 11px 12px;
  font-size: 0.8125rem;
  color: var(--st-text-primary);
  vertical-align: middle;
}

.students-index table.data-table tbody td.students-index__td--check {
  text-align: center;
}

.students-index table.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--st-accent);
  cursor: pointer;
  vertical-align: middle;
}

.students-index__ref {
  display: block;
  max-width: 100%;
  font-size: 0.6875rem;
  color: var(--st-text-tertiary);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.students-index table.data-table .nav-link.students-index__name-link {
  display: inline;
  padding: 0;
  margin: 0;
  font-weight: 500;
  font-size: 0.8125rem;
}

.students-index__name-link {
  font-weight: 500;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--st-text-primary);
}

.students-index__name-link:hover {
  color: var(--st-accent);
}

.students-index__email {
  display: block;
  max-width: 100%;
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.students-index__phone {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.students-index__class-cell {
  font-size: 0.8125rem;
  color: var(--st-text-secondary);
}

.students-index__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 500;
  vertical-align: middle;
}

.students-index__badge--active {
  background: var(--st-badge-active-bg);
  color: var(--st-badge-active-fg);
}

.students-index__badge--inactive {
  background: #fee2e2;
  color: #991b1b;
}

.students-index__badge--portal-no {
  background: var(--st-bg-secondary);
  color: var(--st-text-tertiary);
  border: 0.5px solid var(--st-border-tertiary);
}

.students-index__badge--portal-yes {
  background: #e8e2da;
  color: var(--st-accent-strong);
}

.students-index__badge--warn {
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
}

.students-index__actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
  line-height: 0;
}

.students-index table.data-table .student-icon-link.students-index__action-btn,
.students-index .student-card-actions .student-icon-link.students-index__action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-tertiary);
  background: transparent;
  color: var(--st-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.students-index table.data-table .student-icon-link.students-index__action-btn:hover,
.students-index .student-card-actions .student-icon-link.students-index__action-btn:hover {
  background: var(--st-bg-secondary);
  color: var(--st-accent);
  border-color: var(--st-border-secondary);
}

/* Neutralise global data-table blue for student row icons on this page */
.students-index table.data-table a.student-icon-link,
.students-index .student-card-actions a.student-icon-link {
  color: var(--st-text-secondary);
}

.students-index__sort-icon {
  font-size: 0.625rem;
  margin-left: 3px;
  opacity: 0.75;
}

.students-index__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1100px) {
  .students-index__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .students-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .students-index__grid {
    grid-template-columns: 1fr;
  }
}

.students-index__student-card {
  position: relative;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  padding: 1.25rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color 0.15s;
}

.students-index__student-card:hover {
  border-color: var(--st-border-secondary);
}

.students-index__card-check {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 16px;
  height: 16px;
  accent-color: var(--st-accent);
  cursor: pointer;
}

.students-index__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ebe4d8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  flex-shrink: 0;
  color: var(--st-accent-soft);
}

.students-index__avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.students-index__card-ref {
  margin: 0 0 0.25rem;
  font-size: 0.625rem;
  color: var(--st-text-tertiary);
  letter-spacing: 0.04em;
  text-align: center;
}

.students-index__card-name {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--st-text-primary);
  text-align: center;
}

.students-index__card-name a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

.students-index__card-name a:hover {
  color: var(--st-accent);
}

.students-index__card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.students-index__card-meta {
  width: 100%;
  border-top: 0.5px solid var(--st-border-tertiary);
  padding-top: 0.65rem;
  margin-top: 0.15rem;
}

.students-index__meta-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.students-index__meta-row:last-child {
  margin-bottom: 0;
}

.students-index__meta-label {
  font-size: 0.6875rem;
  color: var(--st-text-tertiary);
  white-space: nowrap;
  padding-top: 1px;
}

.students-index__meta-val {
  font-size: 0.6875rem;
  color: var(--st-text-secondary);
  word-break: break-word;
}

.students-index .student-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 0.75rem;
  width: 100%;
  justify-content: flex-end;
}

.students-index__bulk-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.students-index__bulk-main {
  flex: 1;
  min-width: min(100%, 520px);
}

.students-index__bulk-sidebar {
  flex: 0 0 280px;
  max-width: 100%;
  align-self: flex-start;
  position: sticky;
  top: 1rem;
}

.students-index__bulk-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.students-index__bulk-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--st-radius-lg);
  border: 0.5px solid var(--st-border-tertiary);
  background: var(--st-bg-primary);
}

.students-index__bulk-card--gap-lg {
  gap: 1rem;
}

.students-index__bulk-card--status {
  background: #f4faf0;
  border-color: #c9dcb8;
}

.students-index__bulk-card--muted {
  background: var(--st-bg-secondary);
  border-color: var(--st-border-secondary);
}

.students-index__bulk-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--st-text-primary);
}

.students-index__bulk-card-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--st-text-secondary);
}

.students-index__bulk-card-hint--sm {
  font-size: 0.85rem;
}

.students-index__bulk-card-hint--xs {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--st-text-tertiary);
}

.students-index__bulk-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  color: var(--st-text-secondary);
}

.students-index__bulk-field-label--inline {
  margin-bottom: 0;
}

.students-index__bulk-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: var(--st-radius-md);
  border: 0.5px solid var(--st-border-secondary);
  background: var(--st-bg-primary);
  color: var(--st-text-primary);
  font-family: var(--font-app, "Inter", system-ui, sans-serif);
  font-size: 0.875rem;
}

.students-index__bulk-select--flex {
  flex: 1;
  min-width: 0;
}

.students-index__bulk-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.students-index__bulk-btn {
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  border: none;
  box-sizing: border-box;
}

.students-index__bulk-btn--active {
  background: #3b6d11;
  color: #fafaf9;
}

.students-index__bulk-btn--active:hover {
  background: #32600e;
}

.students-index__bulk-btn--inactive {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.students-index__bulk-btn--inactive:hover {
  background: #fee2e2;
}

.students-index__bulk-btn--primary {
  background: var(--st-accent);
  color: #fafaf9;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
}

.students-index__bulk-btn--primary:hover {
  background: var(--st-accent-strong);
}

.students-index__bulk-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.students-index__bulk-btn--add {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  background: var(--st-bg-secondary);
  color: var(--st-text-primary);
  border: 0.5px solid var(--st-border-secondary);
  border-radius: var(--st-radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
}

.students-index__bulk-btn--add:hover {
  background: #ebe4d8;
}

.students-index__bulk-group-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.students-index__bulk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 0.25rem;
}

.students-index__bulk-card .nav-link {
  color: var(--st-accent);
}

.students-index__bulk-card .nav-link:hover {
  color: var(--st-accent-strong);
}

.students-index__bulk-group-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.students-index__pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--st-bg-primary);
  border: 0.5px solid var(--st-border-tertiary);
  border-top: none;
  border-radius: 0 0 var(--st-radius-lg) var(--st-radius-lg);
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.students-index__range {
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border: 0.5px solid var(--st-border-tertiary);
  border-radius: var(--st-radius-lg);
  background: var(--st-bg-secondary);
  text-align: center;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.students-index__range--tight-top {
  margin-top: 0;
}

.account-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Container overrides when auth-card is used as account-card */
.account-card.auth-card {
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

.account-card .account-card__header {
  padding: 1.1rem 1.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Override auth-card h2 centering inside account-card */
.account-card .account-card__header h2 {
  font-size: 0.975rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0;
  text-align: left;
}

.account-card .account-card__header p {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.account-card__header-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.account-card__header-icon--blue  { background: #eff6ff; }
.account-card__header-icon--slate { background: #f1f5f9; }

.account-card .account-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.account-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.account-field-full {
  grid-column: 1 / -1;
}

/* Right-aligned actions row per card */
.account-card .account-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}

.account-card .account-card__actions input[type="submit"] {
  width: auto;
  margin-top: 0;
  height: 36px;
  padding: 0 1rem;
  border-radius: var(--st-radius-md);
  font-size: 0.8125rem;
  background: var(--st-accent);
  color: #fff;
  border: 0.5px solid var(--st-accent-strong);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.account-card .account-card__actions input[type="submit"]:hover {
  background: var(--st-accent-hover);
}

/* Photo card */
.account-photo-card .account-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.account-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #94a3b8;
  flex-shrink: 0;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.account-avatar-email {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.upload-zone {
  width: 100%;
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fafbfc;
  position: relative;
}

.upload-zone:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 0;
}

.upload-zone__icon {
  font-size: 1.35rem;
  color: #94a3b8;
  pointer-events: none;
}

.upload-zone__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  pointer-events: none;
}

.upload-zone__hint {
  font-size: 0.72rem;
  color: #94a3b8;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   ACCOUNT PAGE  (ac-*)
   ═══════════════════════════════════════════════════════ */

.ac-page {
  /* no max-width — use full page width */
}

/* ── Page header ── */
.ac-page__header {
  margin-bottom: 1.75rem;
}

.ac-page__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ac-page__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.ac-page__subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

/* ── Error banner ── */
.ac-error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: #b91c1c;
}

.ac-error-banner ul {
  margin: 0;
  padding-left: 1.2rem;
}

.ac-error-banner li {
  margin: 0.15rem 0;
}

/* ── Three-column layout ── */
.ac-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Dissolve the wrapper divs so the 3 cards sit directly in the grid */
.ac-left,
.ac-right {
  display: contents;
}

.ac-left > form {
  display: contents;
}

@media (max-width: 900px) {
  .ac-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .ac-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Cards ── */
.ac-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0; /* prevent grid blowout */
}

.ac-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #faf8f5;
}

.ac-card__icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.ac-card__icon--person {
  background: #e6f4ed;
  color: #2d6a4f;
}

.ac-card__icon--lock {
  background: #fff3e0;
  color: #b45309;
}

.ac-card__icon--photo {
  background: #ede9fe;
  color: #6d28d9;
}

.ac-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
}

.ac-card__subtitle {
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.1rem;
  line-height: 1.35;
}

.ac-card__body {
  padding: 1rem;
}

.ac-card__actions {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

/* ── Shared field label style ── */
.ac-card .field label,
.ac-card .field > label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #666;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Shared input / select style ── */
.ac-card input[type="text"],
.ac-card input[type="email"],
.ac-card input[type="tel"],
.ac-card input[type="password"],
.ac-card select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 7px;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.ac-card input:focus,
.ac-card select:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.ac-hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.35rem;
}

/* ── Fields grid ── */
.ac-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ── Password fields (outside ac-fields-grid) ── */
.ac-card__body > .field,
.ac-card__body .field--password-toggle {
  margin-bottom: 0.85rem;
}

.ac-card__body > .field:last-of-type,
.ac-card__body .field--password-toggle:last-of-type {
  margin-bottom: 0;
}

/* Password wrap: input + toggle button side by side */
.field__password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field__password-wrap input[type="password"],
.field__password-wrap input[type="text"] {
  flex: 1;
  padding-right: 2.5rem !important;
}

/* Password requirements hint — warm palette */
.password-requirements-hint {
  font-size: 0.78rem !important;
  color: #888 !important;
  margin: 0 0 0.85rem !important;
  line-height: 1.45 !important;
}

/* ── Buttons ── */
.ac-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.ac-btn--primary {
  background: #2d6a4f;
  color: #fff;
  border-color: #2d6a4f;
}

.ac-btn--primary:hover {
  background: #1f4d38;
  border-color: #1f4d38;
  color: #fff;
}

.ac-btn--block {
  width: 100%;
  margin-top: 0.65rem;
}

.ac-btn--remove {
  background: none;
  color: #b91c1c;
  border-color: #fca5a5;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  width: 100%;
  justify-content: center;
  margin-top: 0.4rem;
}

.ac-btn--remove:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* ── Photo card ── */
.ac-photo-card {
  min-width: 0;
}

.ac-photo-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.ac-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  overflow: hidden;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.ac-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ac-avatar-info {
  margin-bottom: 1rem;
}

.ac-avatar-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
}

.ac-avatar-email {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.15rem;
  word-break: break-all;
}

.ac-avatar {
  align-self: center;
}

.ac-avatar-info {
  align-self: center;
}

/* ── Upload zone ── */
.ac-upload-zone {
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #faf8f5;
  position: relative;
}

.ac-upload-zone:hover {
  border-color: #2d6a4f;
  background: #e6f4ed;
}

.ac-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 0;
}

.ac-upload-zone__icon {
  color: #aaa;
  pointer-events: none;
}

.ac-upload-zone__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #444;
  pointer-events: none;
}

.ac-upload-zone__hint {
  font-size: 0.72rem;
  color: #aaa;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   BILLING SUB-PAGES  (bl-*)
   credit_usage + email_logs
   ═══════════════════════════════════════════════════════ */

.bl-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Page header ── */
.bl-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bl-page__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.bl-page__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bl-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.bl-page__subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

.bl-page__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Buttons ── */
.bl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #fff;
  color: #444;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.bl-btn--ghost:hover {
  background: #f5f0eb;
  border-color: #ccc5b8;
}

/* ── Section label ── */
.bl-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.5rem;
}

.bl-section-label--spaced {
  margin-top: 2rem;
}

.bl-intro {
  font-size: 0.85rem;
  color: #888;
  margin: -0.5rem 0 0.75rem;
}

/* ── Card ── */
.bl-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Table ── */
.bl-table-wrap {
  overflow-x: auto;
}

.bl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 520px;
}

.bl-table__th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  background: #faf8f5;
  border-bottom: 1px solid var(--st-border-tertiary, #e8e2d9);
  white-space: nowrap;
}

.bl-table__th--right {
  text-align: right;
}

.bl-table__row {
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.bl-table__row:first-child {
  border-top: none;
}

.bl-table__td {
  padding: 0.75rem 1rem;
  vertical-align: top;
  color: #1a1a1a;
  line-height: 1.4;
}

.bl-table__td--nowrap {
  white-space: nowrap;
}

.bl-table__td--right {
  text-align: right;
}

.bl-table__td--mono {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.bl-table__td--muted {
  color: #666;
}

.bl-table__td--break {
  word-break: break-all;
}

.bl-table__td--subject {
  max-width: 16rem;
}

/* ── Status badges ── */
.bl-status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.bl-status--delivered {
  background: #dcfce7;
  color: #166534;
}

.bl-status--failed {
  background: #fee2e2;
  color: #991b1b;
}

.bl-status--pending,
.bl-status--sending {
  background: #fef9c3;
  color: #854d0e;
}

.bl-status-detail {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  line-height: 1.35;
}

.bl-status-detail--opened {
  color: #2d6a4f;
}

.bl-status-detail--error {
  color: #b91c1c;
}

/* ── Misc ── */
.bl-empty {
  padding: 1.5rem 1.25rem;
  margin: 0;
  color: #888;
  font-size: 0.9rem;
}

.bl-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1rem 1rem;
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.bl-pagination > div:has(.kaminari-pager) {
  flex: 1 1 12rem;
  display: flex;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.bl-pagination > div:empty {
  display: none;
}

.bl-pagination > .kaminari-pager {
  flex: 1 1 12rem;
  justify-content: center;
  min-width: 0;
}

.bl-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #92400e;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════
   SUPPORT REQUESTS  (sr-*)
   ═══════════════════════════════════════════════════════ */

/* ── Page shell ── */
.sr-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sr-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sr-page__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sr-page__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e6f4ed;
  color: #2d6a4f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sr-page__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.1rem;
  line-height: 1.25;
}

.sr-page__subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

.sr-page__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Support access card (index) ── */
.sr-access-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.sr-access-card__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2d6a4f;
  text-decoration: none;
  display: block;
  margin-bottom: 0.2rem;
}

.sr-access-card__link:hover {
  text-decoration: underline;
}

.sr-access-card__desc {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

/* ── Filters ── */
.sr-filters {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.sr-filters__select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 7px;
  font-size: 0.85rem;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.sr-filters__select:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12);
}

/* ── Sort link ── */
.sr-sort-link {
  text-decoration: none;
  color: #2d6a4f;
  font-weight: 700;
}

.sr-sort-link:hover {
  text-decoration: underline;
}

/* ── Status badges ── */
.sr-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.sr-status--open {
  background: #dcfce7;
  color: #166534;
}

.sr-status--closed {
  background: #f1f5f9;
  color: #64748b;
}

.sr-status--in_progress,
.sr-status--in-progress {
  background: #fef3c7;
  color: #92400e;
}

/* ── Actions column ── */
.sr-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Section label ── */
.sr-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
}

/* ── Meta card (show page) ── */
.sr-meta-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: #faf8f5;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.sr-meta-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.3rem;
}

.sr-meta-card__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* ── Body card (show page) ── */
.sr-body-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.25rem;
}

.sr-body-card__pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #1a1a1a;
}

/* ── Attachments ── */
.sr-attachments {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.sr-attachments__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 0.5rem;
}

.sr-attachments__list {
  margin: 0;
  padding-left: 1.1rem;
}

.sr-attachments__link {
  color: #2d6a4f;
  font-size: 0.875rem;
  text-decoration: none;
}

.sr-attachments__link:hover {
  text-decoration: underline;
}

/* ── Thread ── */
.sr-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sr-thread__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sr-thread__empty {
  color: #888;
  font-size: 0.875rem;
  margin: 0;
}

/* ── Comment bubbles ── */
.sr-comment {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  background: #faf8f5;
}

.sr-comment--support {
  background: #f0faf5;
  border-color: #b7dfc6;
}

.sr-comment__meta {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 0.35rem;
}

.sr-comment__body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1a1a1a;
  white-space: pre-wrap;
}

/* ── Reply card ── */
.sr-reply-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 10px;
  padding: 1.25rem;
}

.sr-reply-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
}

.sr-reply-card__error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.sr-reply-card__field {
  margin-bottom: 0.75rem;
}

.sr-reply-card__field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.35rem;
}

.sr-reply-card__textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  min-height: 6rem;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sr-reply-card__textarea:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12);
}

/* ── Edit card ── */
.sr-edit-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 820px;
}

.sr-edit-card__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sr-edit-card__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .sr-edit-card__row { grid-template-columns: 1fr; }
}

.sr-edit-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
}

.sr-edit-card__input,
.sr-edit-card__select,
.sr-edit-card__textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 7px;
  font: inherit;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sr-edit-card__input:focus,
.sr-edit-card__select:focus,
.sr-edit-card__textarea:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.12);
}

.sr-edit-card__textarea {
  resize: vertical;
  line-height: 1.6;
}

.sr-edit-card__notice {
  font-size: 0.82rem;
  color: #888;
  background: #faf8f5;
  border-radius: 7px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.sr-edit-card__section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-top: 0.25rem;
}

.sr-edit-card__no-attachments {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

.sr-edit-card__actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding-top: 0.25rem;
}

/* ── Danger zone ── */
.sr-danger-zone {
  padding-top: 1rem;
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
  max-width: 820px;
}

.sr-danger-zone__btn {
  padding: 0.45rem 1rem;
  border-radius: 7px;
  border: 1px solid #fca5a5;
  background: #fff;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.sr-danger-zone__btn:hover {
  background: #fef2f2;
}

/* =============================
   Confirm Delete Organisation (cd-*)
   ============================= */
.cd-page {
  max-width: 580px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

.cd-back {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.cd-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #fecaca;
  box-shadow: 0 2px 12px rgba(185,28,28,0.06);
  overflow: hidden;
}

.cd-card__header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
}

.cd-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cd-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 0.15rem;
  line-height: 1.3;
}

.cd-card__org-name {
  font-size: 0.82rem;
  color: #b91c1c;
  margin: 0;
  opacity: 0.75;
}

.cd-card__body {
  padding: 1.5rem;
}

.cd-intro {
  font-size: 0.92rem;
  color: #374151;
  margin: 0 0 1rem;
  line-height: 1.6;
}

.cd-list {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: #374151;
}

.cd-list li {
  margin-bottom: 0.35rem;
}

.cd-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #b91c1c;
  margin-bottom: 1.5rem;
}

.cd-callout svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.cd-confirm {
  border-top: 1px solid #f3e8e8;
  padding-top: 1.25rem;
}

.cd-confirm__label {
  font-size: 0.9rem;
  color: #374151;
  margin: 0 0 0.75rem;
}

.cd-field {
  margin-bottom: 1rem;
}

/* Password field inside confirm-delete form */
.cd-confirm .field {
  margin-bottom: 1rem;
}

.cd-confirm .field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.4rem;
}

.cd-confirm .field--password-toggle .field__password-wrap input[type="password"],
.cd-confirm .field--password-toggle .field__password-wrap input[type="text"] {
  padding: 0.55rem 2.85rem 0.55rem 0.75rem;
  border-radius: 7px;
  border: 1px solid #d1d5db;
  font-size: 0.92rem;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s;
}

.cd-confirm .field--password-toggle .field__password-wrap input:focus {
  outline: none;
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}

.cd-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 7px;
  border: 1px solid #d1d5db;
  font-size: 0.92rem;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.cd-input:focus {
  outline: none;
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}

.cd-actions {
  margin-top: 1.25rem;
}

.cd-delete-btn {
  width: 100%;
  padding: 0.65rem 1.25rem;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}

.cd-delete-btn:hover {
  background: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════
   From-PDF extraction page (fp-*)
   ═══════════════════════════════════════════════════════════ */

.fp-page {
  max-width: min(1680px, calc(100vw - 2rem));
  margin: 0 auto;
  padding-bottom: 3rem;
}

/* Container that holds all extracted question groups */
.fp-groups {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header */
.fp-header {
  margin-bottom: 2rem;
}

.fp-header__back {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.fp-header__title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--st-text-primary);
  margin: 0 0 0.5rem;
}

.fp-header__lead {
  font-size: 0.9rem;
  color: var(--st-text-secondary);
  margin: 0 0 0.4rem;
  line-height: 1.6;
}

/* Cards */
.fp-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.fp-card--error {
  border-color: #fecaca;
  background: #fff5f5;
}

.fp-card--teacher {
  background: #f8fafc;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  font-size: 0.875rem;
}

/* Cards inside the group grid have no bottom margin — grid gap handles spacing */
.fp-group__grid .fp-card {
  margin-bottom: 0;
}

.fp-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--st-text-primary);
  margin: 0 0 0.5rem;
}

.fp-card__subtitle {
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  margin: 0 0 1rem;
  line-height: 1.55;
}

/* Form fields */
.fp-field {
  margin-bottom: 1rem;
}

.fp-field label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--st-text-primary);
}

.fp-file-input {
  display: block;
  width: 100%;
  max-width: 28rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--st-border-secondary, #d1ccc4);
  border-radius: 8px;
  font-size: 0.875rem;
}

.fp-field__hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--st-text-secondary);
  line-height: 1.5;
}

.fp-checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: 36rem;
  margin-bottom: 1rem;
}

.fp-checkbox-field input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.3rem 0 0;
  cursor: pointer;
  accent-color: var(--st-accent);
}

.fp-checkbox-field label {
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  line-height: 1.45;
}

.fp-dev-banner {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #b45309;
  line-height: 1.45;
}

/* Error */
.fp-error__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #b91c1c;
}

.fp-error__text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.fp-error__actions {
  margin: 1rem 0 0;
}

/* Wizard finish */
.fp-wizard-finish {
  margin-bottom: 0.75rem;
}

.fp-wizard-finish__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--st-text-secondary);
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* Dev debug */
.fp-dev-card {
  background: #fff;
  border: 1px solid var(--st-border-tertiary, #e8e2d9);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.fp-dev-card summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--st-text-secondary);
}

.fp-dev-section {
  margin-top: 1rem;
}

.fp-dev-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.fp-dev-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.82rem;
}

/* Question group */
.fp-group {
  margin-bottom: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.fp-groups .fp-group:first-child {
  padding-top: 0;
  border-top: none;
}

/* Header row: number badge + rule */
.fp-group__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fp-group__number {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--st-text-tertiary, #999);
  white-space: nowrap;
}

/* Two-column grid: student (wider) | teacher (narrower) */
.fp-group__grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .fp-group__grid {
    grid-template-columns: 1fr;
  }
}

/* Student card: white, normal border */
.fp-card--student {
  background: #fff;
}

/* Teacher label inside teacher card */
.fp-teacher-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--st-text-tertiary, #999);
  margin: 0 0 0.85rem;
}

.fp-sub-divider {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.fp-sub-heading {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
}

.fp-marks-right {
  text-align: right;
  font-size: 0.875rem;
  color: #475569;
  margin-top: 1rem;
}

.fp-group-marks-right {
  text-align: right;
  font-size: 0.875rem;
  color: #475569;
  font-weight: 600;
  margin-top: 1.5rem;
}

.fp-question-body {
  margin-bottom: 1rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Saved state */
.fp-saved-heading {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

.fp-saved-meta {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--st-text-secondary);
}

.fp-saved-link {
  color: #2563eb;
  font-weight: 600;
}

.fp-saved-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.8rem;
  font-weight: 600;
}

.fp-saved-missing {
  margin: 0 0 1rem;
  color: #b45309;
  font-size: 0.875rem;
}

/* Curriculum metadata */
.fp-curriculum {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: #334155;
}

.fp-curriculum__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fp-curriculum__key {
  font-weight: 600;
  color: var(--st-text-secondary);
  margin-right: 0.25rem;
}

.fp-divider {
  border: none;
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
  margin: 1rem 0;
}

/* Teacher section */
.fp-teacher-intro {
  font-size: 0.875rem;
  color: var(--st-text-secondary);
  margin-bottom: 1rem;
}

.fp-teacher-entry {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--st-border-tertiary, #e8e2d9);
}

.fp-teacher-entry__heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--st-text-primary);
}

/* Action buttons */
.fp-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.fp-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--st-border-secondary, #d1ccc4);
  background: #fff;
  color: var(--st-text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}

.fp-btn:hover {
  background: var(--st-bg-secondary, #f9f8f4);
}

.fp-btn--finish {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.fp-btn--finish:hover {
  background: #0d6660;
  border-color: #0d6660;
  color: #fff;
}

.fp-btn--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.fp-btn--danger:hover {
  background: #fee2e2;
}

/* Loading overlay (shared with AI generation) — warm beige / taupe */
.generation-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(3px);
}

.generation-loading-modal[hidden] { display: none; }

.generation-loading-card {
  width: min(92vw, 460px);
  border-radius: 14px;
  border: 1px solid var(--st-border-mid);
  background: linear-gradient(165deg, var(--st-bg-primary) 0%, var(--st-bg-secondary) 100%);
  color: var(--st-text-primary);
  box-shadow:
    0 4px 6px rgba(67, 58, 50, 0.06),
    0 20px 40px rgba(67, 58, 50, 0.14);
  padding: 1rem 1.1rem;
}

.generation-loading-card__inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.generation-loading-card__gears {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--st-accent);
  flex-shrink: 0;
}

.generation-loading-card__gears svg {
  opacity: 0.92;
}

.generation-loading-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--st-text-primary);
  letter-spacing: -0.01em;
}

.generation-loading-card__subtitle {
  font-size: 0.85rem;
  color: var(--st-text-secondary);
  line-height: 1.45;
}

/* Inline-layout pages (no __gears wrapper): still tint gear icons */
.generation-loading-card .generation-gear-spin,
.generation-loading-card .generation-gear-spin-reverse {
  color: var(--st-accent);
  opacity: 0.92;
}

@keyframes generation-gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes generation-gear-spin-reverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

.generation-gear-spin         { animation: generation-gear-spin 1.2s linear infinite; }
.generation-gear-spin-reverse { animation: generation-gear-spin-reverse 1s linear infinite; }

/* ==========================================================================
   Contact & student forms — responsive (end of bundle; desktop unchanged)
   Base .cf- / .sf- rules stay two-column above 1023px.
   ========================================================================== */

@media (max-width: 1023px) {
  .dashboard .sf-layout,
  .dashboard .cf-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard .sf-layout > .sf-left,
  .dashboard .sf-layout > .cf-left,
  .dashboard .cf-layout > .cf-left,
  .dashboard .sf-sidebar,
  .dashboard .cf-sidebar {
    min-width: 0;
    max-width: 100%;
  }

  .dashboard .cf-fields--2col {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard .sf-enrolment-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .dashboard .sf-parent-mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .dashboard .sf-layout,
  .dashboard .cf-layout {
    gap: 1rem;
  }

  .dashboard .sf-left,
  .dashboard .cf-left {
    gap: 1rem;
  }

  .dashboard .cf-card__header,
  .dashboard .sf-card__header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem 0.75rem;
    padding: 0.65rem 1rem;
  }

  .dashboard .cf-card__hint,
  .dashboard .sf-card__hint {
    flex: 1 1 100%;
    margin-left: 0 !important;
    line-height: 1.35;
  }

  .dashboard .cf-card__body,
  .dashboard .sf-card__body {
    padding: 1rem;
  }

  .dashboard .cf-sidebar .cf-card__body,
  .dashboard .sf-sidebar__body {
    padding: 1rem;
  }

  .dashboard .cf-field {
    min-width: 0;
  }

  .dashboard .cf-field label {
    line-height: 1.35;
  }

  .dashboard .cf-field .iti {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .dashboard .cf-field .iti input {
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
  }

  .dashboard .cf-errors,
  .dashboard .sf-errors,
  .dashboard .cf-actions {
    max-width: none;
  }

  .dashboard .cf-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .dashboard .cf-actions .btn-primary,
  .dashboard .cf-actions .btn-outline {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .dashboard .sf-remove-label {
    white-space: normal;
    padding-bottom: 0;
  }
}
