/* ── Clinical Library – Google Drive layout ── */

#cl-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--app-header-height, 56px));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(17, 12, 8, 0.18), rgba(17, 12, 8, 0.42)),
    var(--cl-bg-library) center center / cover no-repeat;
}

/* TOP BAR */
#cl-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 248, 236, 0.9);
  border-bottom: 1px solid rgba(94, 59, 32, 0.22);
  backdrop-filter: blur(6px);
}

#cl-topbar .cl-topbar__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #355070;
  margin: 0;
  white-space: nowrap;
}

#cl-topbar .cl-topbar__spacer {
  flex: 1 1 auto;
}

#cl-search {
  width: 260px;
  font-size: 0.875rem;
}

#cl-unified-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 16px 16px;
}

#cl-unified-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

/* TGV:T01 - Les commandes et libelles de bibliotheque peuvent revenir a la ligne sans perte. */
.cl-view-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(94, 59, 32, 0.16);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.9);
  color: #355070;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(38, 23, 10, 0.1);
  white-space: normal;
  overflow-wrap: anywhere;
}

.cl-view-filter:hover,
.cl-view-filter.is-active {
  background: #fffaf0;
  color: #243d59;
  text-decoration: none;
  box-shadow: 0 0 0 2px rgba(53, 80, 112, 0.12);
}

.cl-folder-card__status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-height: 20px;
  margin-left: auto;
  padding-left: 8px;
}

.cl-folder-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cl-folder-status--new {
  color: #174b72;
  background: #dceffc;
  border: 1px solid #9fccea;
}

.cl-folder-status--mandatory {
  color: #7a2e12;
  background: #fff0d8;
  border: 1px solid #e7bd75;
}

#cl-user-dashboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(94, 59, 32, 0.16);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.92);
  box-shadow: 0 8px 18px rgba(38, 23, 10, 0.12);
}

.cl-dashboard-greeting {
  color: #243d59;
  font-weight: 700;
  font-size: 1rem;
}

.cl-dashboard-subtitle {
  color: #6c584c;
  font-size: 0.82rem;
}

#cl-library-workspace,
.cl-dashboard-metrics {
  display: flex;
}

#cl-library-workspace {
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.cl-dashboard-metrics {
  flex-wrap: wrap;
  gap: 8px;
}

.cl-dashboard-metrics {
  justify-content: flex-end;
  font-size: 0.78rem;
  color: #4f5d68;
}

.cl-dashboard-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

#cl-home-sections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cl-home-band {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(94, 59, 32, 0.16);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.88);
}

.cl-home-band__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.cl-home-band h3 {
  margin: 0;
  color: #243d59;
  font-size: 0.86rem;
  font-weight: 700;
}

.cl-home-band__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #6c584c;
  font-size: 0.78rem;
}

.cl-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid rgba(94, 59, 32, 0.12);
  background: transparent;
  color: #243d59;
  text-align: left;
}

.cl-mini-item:last-child {
  border-bottom: 0;
}

.cl-recent-pill {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #355070;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cl-mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(94, 59, 32, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #355070;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.cl-mini-action:hover,
.cl-mini-action.is-active {
  background: #355070;
  color: #fff;
  text-decoration: none;
}

/* BREADCRUMB */
#cl-breadcrumb {
  flex: 0 0 auto;
  padding: 6px 16px;
  background: rgba(255, 248, 236, 0.86);
  border-bottom: 1px solid rgba(94, 59, 32, 0.16);
  font-size: 0.8rem;
  color: #6c584c;
  min-height: 34px;
}

#cl-breadcrumb .breadcrumb {
  margin: 0;
  padding: 0;
  background: transparent;
}

#cl-breadcrumb .breadcrumb-item a {
  color: #355070;
  text-decoration: none;
}

#cl-breadcrumb .breadcrumb-item a.is-drop-target {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(232, 240, 254, 0.9);
  box-shadow: 0 0 0 1px rgba(53, 80, 112, 0.18);
  text-decoration: none;
}

#cl-breadcrumb .breadcrumb-item a:hover {
  text-decoration: underline;
}

/* BODY */
#cl-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* CONTENT ZONE */
#cl-content {
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}

#cl-content-backbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 12px;
}

#cl-content-backbar:not(.is-active) {
  pointer-events: none;
}

