/*
 * App shell — makes the portals and Super Admin look and behave like an
 * installed app: icon navigation, a bottom tab bar on phones, press feedback,
 * a loading bar between pages, and safe-area padding for notched screens.
 */

:root {
  --app-tabbar-h: 64px;
  --app-accent: var(--ke-green, #006b3f);
}

/* Grid and flex children may shrink below their content: one long unbroken
   line (a truncated title, an email) must not push a card past the phone screen. */
.srms-main .grid > *, .srms-main .flex-1 { min-width: 0; }
.srms-main { overflow-wrap: break-word; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body.srms-theme,
body.admin-shell {
  overscroll-behavior-y: none;
}

/* Icons sit on the text baseline in every nav. */
.srms-nav-link,
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.srms-nav-link svg,
.admin-nav-link svg {
  flex-shrink: 0;
}
.srms-brand-icon svg { display: block; margin: 0 auto; }
.srms-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

/* Press feedback, like a native button. */
:where(.btn-primary, .btn-secondary, .btn-danger, .app-tab, .srms-nav-link, .admin-nav-link, .srms-stat-card, .app-press):active {
  transform: scale(0.97);
}
:where(.btn-primary, .btn-secondary, .btn-danger, .app-tab, .srms-nav-link, .admin-nav-link, .srms-stat-card, .app-press) {
  transition: transform 0.08s ease, background-color 0.15s ease, color 0.15s ease;
}

/* Thin loading bar at the top while the next page loads. */
.app-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  height: 3px;
  width: 0;
  opacity: 0;
  background: var(--app-accent);
  pointer-events: none;
  transition: width 0.2s ease, opacity 0.3s ease;
}
.app-progress.is-loading {
  opacity: 1;
  width: 80%;
  transition: width 3s cubic-bezier(0.1, 0.7, 0.3, 1), opacity 0.1s;
}

/* Bottom tab bar — phones and small tablets only. */
.app-tabbar { display: none; }

@media (max-width: 900px) {
  .app-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--ke-line, #e5e7eb);
    box-shadow: 0 -6px 18px rgb(0 0 0 / 0.06);
    backdrop-filter: saturate(1.4) blur(8px);
  }
  .app-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 2px;
    border: 0;
    border-radius: 12px;
    background: none;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
  }
  .app-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .app-tab.is-active { color: var(--app-accent); }
  .app-tab.is-active svg { stroke-width: 2.4; }
  .app-tab:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }

  /* Keep the last content clear of the tab bar, and start below the notch. */
  .srms-main,
  .workspace-content {
    padding-top: calc(env(safe-area-inset-top) + 16px) !important;
    padding-bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom) + 12px) !important;
  }

  /* Phones: Super Admin relies on the bottom tab bar; the portals keep a slim
     bar with the menu, title, bell and account menu. */
  .workspace-topbar, .flag-stripe {
    display: none !important;
  }
  .srms-topbar { padding: calc(env(safe-area-inset-top) + 0.4rem) 0.75rem 0.4rem !important; border-bottom: 1px solid var(--ke-line, #e5e7eb); }
  .srms-topbar .srms-search { display: none !important; }
  .srms-topbar .srms-avatar { width: 34px; height: 34px; }
  .srms-main { padding-top: 12px !important; }
}

/* Course cards: every card the same size, long text clamped with a toggle. */
.course-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-items: stretch;
}
.course-card {
  height: 100%;
}
.course-card .course-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.course-card .course-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card.is-expanded .course-card-desc,
.course-card.is-expanded .course-card-title {
  -webkit-line-clamp: unset;
  display: block;
}
.course-card .course-card-actions { margin-top: auto; }
.course-card-more {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--app-accent);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}
.course-badge-new {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--app-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The course card in partials/course-card.php (Tailwind-styled). */
.course-tile .course-tile-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.course-tile .course-tile-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}
.course-tile.is-expanded .course-tile-title,
.course-tile.is-expanded .course-tile-desc {
  display: block;
  -webkit-line-clamp: unset;
  min-height: 0;
}
/* Five cards a row on a desktop, four on a laptop, three on a tablet, two on a phone. */
.course-tile-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}
@media (max-width: 1279px) {
  .course-tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .course-tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .course-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
}
/* A course's requirements on its card: small and short, the full list on hover / the course page. */
.course-tile-reqs { margin-top: 0.4rem; font-size: 0.68rem; line-height: 1.3; color: #374151; }
.course-tile-reqs-label { display: block; font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.course-tile-reqs ul { margin: 0.15rem 0 0; padding-left: 0.9rem; list-style: disc; }
.course-tile-reqs li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-tile-reqs li.is-more { list-style: none; margin-left: -0.9rem; font-weight: 700; color: #15803d; }
@media (max-width: 639px) {
  .course-tile-reqs { font-size: 0.62rem; }
  .course-tile-reqs ul { padding-left: 0.75rem; }
}

/* Attachment organisation cards: two a row on a phone, up to five on a desktop. */
.provider-card-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1279px) { .provider-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .provider-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .provider-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .provider-card-grid > * { padding: 0.75rem !important; }
  .provider-card-grid h3 { font-size: 0.9rem !important; line-height: 1.25; }
  .provider-card-grid .btn-primary { padding: 0.3rem 0.55rem !important; font-size: 0.7rem; }
  .provider-card-grid .provider-card-foot { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* Student dashboard tiles. */
.app-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--ke-line, #e5e7eb);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  text-decoration: none;
  color: inherit;
}
.app-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: #ecf7f0;
  color: var(--app-accent);
}
.app-tile-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; }
.app-tile-value { font-size: 1.4rem; font-weight: 900; color: #111827; line-height: 1.15; }
.app-tile-sub { font-size: 0.75rem; font-weight: 600; color: #6b7280; }

.app-progressbar { height: 0.5rem; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.app-progressbar > span { display: block; height: 100%; border-radius: 999px; background: var(--app-accent); }

/* Super Admin's sidebar collapses below 768px, so its tab bar only shows there. */
@media (min-width: 768px) {
  .app-tabbar.is-admin { display: none; }
}
@media (min-width: 768px) and (max-width: 900px) {
  .workspace-content { padding-bottom: 1.5rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  .app-progress, .app-progress.is-loading { transition: none; }
  :where(.btn-primary, .btn-secondary, .btn-danger, .app-tab, .srms-nav-link, .admin-nav-link, .srms-stat-card, .app-press):active { transform: none; }
}

/*
 * Utilities the views use that are missing from the prebuilt tailwind.css
 * (there is no Tailwind build in this repo to regenerate it). Values match
 * Tailwind's own. Without these the course cards lose their 16:9 cover area
 * and their green Enroll button, and screen-reader-only labels show.
 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.aspect-video { aspect-ratio: 16 / 9; }
.flex-grow { flex-grow: 1; }
.ml-auto { margin-left: auto; }
.pt-0 { padding-top: 0; }
.bottom-0 { bottom: 0; }
.self-center { align-self: center; }
.opacity-90 { opacity: 0.9; }
.whitespace-pre-line { white-space: pre-line; }
.max-h-12 { max-height: 3rem; }
.scroll-mt-4 { scroll-margin-top: 1rem; }
.max-w-\[85\%\] { max-width: 85%; }
.min-w-\[14rem\] { min-width: 14rem; }
.align-\[-2px\] { vertical-align: -2px; }
.backdrop-blur-sm { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.bg-black\/80 { background-color: rgb(0 0 0 / 0.8); }
.bg-green-600 { background-color: #16a34a; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-neutral-200:hover { background-color: #e5e5e5; }
.from-green-700 { --tw-gradient-from: #15803d; --tw-gradient-to: rgb(21 128 61 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-green-900 { --tw-gradient-to: #14532d; }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
@media (min-width: 640px) {
  .sm\:max-w-sm { max-width: 24rem; }
  .sm\:max-w-md { max-width: 28rem; }
}
@media (min-width: 1024px) {
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
}

/*
 * Super Admin on phones: app.css makes the sidebar sticky with a fixed width,
 * which beats Tailwind's `fixed` class — so when it slid off-screen it still
 * held its 224px and left a blank column beside the page. Below 768px it
 * floats over the page instead and takes no space.
 */
@media (max-width: 767px) {
  .workspace-sidebar.admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    width: 16rem;
    flex: none;
    z-index: 50;
    box-shadow: 8px 0 24px rgb(0 0 0 / 0.12);
  }
  .workspace-shell { height: calc(100dvh - 8px); }
  .workspace-topbar { padding: 0.75rem 1rem !important; }
  .workspace-content { padding-left: 1rem !important; padding-right: 1rem !important; }
  .workspace-topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .workspace-topbar .workspace-search { display: none; }
}

/* Small circular progress (partials/progress-ring.php). */
.progress-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.progress-ring svg { position: absolute; inset: 0; }
.progress-ring-value { position: relative; font-weight: 900; color: #111827; letter-spacing: -0.02em; }

/* "New" ribbon on courses published in the last 14 days. */
.course-new-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 0.3rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgb(220 38 38 / 0.35);
}

/* Course learning page: lesson in the middle, course content on the right. */
.learn-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .learn-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .learn-aside { position: sticky; top: 1rem; }
}
.learn-card { border: 1px solid var(--ke-line, #e5e7eb); border-radius: 1rem; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.learn-video { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 1rem 1rem 0 0; background: #0f172a; }
.learn-video iframe, .learn-video video, .learn-video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.learn-video video { object-fit: contain; background: #000; }
.learn-video-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; color: #cbd5e1; font-weight: 700; font-size: 0.85rem; }
.learn-section-title { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280; }
.learn-prose { font-size: 0.95rem; line-height: 1.7; color: #374151; }
.learn-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem; border-radius: 0.75rem; text-decoration: none; color: #111827; }
.learn-item:hover { background: #f4faf6; }
.learn-item.is-current { background: #ecf7f0; box-shadow: inset 3px 0 0 var(--ke-green, #006b3f); }
.learn-item.is-locked { color: #9ca3af; }
.learn-item-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; flex-shrink: 0; border-radius: 999px; border: 2px solid #d1d5db; font-size: 0.75rem; font-weight: 900; color: #6b7280; background: #fff; }
.learn-item.is-done .learn-item-mark { border-color: var(--ke-green, #006b3f); background: var(--ke-green, #006b3f); color: #fff; }
.learn-item.is-current .learn-item-mark { border-color: var(--ke-green, #006b3f); color: var(--ke-green, #006b3f); }
.learn-item-title { display: block; font-size: 0.875rem; font-weight: 700; line-height: 1.3; }
.learn-item-meta { display: block; font-size: 0.72rem; font-weight: 600; color: #6b7280; }
.learn-option { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.65rem 0.8rem; border: 1px solid #e5e7eb; border-radius: 0.65rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.learn-option:hover { border-color: var(--ke-green, #006b3f); background: #f8fcf9; }
.learn-option input { margin-top: 0.2rem; }

/* "Reject with a reason" pop-out on reviewer lists. */
.reject-request { position: relative; display: inline-block; }
.reject-request summary::-webkit-details-marker { display: none; }
.reject-request-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 18rem; padding: 0.75rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; background: #fff; box-shadow: 0 12px 28px rgb(0 0 0 / 0.14); text-align: left; white-space: normal; }
.reject-preset { padding: 0.2rem 0.45rem; border: 1px solid #e5e7eb; border-radius: 999px; background: #f9fafb; font-size: 0.65rem; font-weight: 700; color: #374151; cursor: pointer; }
.reject-preset:hover { border-color: var(--ke-red, #bb0000); color: var(--ke-red, #bb0000); }

/* Account menu in the top-right corner: Profile, Change password, Logout. */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 999px; padding: 2px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 15rem; padding: 0.4rem; border: 1px solid #e5e7eb; border-radius: 0.9rem; background: #fff; box-shadow: 0 16px 36px rgb(0 0 0 / 0.14); }
.user-menu-head { padding: 0.5rem 0.65rem 0.6rem; margin-bottom: 0.25rem; border-bottom: 1px solid #f1f5f9; }
.user-menu-panel a { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem; border-radius: 0.6rem; font-size: 0.875rem; font-weight: 700; color: #1f2937; text-decoration: none; }
.user-menu-panel a:hover { background: #f4faf6; color: var(--app-accent); }
.user-menu-panel a.is-danger { color: #dc2626; }
.user-menu-panel a.is-danger:hover { background: #fef2f2; }
img.srms-avatar { display: block; }

/* Course page: tabs under the video, like the category chips. */
.course-tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.course-tabs::-webkit-scrollbar { display: none; }
.course-tabs [role="tab"] { flex-shrink: 0; padding: 0.5rem 0.95rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 999px; background: #fff; font-size: 0.8rem; font-weight: 800; color: #374151; cursor: pointer; white-space: nowrap; }
.course-tabs [role="tab"]:hover { border-color: var(--ke-green, #006b3f); color: var(--ke-green, #006b3f); }
.course-tabs [role="tab"][aria-selected="true"] { background: var(--ke-green, #006b3f); border-color: var(--ke-green, #006b3f); color: #fff; }
.course-tabs [role="tab"]:focus-visible { outline: 2px solid var(--ke-green, #006b3f); outline-offset: 2px; }

/* Course outline: lock, title, cost, and the module's buttons. */
.outline-list { margin-top: 0.25rem; }
.outline-row { display: flex; gap: 0.75rem; padding: 0.8rem 0.6rem; border-top: 1px solid #f1f5f9; }
.outline-row.is-current { background: #f4faf6; border-radius: 0.75rem; box-shadow: inset 3px 0 0 var(--ke-green, #006b3f); }
.outline-lock { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; flex-shrink: 0; color: #111827; }
.outline-lock.is-open { color: var(--ke-green, #006b3f); }
.outline-lock.is-done { border-radius: 999px; background: var(--ke-green, #006b3f); color: #fff; }
.outline-title { display: block; font-size: 0.875rem; font-weight: 800; line-height: 1.3; color: #111827; text-decoration: none; overflow-wrap: anywhere; }
.outline-title:hover { color: var(--ke-green, #006b3f); }
.outline-cost { margin-top: 0.15rem; font-size: 0.78rem; font-weight: 800; color: #15803d; }
.outline-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.35rem; margin-top: 0.45rem; }
.outline-actions form { display: inline-flex; }
.outline-btn { display: inline-flex; align-items: center; padding: 0.3rem 0.65rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.4rem; background: #fff; font-size: 0.72rem; font-weight: 800; color: #1f2937; text-decoration: none; cursor: pointer; white-space: nowrap; list-style: none; }
.outline-btn::-webkit-details-marker { display: none; }
.outline-btn:hover { border-color: var(--ke-green, #006b3f); color: var(--ke-green, #006b3f); }
.outline-btn.is-primary { background: var(--ke-green, #006b3f); border-color: var(--ke-green, #006b3f); color: #fff; }
.outline-btn.is-primary:hover { background: #00562f; color: #fff; }
.outline-btn.is-disabled { color: #9ca3af; cursor: default; background: #f9fafb; }
.outline-summary[open] { flex-basis: 100%; }
.outline-summary > p { margin-top: 0.45rem; padding: 0.6rem 0.7rem; border-radius: 0.5rem; background: #f8fafc; font-size: 0.8rem; font-weight: 500; line-height: 1.55; color: #374151; }

/* Private amounts: blurred until the owner taps See. */
.is-private { filter: blur(7px); user-select: none; }
[data-reveal] { cursor: pointer; }

/* Minimal dashboard cards. */
.mini-card { display: flex; align-items: center; gap: 0.7rem; min-width: 0; padding: 0.75rem 0.85rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.85rem; background: #fff; text-decoration: none; color: inherit; }
.mini-card:hover { border-color: var(--ke-green, #006b3f); }
.mini-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; flex-shrink: 0; border-radius: 0.6rem; background: #ecf7f0; color: var(--ke-green, #006b3f); }
.mini-card-icon svg { width: 1.1rem; height: 1.1rem; }
.mini-card-label { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card > .outline-btn { flex-shrink: 0; }
@media (max-width: 480px) {
  /* A tile with a button: the icon makes room, so the label and value stay readable. */
  .mini-card:has(> .outline-btn) .mini-card-icon { display: none; }
  .mini-card { gap: 0.5rem; padding: 0.65rem 0.7rem; }
}
.mini-card-value { display: block; font-size: 1rem; font-weight: 900; color: #111827; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.section-head h2 { font-size: 1rem; font-weight: 800; color: #111827; }
.section-head a { font-size: 0.75rem; font-weight: 800; color: var(--ke-green, #006b3f); text-decoration: none; }
.h-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 230px); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.4rem; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.h-scroll > * { scroll-snap-align: start; }
@media (max-width: 639px) { .h-scroll { grid-auto-columns: 72%; } }
.mini-course { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.85rem; background: #fff; text-decoration: none; color: inherit; }
.mini-course:hover { border-color: var(--ke-green, #006b3f); }
.mini-course-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0f5132, #006b3f); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 900; }
.mini-course-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-course-cover .course-new-ribbon { position: absolute; top: 0.5rem; left: 0.5rem; }
.mini-course-body { padding: 0.6rem 0.75rem 0.75rem; min-width: 0; }
.mini-course-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.85rem; font-weight: 800; line-height: 1.3; color: #111827; }
.mini-course-meta { margin-top: 0.25rem; font-size: 0.7rem; font-weight: 700; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Utilities the prebuilt Tailwind file lacks. */
.decoration-dotted { text-decoration-style: dotted; }
.py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
@media (min-width: 640px) { .sm\:text-left { text-align: left; } }

/* Course card buttons: two side by side, same height, never wrapping crooked. */
.course-tile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; padding: 0 0.75rem 0.75rem; margin-top: auto; }
@media (min-width: 640px) { .course-tile-actions { padding: 0 1rem 1rem; } }
.course-tile-actions .contents { display: contents; }
.course-tile-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-width: 0; min-height: 2.1rem; padding: 0.35rem 0.5rem; border: 1px solid #e5e7eb; border-radius: 0.55rem; background: #f5f5f5; font-size: 0.72rem; font-weight: 800; line-height: 1.1; color: #1f2937; text-align: center; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.course-tile-btn:hover { background: #ebebeb; }
.course-tile-btn.is-primary { background: #16a34a; border-color: #16a34a; color: #fff; }
.course-tile-btn.is-primary:hover { background: #15803d; }
.course-tile-btn.is-done { background: #ecf7f0; border-color: #bfe3cc; color: var(--ke-green, #006b3f); }
.course-tile-btn.is-wide { grid-column: 1 / -1; }

/* Uploaded certificate / letter design with the student's details placed on it. */
.doc-stage { position: relative; width: 100%; max-width: 1000px; margin: 0 auto; container-type: inline-size; background: #fff; box-shadow: 0 10px 30px rgb(0 0 0 / 0.12); line-height: 1.15; }
.doc-bg { display: block; width: 100%; height: auto; }
canvas.doc-bg { min-height: 12rem; background: #f8fafc; }
.doc-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: #6b7280; }
.doc-field { position: absolute; transform: translate(-50%, -50%); max-width: 92%; white-space: nowrap; text-align: center; font-family: Georgia, 'Times New Roman', serif; }
.doc-stage.is-editable .doc-field { cursor: grab; padding: 0.1em 0.3em; outline: 1.5px dashed #16a34a; background: rgb(22 163 74 / 0.08); touch-action: none; user-select: none; }
.doc-stage.is-editable .doc-field.is-hidden { opacity: 0.35; outline-color: #9ca3af; }
.doc-stage.is-editable .doc-field.is-active { outline: 2px solid #dc2626; background: rgb(220 38 38 / 0.08); }
@media print {
  @page { margin: 0; }
  body * { visibility: hidden !important; }
  .doc-stage, .doc-stage * { visibility: visible !important; }
  .doc-stage { position: absolute; left: 0; top: 0; width: 100%; max-width: none; box-shadow: none; }
  .doc-loading { display: none; }
}

/* Super Admin's uploaded logo in the portal sidebar, in its own colours. */
.srms-brand-icon.has-logo { display: flex; justify-content: center; width: fit-content; max-width: 160px; height: 56px; margin: 0 auto 0.5rem; padding: 4px 8px; border-radius: 12px; background: #fff; }
.srms-brand-logo { display: block; height: 100%; width: auto; max-width: 144px; object-fit: contain; }

/* Module cards under the course overview. */
.module-card-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.module-card { display: block; padding: 0.85rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; background: #fff; transition: border-color .15s, box-shadow .15s; }
.module-card:hover { border-color: var(--ke-green, #006b3f); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.module-card.is-locked { background: #f9fafb; }

/* Branch cards on forms: pick one, each showing its contacts. */
.branch-pick-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.branch-pick { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.75rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; background: #fff; cursor: pointer; }
.branch-pick:hover { border-color: var(--ke-green, #006b3f); }
.branch-pick:has(input:checked) { border-color: var(--ke-green, #006b3f); background: #f3faf6; box-shadow: 0 0 0 1px var(--ke-green, #006b3f); }
.branch-pick input { margin-top: 0.2rem; }

/* Branch admin attachees: cards that wrap instead of a table wider than the screen. */
.attachee-list { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.attachee-card { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; padding: 1rem; border: 1px solid #e5e7eb; border-radius: 0.9rem; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.attachee-card.is-warning { border-color: var(--notice,#f59e0b); background: var(--notice-bg,#fffdf5); }
.attachee-card[hidden] { display: none; }
.attachee-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.attachee-name { font-size: 0.98rem; font-weight: 900; color: #111827; overflow-wrap: anywhere; }
.attachee-meta { font-size: 0.7rem; font-weight: 700; color: #6b7280; }
.attachee-status { flex-shrink: 0; padding: 0.2rem 0.55rem; border-radius: 999px; background: #ecf7f0; color: var(--ke-green); font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.attachee-status.is-waiting { background: #fef2f2; color: var(--ke-red); }
.attachee-facts { display: grid; gap: 0.55rem; font-size: 0.8rem; color: #374151; min-width: 0; }
.attachee-facts dt { font-size: 0.64rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; }
.attachee-facts dd { margin: 0; overflow-wrap: anywhere; }
.attachee-fees { border-top: 1px solid #f1f5f9; padding-top: 0.55rem; font-size: 0.8rem; }
.attachee-fees summary { cursor: pointer; font-weight: 800; color: #374151; }
.attachee-fees [style*="min-width:14rem"] { min-width: 0 !important; }
.attachee-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.4rem; margin-top: auto; padding-top: 0.6rem; border-top: 1px solid #f1f5f9; }
.attachee-actions .btn-primary, .attachee-actions .btn-secondary, .attachee-actions summary { padding: 0.35rem 0.7rem !important; font-size: 0.72rem !important; }
.attachee-actions .reject-request { flex-basis: auto; }
.attachee-actions .reject-request[open] { flex-basis: 100%; }
.attachee-actions .reject-request-panel { position: static; width: 100%; margin-top: 0.4rem; box-shadow: none; }
.attachee-empty { padding: 1.5rem; border: 1px dashed var(--ke-line, #e5e7eb); border-radius: 0.9rem; text-align: center; font-size: 0.85rem; font-weight: 700; color: var(--ke-muted, #6b7280); }

/* "Choose file" stands out as a button everywhere in the portals. */
input[type=file]::file-selector-button {
  margin-right: 0.75rem; padding: 0.45rem 0.9rem; border: 0; border-radius: 0.6rem;
  background: var(--ke-green, #006b3f); color: #fff; font-weight: 800; font-size: 0.8rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { filter: brightness(.9); }

/* Wallet: small and calm — a balance strip and a one-line top-up form. */
.wallet-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; }
.wallet-strip > div { display: flex; flex-direction: column; justify-content: center; padding: 0.6rem 0.85rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.75rem; background: #fff; }
.wallet-balance { flex: 1 1 12rem; }
.wallet-balance strong { font-size: 1.15rem; font-weight: 900; color: var(--ke-green); line-height: 1.2; }
.wallet-mini { flex: 1 1 8rem; font-size: 0.85rem; font-weight: 800; color: #111827; }
.wallet-label { font-size: 0.62rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ke-muted, #6b7280); }
.wallet-coins { font-size: 0.7rem; font-weight: 700; color: #6b7280; }
.deposit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.75rem; background: #fff; }
.deposit-title { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: auto; font-size: 0.82rem; font-weight: 800; color: #111827; }
.deposit-tag { padding: 0.05rem 0.4rem; border-radius: 99px; background: #fef2f2; color: var(--ke-red); font-size: 0.6rem; font-weight: 900; text-transform: uppercase; }
.deposit-row input { flex: 1 1 7.5rem; min-width: 0; padding: 0.45rem 0.6rem; border: 1px solid #d1d5db; border-radius: 0.55rem; font-size: 0.85rem; }
.deposit-row .btn-primary { padding: 0.45rem 0.9rem !important; }
@media (max-width: 480px) { .deposit-title { flex-basis: 100%; } .deposit-row .btn-primary { flex: 1 1 100%; } }

/* Student dashboard: organisation / categories / registration number as small cards. */
.me-chip { display: flex; flex-direction: column; justify-content: center; min-width: 0; max-width: 16rem; padding: 0.35rem 0.7rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.6rem; background: #fff; text-decoration: none; }
.me-chip-label { display: block; font-size: 0.6rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip-value { display: block; font-size: 0.8rem; font-weight: 900; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.me-chip:hover { border-color: var(--ke-green); }

/* A module not paid for yet: shown, but nothing in it can be used. */
.module-paybar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0.75rem; padding: 0.75rem 0.9rem; border: 1px solid var(--notice-border,#fde68a); border-radius: 0.75rem; background: var(--notice-bg,#fffbeb); color: var(--notice-strong,#92400e); font-size: 0.85rem; }
.module-paybar > div { flex: 1 1 14rem; min-width: 0; }
.module-paybar > form, .module-paybar > a { flex: 0 0 auto; }
@media (max-width: 640px) {
  .module-paybar > form, .module-paybar > a { flex: 1 1 100%; }
  .module-paybar .btn-primary { width: 100%; justify-content: center; text-align: center; }
}
.module-paybar-icon { display: flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; flex-shrink: 0; border-radius: 0.6rem; background: var(--notice-bg,#fef3c7); }
.learn-video { position: relative; }
.learn-video.is-preview iframe, .learn-video.is-preview video { pointer-events: none; filter: saturate(.6) brightness(.85); }
.learn-video.is-preview::after { content: ""; position: absolute; inset: 0; cursor: not-allowed; }
.learn-video-lock { position: absolute; top: 50%; left: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; width: 3.4rem; height: 3.4rem; margin: -1.7rem 0 0 -1.7rem; border-radius: 999px; background: rgba(17, 24, 39, .7); color: #fff; pointer-events: none; }
.module-preview { opacity: .6; user-select: none; }
.video-fullscreen { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0.5rem 0.75rem 0; padding: 0.35rem 0.7rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.6rem; background: #fff; font-size: 0.75rem; font-weight: 800; color: #374151; cursor: pointer; }
.learn-video:fullscreen, .learn-video:-webkit-full-screen { width: 100%; height: 100%; background: #000; border-radius: 0; }
.learn-video:fullscreen iframe, .learn-video:fullscreen video { width: 100%; height: 100%; }

/* Phones: calmer text sizes on the learning pages and portal headings. */
@media (max-width: 640px) {
  .srms-main h1, .srms-main .text-3xl { font-size: 1.35rem !important; line-height: 1.25; }
  .srms-main h2.text-2xl, .srms-main .text-2xl { font-size: 1.15rem !important; line-height: 1.3; }
  .srms-main .text-xl { font-size: 1.05rem !important; }
  .srms-main .text-lg { font-size: 0.98rem !important; }
  .learn-prose { font-size: 0.9rem; line-height: 1.6; }
  .learn-section-title { font-size: 0.68rem; }
  .learn-option { font-size: 0.86rem; padding: 0.55rem 0.7rem; }
  #lesson .p-5, #lesson .sm\:p-6 { padding: 1rem !important; }
  .srms-main .btn-primary, .srms-main .btn-secondary { font-size: 0.72rem; }
}

/* A picture question (e.g. a road sign). */
.quiz-picture { display: block; max-width: min(100%, 320px); max-height: 240px; margin: 0.25rem 0 0.5rem; border-radius: 0.6rem; border: 1px solid var(--ke-line, #e5e7eb); background: #fff; object-fit: contain; }

/* Phones: smaller module / course titles and descriptions. */
@media (max-width: 640px) {
  #lesson-title, .learn-card h2.font-serif-heading { font-size: 1.05rem !important; line-height: 1.3 !important; }
  .learn-shell h1.font-serif-heading, .learn-card h1 { font-size: 1.15rem !important; line-height: 1.3 !important; }
  .learn-prose, .learn-prose p, .learn-prose li { font-size: 0.85rem !important; line-height: 1.5 !important; }
  .learn-section-title { font-size: 0.65rem !important; }
  .module-card h3 { font-size: 0.95rem !important; line-height: 1.3 !important; }
  .module-card p, .module-card .learn-prose { font-size: 0.8rem !important; }
}

/* Timed final exam countdown: stays in view while answering. */
.exam-timer { position: sticky; top: 70px; z-index: 5; display: inline-block; padding: .35rem .8rem; border-radius: 999px; background: #ecf7f0; color: var(--ke-green); font-weight: 800; font-size: .9rem; }
.exam-timer.is-low { background: #fef2f2; color: var(--ke-red); }

/* ---- Spreadsheet look (MS Excel): name box + formula bar, column letters,
   row numbers, hairline gridlines, no gaps. Built by assets/js/excel-grid.js
   from any <table data-xl>. ---- */
.xl-book { --xl-green: #217346; --xl-grid: #e1e1e1; --xl-head: #f3f3f3; --xl-head-line: #c8c8c8; border: 1px solid #c8c8c8; background: #fff; font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 13px; color: #000; }
.xl-bar { display: flex; align-items: stretch; height: 26px; border-bottom: 1px solid #d4d4d4; background: #fff; }
.xl-namebox { width: 74px; flex-shrink: 0; display: flex; align-items: center; padding: 0 6px; border-right: 1px solid #d4d4d4; font-size: 12px; }
.xl-fx { display: flex; align-items: center; padding: 0 8px; border-right: 1px solid #d4d4d4; color: #777; font-style: italic; font-family: "Times New Roman", serif; font-size: 13px; }
.xl-formula { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.xl-scroll { overflow: auto; max-height: 72vh; }
.xl-book table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; table-layout: auto; }
.xl-book th, .xl-book td { height: 21px; padding: 0 6px; border-right: 1px solid var(--xl-grid); border-bottom: 1px solid var(--xl-grid); white-space: nowrap; vertical-align: middle; text-align: left; font-weight: 400; line-height: 20px; }
.xl-book td { max-width: 340px; overflow: hidden; text-overflow: ellipsis; background: #fff; cursor: cell; }
/* Column letters (A, B, C…) and the corner. */
.xl-book table .xl-letters th { position: sticky; top: 0; z-index: 3; height: 20px; background: var(--xl-head) !important; color: #444 !important; text-align: center; font-size: 11.5px; font-weight: 400; text-transform: none; letter-spacing: 0; border-right: 1px solid var(--xl-head-line); border-bottom: 1px solid var(--xl-head-line); }
.xl-book table .xl-letters th.is-active { background: #d2d2d2 !important; color: var(--xl-green) !important; border-bottom: 2px solid var(--xl-green); }
/* Row 1 = the field names, bold, frozen under the letters. */
.xl-book table .xl-header th { position: sticky; top: 21px; z-index: 2; background: #fff !important; color: #000 !important; font-weight: 700; text-transform: none; letter-spacing: 0; border-bottom: 1px solid #a6a6a6; }
/* Row numbers down the left, frozen. */
.xl-book table .xl-rownum { position: sticky; left: 0; z-index: 1; width: 40px; min-width: 40px; padding: 0 4px; background: var(--xl-head) !important; color: #444 !important; font-weight: 400; text-align: center !important; font-size: 11.5px; border-right: 1px solid var(--xl-head-line); cursor: default; }
.xl-book .xl-letters .xl-rownum, .xl-book .xl-header .xl-rownum { z-index: 4; }
.xl-book table tr.is-active .xl-rownum { background: #d2d2d2 !important; color: var(--xl-green) !important; box-shadow: inset -2px 0 0 var(--xl-green); }
.xl-book td.is-sel { outline: 2px solid var(--xl-green); outline-offset: -2px; background: #fff; }
.xl-book tbody tr:hover td:not(.xl-rownum):not(.is-sel) { background: #f5faf7; }
.xl-book td.xl-num { text-align: right; }
.xl-book td a { color: #0563c1; text-decoration: underline; }
.xl-book td input[type=checkbox], .xl-book th input[type=checkbox] { margin: 0; vertical-align: middle; accent-color: var(--xl-green); }
.xl-book .xl-empty td { color: #777; font-style: italic; }
.xl-tabs { display: flex; align-items: stretch; gap: 0; height: 26px; border-top: 1px solid #c8c8c8; background: var(--xl-head); font-size: 12px; }
.xl-tabs a, .xl-tabs span { display: flex; align-items: center; padding: 0 14px; border-right: 1px solid #c8c8c8; color: #333; text-decoration: none; }
.xl-tabs .is-active { background: #fff; color: var(--xl-green); font-weight: 700; box-shadow: inset 0 -2px 0 var(--xl-green); }
.xl-tabs .xl-count { margin-left: auto; border-right: 0; border-left: 1px solid #c8c8c8; color: #555; }

/* A compact toolbar for filters and actions above a sheet (no big fields). */
.xl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0; border: 1px solid #c8c8c8; border-bottom: 0; background: #f8f8f8; font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 12px; }
.xl-toolbar > * { display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border-right: 1px solid #e0e0e0; }
.xl-toolbar label { font-weight: 700; color: #444; white-space: nowrap; }
.xl-toolbar input, .xl-toolbar select { height: 22px; padding: 0 4px; border: 1px solid #c8c8c8; border-radius: 2px; background: #fff; font: inherit; font-weight: 400; color: #000; }
.xl-toolbar input[type=search] { width: 170px; }
.xl-toolbar input[type=date] { width: 120px; }
.xl-toolbar select { max-width: 190px; }
.xl-toolbar button, .xl-toolbar a.xl-btn { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border: 1px solid #c8c8c8; border-radius: 2px; background: #fff; color: #222; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.xl-toolbar button:hover, .xl-toolbar a.xl-btn:hover { background: #e9f3ee; border-color: #217346; }
.xl-toolbar .xl-btn.is-green, .xl-toolbar button.is-green { background: #217346; border-color: #217346; color: #fff; }
.xl-toolbar .xl-btn.is-green:hover, .xl-toolbar button.is-green:hover { background: #185c37; }
.xl-toolbar button:disabled { opacity: .45; cursor: default; }
.xl-toolbar .xl-grow { flex: 1; border-right: 0; }
@media (max-width: 640px) {
  .xl-toolbar > * { height: auto; min-height: 30px; padding: 4px 6px; flex-wrap: wrap; }
  .xl-toolbar input[type=search] { width: 130px; }
  .xl-namebox { width: 54px; }
  .xl-book { font-size: 12px; }
}
@media print {
  .xl-bar, .xl-tabs, .xl-toolbar, .xl-book .xl-letters { display: none !important; }
  .xl-scroll { max-height: none; overflow: visible; }
}

/* ------------------------------------------------------------------
 * Compact, minimal cards across the portals and Super Admin.
 * Tighter padding and gaps, flat cards (a hairline border instead of
 * shadows), and smaller page headings — the topbar already names the page.
 * ------------------------------------------------------------------ */
.srms-main, .workspace-content { --card-pad: 0.75rem; --card-radius: 0.6rem; }
:is(.srms-main, .workspace-content) :is(.rounded-xl, .rounded-2xl).border { border-radius: var(--card-radius); }
:is(.srms-main, .workspace-content) :is(.rounded-xl, .rounded-2xl, .learn-card).p-6,
:is(.srms-main, .workspace-content) :is(.rounded-xl, .rounded-2xl, .learn-card).p-5 { padding: var(--card-pad); }
:is(.srms-main, .workspace-content) :is(.rounded-xl, .rounded-2xl).p-4 { padding: 0.7rem; }
:is(.srms-main, .workspace-content) .shadow-sm,
:is(.srms-main, .workspace-content) .shadow,
:is(.srms-main, .workspace-content) .shadow-md { box-shadow: none; }
:is(.srms-main, .workspace-content) .hover\:shadow-md:hover { box-shadow: 0 2px 8px rgb(0 0 0 / 0.06); }
:is(.srms-main, .workspace-content) .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
:is(.srms-main, .workspace-content) .space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.85rem; }
:is(.srms-main, .workspace-content) .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.7rem; }
:is(.srms-main, .workspace-content) :is(.gap-6) { gap: 0.85rem; }
:is(.srms-main, .workspace-content) :is(.gap-5) { gap: 0.75rem; }
:is(.srms-main, .workspace-content) :is(.gap-4) { gap: 0.65rem; }
:is(.srms-main, .workspace-content) h1.font-serif-heading.text-3xl { font-size: 1.4rem; line-height: 1.25; margin-top: 0.15rem; }
:is(.srms-main, .workspace-content) .p-8 { padding: 1rem; }
.learn-card { border-radius: var(--card-radius, 0.6rem); box-shadow: none; }
.srms-card, .srms-stat-card { padding: 0.85rem; border-radius: 0.6rem; box-shadow: none; border: 1px solid var(--ke-line, #e5e7eb); }
.srms-stat-grid { gap: 0.6rem; margin-bottom: 0.85rem; }
.srms-stat-icon { width: 36px; height: 36px; border-radius: 9px; font-size: 1.1rem; }
.attachee-card { padding: 0.7rem; gap: 0.45rem; border-radius: 0.6rem; box-shadow: none; }
.mini-card { padding: 0.55rem 0.7rem; border-radius: 0.6rem; }
.module-card { padding: 0.65rem; border-radius: 0.6rem; }
.profile-form-card { box-shadow: none !important; }
.provider-card-grid { gap: 0.6rem; }

/* Student attachment page */
.att-h { margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #374151; }
.att-card { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; padding: 0.6rem 0.7rem; border: 1px solid var(--ke-line, #e5e7eb); border-radius: 0.6rem; background: #fff; color: inherit; text-decoration: none; }
.att-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.att-provider.is-open:hover { border-color: var(--ke-green); }
.att-provider.is-chosen { border-color: var(--ke-green); }
.att-provider.is-off { opacity: 0.5; }
.att-pill { flex-shrink: 0; border-radius: 99px; padding: 1px 7px; font-size: 10px; font-weight: 800; text-transform: uppercase; background: #e7f4ec; color: #0b6b3a; }
.att-pill.is-bad { background: #fdecec; color: #a11; }
.att-btn { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border: 1px solid var(--ke-line, #d1d5db); border-radius: 99px; font-size: 0.72rem; font-weight: 700; color: #374151; background: #fff; text-decoration: none; }
.att-btn:hover { border-color: var(--ke-green); color: var(--ke-green); }
.att-btn.is-primary { background: var(--ke-green); border-color: var(--ke-green); color: #fff; }

/* A course or book code, shown wherever students search or browse, so they can confirm they found the right one. */
.code-badge { display: inline-flex; align-items: center; gap: .25em; padding: .1em .5em; border-radius: .4em; border: 1px solid currentColor;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; font-weight: 800; letter-spacing: .04em;
  line-height: 1.5; color: var(--primary, var(--ke-green, #006b3f)); background: color-mix(in srgb, var(--primary, var(--ke-green, #006b3f)) 8%, #fff); white-space: nowrap; }
.code-badge::before { content: "#"; opacity: .55; }