#cl-content-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(94, 59, 32, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.9);
  color: #355070;
  box-shadow: 0 10px 18px rgba(38, 23, 10, 0.12);
  backdrop-filter: blur(5px);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

#cl-content-backbar:not(.is-active) #cl-content-back {
  opacity: 0;
  visibility: hidden;
}

#cl-content-back:hover {
  background: rgba(255, 248, 236, 0.98);
  color: #27405b;
  text-decoration: none;
  transform: translateX(-1px);
}

#cl-content-back:focus {
  outline: none;
  box-shadow:
    0 0 0 0.2rem rgba(53, 80, 112, 0.18),
    0 10px 18px rgba(38, 23, 10, 0.12);
}

#cl-root-dropzone {
  flex: 1 1 auto;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px dashed rgba(94, 59, 32, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.42);
  color: rgba(47, 36, 24, 0.72);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, background 0.15s, border-color 0.15s;
  pointer-events: none;
}

#cl-page.cl-drag-mode #cl-root-dropzone {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

#cl-root-dropzone.is-drop-target {
  border-color: rgba(53, 80, 112, 0.55);
  background: rgba(232, 240, 254, 0.92);
  color: #27405b;
  box-shadow: 0 0 0 2px rgba(53, 80, 112, 0.12);
}

#cl-inline-status {
  min-height: 0;
  margin-bottom: 0;
  opacity: 0;
  transition: opacity 0.15s, margin 0.15s;
}

#cl-inline-status.is-visible {
  min-height: 22px;
  margin-bottom: 10px;
  opacity: 1;
  font-size: 0.82rem;
  font-weight: 600;
}

#cl-inline-status-dismiss {
  display: none;
  min-width: 40px;
  min-height: 40px;
  margin-left: .5rem;
  border: 1px solid currentColor;
  border-radius: .25rem;
  background: transparent;
  color: inherit;
}

#cl-inline-status.is-visible #cl-inline-status-dismiss {
  display: inline-block;
}

#cl-inline-status.is-error {
  color: #ffe6d6;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

#cl-inline-status.is-success {
  color: #e6ffef;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

#cl-content-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(24, 35, 48, 0.18);
  backdrop-filter: blur(2px);
}

.cl-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cl-section__title {
  color: #26384d;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: none;
}

.cl-folder-stack,
.cl-article-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* FOLDER LIST */
.cl-folder-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  padding: 8px 10px;
  background: rgba(247, 249, 252, 0.94);
  border: 1px solid rgba(38, 56, 77, 0.1);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
  box-shadow: none;
}

.cl-folder-card:hover {
  background: #ffffff;
  border-color: rgba(53, 80, 112, 0.24);
  box-shadow: 0 6px 18px rgba(24, 35, 48, 0.08);
}

.cl-folder-card.is-dragging {
  opacity: 0.52;
}

.cl-folder-card.is-drop-target {
  background: rgba(232, 240, 254, 0.96);
  outline: 2px dashed #0d6efd;
}

.cl-article-reader {
  min-height: calc(100vh - 120px);
  padding: 18px;
  background: #f7f9fc;
}

.cl-article-reader__toolbar,
.cl-article-reader__context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cl-article-reader__toolbar {
  justify-content: space-between;
}

.cl-article-reader__title {
  flex: 1 1 auto;
  min-width: 180px;
  color: #26384d;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.cl-article-reader__context span {
  display: inline-flex;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(38, 56, 77, 0.1);
  color: #516070;
  font-size: 0.82rem;
}

.cl-article-reader__body {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  border: 1px solid rgba(38, 56, 77, 0.1);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(24, 35, 48, 0.12);
  color: #26384d;
  line-height: 1.62;
}

/* TGV:S12.04 - Lecteur Markdown local, lisible sur desktop/iPad et limite au HTML purifie serveur. */
.cl-markdown-reader {
  overflow-wrap: anywhere;
}

.cl-markdown-reader > :first-child {
  margin-top: 0;
}

.cl-markdown-reader > :last-child {
  margin-bottom: 0;
}

.cl-markdown-reader h1,
.cl-markdown-reader h2,
.cl-markdown-reader h3,
.cl-markdown-reader h4,
.cl-markdown-reader h5,
.cl-markdown-reader h6 {
  margin: 1.45em 0 0.55em;
  color: #26384d;
  line-height: 1.25;
}

.cl-markdown-reader h1 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid rgba(38, 56, 77, 0.16);
  font-size: 1.75rem;
}

.cl-markdown-reader h2 {
  font-size: 1.4rem;
}

.cl-markdown-reader h3 {
  font-size: 1.15rem;
}

.cl-markdown-reader pre,
.cl-markdown-reader code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.cl-markdown-reader pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 14px;
  border: 1px solid rgba(38, 56, 77, 0.12);
  border-radius: 6px;
  background: #f4f6f8;
  font-size: 0.88rem;
}

.cl-markdown-reader :not(pre) > code {
  padding: 0.12em 0.32em;
  border-radius: 4px;
  background: #eef2f6;
  font-size: 0.9em;
}

.cl-markdown-reader blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 4px solid #9cafc4;
  color: #526273;
  background: #f7f9fb;
}

.cl-markdown-reader table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.cl-markdown-reader th,
.cl-markdown-reader td {
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid #d8e0e8;
  text-align: left;
  vertical-align: top;
}

.cl-markdown-reader th {
  background: #eef3f7;
  font-weight: 700;
}

.cl-markdown-reader a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 767.98px) {
  .cl-article-reader {
    padding: 10px;
  }

  .cl-article-reader__body {
    padding: 18px;
  }

  .cl-markdown-reader h1 {
    font-size: 1.45rem;
  }
}

.cl-folder-card__icon {
  flex: 0 0 auto;
  margin-right: 9px;
  font-size: 1rem;
  color: #d89b2b;
}

.cl-folder-card__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  color: #26384d;
  word-break: break-word;
  line-height: 1.35;
  font-weight: 700;
  text-align: left;
  text-shadow: none;
}

.cl-folder-card__admin-actions {
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid rgba(53, 80, 112, 0.22);
  border-radius: 6px;
  background: #ffffff;
  color: #355070;
  cursor: pointer;
}

.cl-folder-card__admin-actions:hover,
.cl-folder-card__admin-actions:focus-visible {
  border-color: #355070;
  background: #eef3f7;
  color: #243d59;
}

@media (max-width: 1279.98px) {
  .cl-folder-card__admin-actions {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}

/* FILE LIST */
.cl-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(38, 56, 77, 0.1);
  border-radius: 6px;
  cursor: grab;
  text-align: left;
  position: relative;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
  box-shadow: none;
}

.cl-file-card:hover {
  background: #ffffff;
  border-color: rgba(53, 80, 112, 0.24);
  box-shadow: 0 6px 18px rgba(24, 35, 48, 0.08);
}

.cl-file-card.is-dragging {
  opacity: 0.5;
}

.cl-file-card__main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.cl-file-card__icon {
  flex: 0 0 auto;
  font-size: 1rem;
  color: #8b2d21;
  margin-right: 9px;
}

.cl-file-card__summary {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(103, 72, 44, 0.22);
  border-radius: 999px;
  background: rgba(247, 249, 252, 0.94);
  color: #355070;
  cursor: pointer;
}

.cl-file-card__summary:hover {
  background: #fffaf0;
  color: #243d59;
}

.cl-file-card__name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 0.9rem;
  color: #26384d;
  word-break: break-word;
  line-height: 1.35;
  font-weight: 700;
}

.cl-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cl-file-card__date {
  font-size: 0.72rem;
  color: #667085;
  white-space: nowrap;
}

.cl-file-card--search {
  min-height: 44px;
}

/* CONTEXT MENU */
#cl-ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  padding: 4px 0;
  min-width: 160px;
  display: none;
}

#cl-ctx-menu.is-visible {
  display: block;
}

.cl-ctx-menu__item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: #343a40;
  cursor: pointer;
}

.cl-ctx-menu__item:hover {
  background: #f0f4ff;
}

.cl-ctx-menu__item--danger {
  color: #dc3545;
}

.cl-ctx-menu__item--danger:hover {
  background: #fff0f0;
}

/* EMPTY STATE */
#cl-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #fff6de;
  padding: 40px 0;
  font-size: 1rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* UPLOAD DROP ZONE */
#cl-upload-zone {
  grid-column: 1 / -1;
  border: 2px dashed #b89d77;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: #6c584c;
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(255, 248, 236, 0.55);
}

#cl-upload-zone.is-dragover {
  border-color: #0d6efd;
  background: #e8f0fe;
  color: #0d3c6e;
}

/* LOADING */
.cl-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #dee2e6;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: cl-spin 0.6s linear infinite;
}

@keyframes cl-spin {
  to { transform: rotate(360deg); }
}

/* MODAL RENAME */
#cl-rename-modal .modal-body input {
  font-size: 0.9rem;
}

@media (max-width: 991.98px) {
  /* TGV:T01 - La barre iPad accepte le reflow lorsque l espacement de texte est augmente. */
  #cl-topbar {
    flex-wrap: wrap;
  }

  #cl-topbar .btn {
    height: auto;
    white-space: normal;
  }

  #cl-search {
    flex: 1 1 240px;
    width: auto;
  }

  #cl-unified-shell {
    grid-template-columns: 1fr;
    padding: 10px 12px 12px;
  }

  #cl-unified-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .cl-view-filter {
    flex: 0 0 auto;
    white-space: normal;
  }

  #cl-user-dashboard {
    align-items: flex-start;
    flex-direction: column;
  }

  .cl-dashboard-metrics {
    justify-content: flex-start;
  }

  #cl-home-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #cl-content {
    padding: 14px;
  }
}

@media (max-width: 767.98px) {
  #cl-topbar {
    flex-wrap: wrap;
  }

  #cl-search {
    width: 100%;
  }

  #cl-home-sections {
    grid-template-columns: 1fr;
  }

  .cl-home-band {
    padding: 9px;
  }

  .cl-file-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cl-file-card__date {
    display: none;
  }
}
.cl-ux-badges,
.cl-file-card__badges {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.cl-mini-item .cl-ux-badges {
  margin-top: 0;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.cl-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #243d59;
  background: #eef2f6;
  border: 1px solid rgba(53, 80, 112, 0.14);
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

.cl-badge--mandatory {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fecaca;
}

.cl-badge--fc {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.cl-badge--ai {
  color: #4c1d95;
  background: #ede9fe;
  border-color: #ddd6fe;
}

.cl-badge--success {
  color: #064e3b;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.cl-badge--reference {
  color: #243d59;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.cl-badge--procedure {
  color: #713f12;
  background: #fef3c7;
  border-color: #fde68a;
}

.cl-badge--politique {
  color: #3730a3;
  background: #e0e7ff;
  border-color: #c7d2fe;
}

.cl-badge--new {
  color: #155e75;
  background: #cffafe;
  border-color: #a5f3fc;
}

.cl-badge--expired,
.cl-badge--reread {
  color: #7f1d1d;
  background: #ffe4e6;
  border-color: #fecdd3;
}

.cl-quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 36%);
  gap: 14px;
  align-items: start;
}

.cl-quiz-reference {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(53, 80, 112, 0.16);
  border-radius: 8px;
  background: #fff;
}

.cl-quiz-reference__content {
  font-size: 0.92rem;
  line-height: 1.45;
}

#cl-quiz-timer {
  min-width: 58px;
  padding: 7px 10px;
  font-size: 0.9rem;
}

.cl-quiz-final-panel {
  margin: 0 0 1rem;
}

.cl-quiz-final-card {
  align-items: center;
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 51, 84, 0.08);
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
}

.cl-quiz-final-panel--success .cl-quiz-final-card {
  border-color: #b7dfc6;
}

.cl-quiz-final-panel--danger .cl-quiz-final-card {
  border-color: #f0c0c0;
}

.cl-quiz-score-chart {
  --score: 0;
  --score-color: #198754;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #e9edf3 0);
  border-radius: 50%;
  display: grid;
  flex: 0 0 auto;
  height: 132px;
  place-items: center;
  width: 132px;
}

.cl-quiz-final-panel--danger .cl-quiz-score-chart {
  --score-color: #dc3545;
}

.cl-quiz-score-chart__inner {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  height: 96px;
  justify-content: center;
  width: 96px;
}

.cl-quiz-score-chart__value {
  color: #1f3354;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.cl-quiz-score-chart__label,
.cl-quiz-final-card__meta {
  color: #59677a;
  font-size: 0.85rem;
}

.cl-quiz-final-card__status {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.cl-quiz-final-card__title {
  color: #14233c;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

@media (max-width: 900px) {
  .cl-quiz-layout {
    grid-template-columns: 1fr;
  }

  .cl-quiz-final-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .cl-quiz-reference {
    position: static;
    max-height: 48vh;
  }
}
