:root {
    --ink: #20242a;
    --muted: #667085;
    --line: #d8dde6;
    --panel: #ffffff;
    --soft: #f3f6f8;
    --accent: #1f5f99;
    --accent-dark: #174975;
    --accent-light: #347fbd;
}

.gestion-page {
    display: grid;
    gap: 22px;
}

.gestion-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dfe6ef;
}

.gestion-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid #d6e0eb;
    border-radius: 6px;
    background: #f8fafc;
    color: #243044;
    font-weight: 700;
}

.gestion-nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.gestion-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.gestion-stat {
    min-height: 92px;
    padding: 18px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.gestion-stat strong {
    display: block;
    color: #0b203d;
    font-size: 26px;
    line-height: 1;
}

.gestion-stat span {
    display: block;
    margin-top: 8px;
    color: #52627a;
}

.gestion-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.gestion-action-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gestion-action {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 20px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    color: #15233a;
}

.gestion-action:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 28px rgba(28, 47, 76, 0.1);
}

.gestion-action span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.gestion-action strong {
    font-size: 20px;
    line-height: 1.15;
}

.gestion-action small {
    color: #5c6b82;
    font-size: 14px;
    line-height: 1.45;
}

.gestion-panel {
    padding: 22px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.gestion-panel.is-loading {
    opacity: 0.62;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.gestion-panel h2 {
    margin: 0 0 16px;
    color: #12213a;
    font-size: 20px;
}

.gestion-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.gestion-section-head h2 {
    margin: 0;
}

.gestion-section-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.gestion-section-head > div > span {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

#topics-board {
    padding: 18px 22px;
}

.topics-board-head {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: flex-end;
    gap: 12px 18px;
    margin-bottom: 14px;
}

.topics-board-title {
    min-width: 150px;
    padding-bottom: 1px;
}

.topics-board-title > span {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.topics-board-title h2 {
    margin: 0;
}

.topics-board-controls {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.topics-board-controls .gestion-filter-tabs {
    align-self: end;
    flex-wrap: nowrap;
    margin: 0;
    min-height: 38px;
    box-sizing: border-box;
    padding: 3px;
}

.topics-board-controls .gestion-filter-tabs a {
    min-height: 30px;
    white-space: nowrap;
}

.topic-search-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: end;
    gap: 8px;
    min-width: 0;
}

.topic-search-form .topic-search-field {
    min-width: 0;
}

.topic-search-form input[type="search"] {
    width: 100%;
}

.topic-search-form .button.mini {
    min-height: 38px;
}

.topics-board-controls > .button {
    align-self: end;
    margin-left: 0;
    min-height: 38px;
}

.topic-order-form {
    display: none;
}

.gestion-edit-panel {
    border-color: #b7cde3;
    background: #f8fbff;
}

.gestion-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
    gap: 18px;
}

.gestion-panel-full {
    grid-column: 1 / -1;
}

.gestion-inline-form .settings-grid,
.gestion-form .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid .form-row.short {
    max-width: 160px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.color-grid label {
    display: grid;
    gap: 8px;
    color: #344054;
    font-weight: 700;
}

.color-grid input {
    width: 100%;
    min-height: 42px;
    padding: 3px;
    border: 1px solid #ced8e5;
    border-radius: 6px;
    background: #fff;
}

.gestion-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.drop-upload {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 210px;
    padding: 16px;
    border: 2px dashed #b8c6d8;
    border-radius: 8px;
    background: #f8fafc;
    color: #344054;
    cursor: pointer;
}

.drop-upload.dragging {
    border-color: var(--accent);
    background: #eef6ff;
}

.drop-upload span {
    font-weight: 800;
}

.drop-upload img {
    width: 100%;
    height: 118px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d9e2ee;
    background: #fff;
}

.drop-upload input {
    width: 100%;
}

.drop-upload small {
    color: #667085;
}

.gestion-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.gestion-filter label {
    display: grid;
    gap: 6px;
    min-width: min(100%, 320px);
    color: #344054;
    font-weight: 700;
}

.gestion-filter input,
.gestion-filter select {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #ced8e5;
    border-radius: 6px;
    background: #fff;
}

.question-toolbar {
    display: grid;
    gap: 12px;
    margin: 4px 0 14px;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.question-toolbar .question-list-filter {
    width: 100%;
}

.question-toolbar .gestion-filter {
    align-items: end;
}

.question-selection-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #dfe7f1;
}

.question-selection-actions,
.question-bulk-delete-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.question-bulk-delete-form {
    margin-left: auto;
}

.question-selection-count {
    min-width: 108px;
    color: #475467;
    font-weight: 800;
    text-align: right;
}

.question-bulk-delete-form .button:disabled,
.question-selection-toolbar .button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.question-list-filter .question-search-field {
    flex: 1 1 360px;
}

.question-list-filter .question-page-size-field {
    flex: 0 0 118px;
    min-width: 118px;
}

.gestion-filter-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 4px;
    border: 1px solid #d8e2ee;
    border-radius: 8px;
    background: #f8fafc;
}

.gestion-filter-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    color: #344054;
    font-weight: 800;
}

.gestion-filter-tabs a.active,
.gestion-filter-tabs a:hover {
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    color: #fff;
}

.gestion-table-wrap {
    overflow: visible;
    padding: 4px 0 2px;
}

.gestion-table {
    width: 100%;
    border-collapse: collapse;
    color: #17243b;
}

.gestion-table th,
.gestion-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e3e9f1;
    text-align: left;
    vertical-align: top;
}

.gestion-table th {
    color: #52627a;
    font-size: 12px;
    text-transform: uppercase;
}

.gestion-table small {
    display: block;
    margin-top: 4px;
    color: #667085;
}

.results-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.results-kpi {
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid #dbe4ef;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: #fff;
}

.results-kpi span {
    color: #52627a;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.results-kpi strong {
    color: #071d3a;
    font-size: 28px;
    line-height: 1;
}

.results-kpi small {
    color: #667085;
    font-weight: 700;
}

.results-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 14px;
}

.results-panel {
    display: grid;
    gap: 14px;
}

.results-panel-wide {
    grid-column: 1 / -1;
}

.results-bar-list {
    display: grid;
    gap: 12px;
}

.results-bar-list.compact {
    gap: 10px;
}

.results-bar-row {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.results-bar-row strong,
.results-test-row strong {
    display: block;
    color: #12213a;
    font-size: 15px;
}

.results-bar-row small,
.results-test-row small,
.results-year-column small,
.results-year-column em {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.results-bar-track {
    display: block;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.results-bar-fill {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #347fbd);
}

.results-bar-fill.alt {
    background: linear-gradient(90deg, #bf8b3f, #d6a24d);
}

.results-bar-fill.success {
    background: linear-gradient(90deg, #218653, #39a56f);
}

.results-year-chart {
    display: grid;
    grid-auto-columns: minmax(80px, 1fr);
    grid-auto-flow: column;
    gap: 12px;
    align-items: end;
    min-height: 220px;
    overflow-x: auto;
    padding: 4px 4px 2px;
}

.results-year-column {
    display: grid;
    gap: 6px;
    justify-items: center;
    min-width: 82px;
    text-align: center;
}

.results-year-bar-wrap {
    display: flex;
    align-items: end;
    width: 100%;
    height: 150px;
    padding: 0 16px;
    border-bottom: 1px solid #dbe4ef;
    box-sizing: border-box;
}

.results-year-bar {
    display: block;
    width: 100%;
    min-height: 6px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #347fbd, var(--accent));
}

.results-year-column strong {
    color: #12213a;
    font-size: 14px;
}

.results-test-list {
    display: grid;
    gap: 8px;
}

.results-test-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 18px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e2e9f2;
    border-radius: 8px;
    background: #f8fafc;
}

.results-test-score {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    color: #12213a;
    font-weight: 900;
}

.results-list-head {
    align-items: end;
}

.results-search-form {
    flex: 1 1 460px;
    justify-content: flex-end;
}

.results-search-field {
    flex: 1 1 320px;
}

.results-empty {
    margin: 0;
    color: #667085;
    font-weight: 700;
}

.student-toolbar .student-search-form {
    width: 100%;
}

.student-search-field {
    flex: 1 1 420px;
}

.student-management-table {
    table-layout: fixed;
}

.student-management-table th:nth-child(1),
.student-management-table td:nth-child(1) {
    width: 25%;
}

.student-management-table th:nth-child(2),
.student-management-table td:nth-child(2) {
    width: 23%;
}

.student-management-table th:nth-child(3),
.student-management-table td:nth-child(3) {
    width: 15%;
}

.student-management-table th:nth-child(4),
.student-management-table td:nth-child(4) {
    width: 105px;
}

.student-management-table th:nth-child(5),
.student-management-table td:nth-child(5) {
    width: 135px;
}

.student-management-table th:nth-child(6),
.student-management-table td:nth-child(6) {
    width: 104px;
}

.table-input {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #ced8e5;
    border-radius: 6px;
    background: #fff;
    color: #12213a;
    font: inherit;
}

.student-actions-cell {
    justify-content: flex-end;
}

.student-actions-cell .student-delete-form {
    display: inline-flex;
}

.student-info-dialog {
    width: min(920px, 100%);
}

.student-info-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.student-visit-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.85fr) minmax(240px, 0.85fr);
    gap: 18px;
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid #c7d8e8;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff, #fff);
}

.student-visit-card span {
    display: block;
}

.student-visit-card > div > span,
.student-card-school > span {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.student-visit-card strong {
    display: block;
    color: #071d3a;
    font-size: 24px;
    line-height: 1.1;
}

.student-visit-card small,
.student-visit-card address,
.student-card-school small {
    color: #52627a;
    font-style: normal;
    font-weight: 700;
}

.student-visit-card address,
.student-card-school {
    display: grid;
    gap: 5px;
    align-content: center;
}

.student-card-school strong {
    font-size: 17px;
}

.student-info-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.student-info-card > span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.student-info-card-wide {
    grid-column: 1 / -1;
}

.student-info-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.student-info-list div {
    display: grid;
    gap: 3px;
}

.student-info-list dt {
    color: #52627a;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.student-info-list dd {
    margin: 0;
    color: #12213a;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.student-info-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.muted {
    color: #667085;
}

.register-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.gestion-topic-table {
    border-collapse: separate;
    border-spacing: 0 9px;
    table-layout: fixed;
}

.gestion-topic-table th:nth-child(1),
.gestion-topic-table td:nth-child(1) {
    width: 86px;
}

.gestion-topic-table th:nth-child(2),
.gestion-topic-table td:nth-child(2) {
    width: 62px;
}

.gestion-topic-table th:nth-child(4),
.gestion-topic-table td:nth-child(4) {
    width: 56px;
}

.gestion-topic-table th:nth-child(5),
.gestion-topic-table td:nth-child(5) {
    width: 78px;
}

.gestion-topic-table th:nth-child(6),
.gestion-topic-table td:nth-child(6) {
    width: 92px;
}

.gestion-topic-table th:nth-child(7),
.gestion-topic-table td:nth-child(7) {
    width: 72px;
}

.gestion-topic-table th,
.gestion-topic-table td {
    padding: 9px 7px;
}

.gestion-topic-table thead th {
    border-bottom: 0;
    background: #edf3fa;
    color: #38506c;
    font-size: 11px;
    letter-spacing: 0;
}

.gestion-topic-table thead th:first-child {
    border-radius: 8px 0 0 8px;
}

.gestion-topic-table thead th:last-child {
    border-radius: 0 8px 8px 0;
}

.gestion-topic-table tbody td {
    border-top: 1px solid #dfe7f1;
    border-bottom: 1px solid #dfe7f1;
    background: #fff;
    vertical-align: middle;
}

.gestion-topic-table tbody td:first-child {
    border-left: 1px solid #dfe7f1;
    border-radius: 8px 0 0 8px;
}

.gestion-topic-table tbody td:last-child {
    border-right: 1px solid #dfe7f1;
    border-radius: 0 8px 8px 0;
}

.gestion-topic-table tbody tr:hover td {
    border-color: #bfd3e8;
    background: #f8fbff;
}

.gestion-topic-table tbody tr.is-dragging td,
.gestion-test-table tbody tr.is-dragging td {
    border-color: var(--accent);
    background: #eef6ff;
    opacity: 0.72;
}

.topic-order-cell {
    white-space: nowrap;
}

.topic-order-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.topic-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #cfd9e6;
    border-radius: 6px;
    background: #f8fafc;
    color: #38506c;
    cursor: grab;
    user-select: none;
}

.topic-drag-handle:active {
    cursor: grabbing;
}

.gestion-test-table {
    border-collapse: separate;
    border-spacing: 0 9px;
    table-layout: fixed;
}

.gestion-test-table th:nth-child(1),
.gestion-test-table td:nth-child(1) {
    width: 86px;
}

.gestion-test-table th:nth-child(3),
.gestion-test-table td:nth-child(3) {
    width: 88px;
}

.gestion-test-table th:nth-child(4),
.gestion-test-table td:nth-child(4) {
    width: 98px;
}

.gestion-test-table th:nth-child(5),
.gestion-test-table td:nth-child(5) {
    width: 82px;
}

.gestion-test-table th:nth-child(5) {
    text-align: right;
}

.gestion-test-table td.gestion-actions-cell {
    justify-content: flex-end;
}

.gestion-test-table th,
.gestion-test-table td {
    padding: 9px 7px;
}

.gestion-test-table thead th {
    border-bottom: 0;
    background: #edf3fa;
    color: #38506c;
    font-size: 11px;
    letter-spacing: 0;
}

.gestion-test-table thead th:first-child {
    border-radius: 8px 0 0 8px;
}

.gestion-test-table thead th:last-child {
    border-radius: 0 8px 8px 0;
}

.gestion-test-table tbody td {
    border-top: 1px solid #dfe7f1;
    border-bottom: 1px solid #dfe7f1;
    background: #fff;
    vertical-align: middle;
}

.gestion-test-table tbody td:first-child {
    border-left: 1px solid #dfe7f1;
    border-radius: 8px 0 0 8px;
}

.gestion-test-table tbody td:last-child {
    border-right: 1px solid #dfe7f1;
    border-radius: 0 8px 8px 0;
}

.gestion-test-table tbody tr:hover td {
    border-color: #bfd3e8;
    background: #f8fbff;
}

.gestion-empty-cell {
    padding: 26px 10px;
    color: #667085;
    text-align: center;
}

.gestion-topic-title {
    min-width: 0;
}

.gestion-topic-title strong {
    display: block;
    color: #10223b;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.topic-order-badge,
.topic-number-badge,
.gestion-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    font-weight: 800;
}

.topic-order-badge {
    background: #e8f2fb;
    color: #1f5f99;
}

.topic-number-badge {
    background: #f4f7fb;
    color: #344054;
}

.gestion-count-pill {
    background: #f0f7ff;
    color: #174975;
}

.gestion-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.gestion-status.published {
    background: #edf8f0;
    color: #1f7a43;
}

.gestion-status.private {
    background: #eef2f7;
    color: #52627a;
}

.gestion-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    overflow: visible;
}

.gestion-actions-cell form {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
}

.disabled-action {
    opacity: 0.45;
    cursor: not-allowed;
}

.tooltip-action {
    position: relative;
}

.tooltip-action::before,
.tooltip-action::after {
    position: absolute;
    left: 50%;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.tooltip-action::before {
    content: "";
    top: calc(100% + 4px);
    width: 9px;
    height: 9px;
    background: #10223b;
    transform: translate(-50%, -2px) rotate(45deg);
}

.tooltip-action::after {
    content: attr(data-tooltip);
    top: calc(100% + 8px);
    min-width: max-content;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    background: linear-gradient(135deg, #10223b, #1f6faa);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 12px 26px rgba(16, 34, 59, 0.28);
    transform: translate(-50%, -2px);
}

.tooltip-action:hover::before,
.tooltip-action:hover::after,
.tooltip-action:focus-visible::before,
.tooltip-action:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0) rotate(45deg);
}

.tooltip-action:hover::after,
.tooltip-action:focus-visible::after {
    transform: translate(-50%, 0);
}

.button.mini {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.button.icon-only,
.button.mini.icon-only {
    width: 32px;
    min-width: 32px;
    padding: 0;
}

.button.mini.icon-only {
    width: 26px;
    min-width: 26px;
}

.button.ghost {
    border-color: #cbd6e3;
    background: #f8fafc;
    color: #243044;
    box-shadow: none;
}

.button.ghost:hover {
    background: #eef3f9;
    color: #17243b;
    box-shadow: none;
}

.button.danger {
    border-color: #174975;
    background: linear-gradient(180deg, var(--accent-light), var(--accent-dark));
}

.gestion-answer-edit-grid,
.gestion-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.topic-detail-panel {
    padding: 20px 22px;
}

.topic-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e9f2;
}

.topic-detail-title > span {
    display: block;
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.topic-detail-head h1 {
    margin: 0;
    color: #071d3a;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.08;
}

.topic-detail-head p {
    max-width: 620px;
    margin: 8px 0 0;
    color: #52627a;
}

.topic-detail-head .topic-detail-context {
    margin-top: 10px;
    color: #243044;
    font-weight: 800;
}

.topic-detail-head .topic-detail-description {
    margin-top: 4px;
}

.topic-detail-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.topic-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding-top: 16px;
}

.topic-editor-form {
    min-width: 0;
}

.topic-form-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(120px, 160px) auto;
    gap: 14px;
    align-items: end;
}

.topic-form-grid .check-row,
.topic-form-grid .switch-row {
    min-height: 38px;
    margin: 0;
    align-self: end;
}

.topic-form-grid .button {
    align-self: end;
}

.topic-detail-actions .topic-header-publish-switch {
    align-self: center;
    margin: 0;
    white-space: nowrap;
}

.topic-summary-strip {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.topic-summary-strip span {
    display: grid;
    gap: 2px;
    min-width: 104px;
    padding: 9px 12px;
    border-left: 3px solid var(--accent);
    background: #f8fafc;
}

.topic-summary-strip strong {
    color: #071d3a;
    font-size: 22px;
    line-height: 1;
}

.topic-summary-strip small {
    color: #52627a;
    font-weight: 800;
}

.test-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 18px;
    align-items: start;
}

.test-settings-form {
    min-width: 0;
}

.test-options-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.test-options-panel > strong {
    color: #12213a;
}

.test-detail-body {
    display: block;
    padding-top: 14px;
}

.test-detail-panel .topic-detail-head {
    align-items: center;
    padding-bottom: 14px;
}

.test-detail-panel .topic-detail-title {
    min-width: 0;
}

.test-detail-panel .topic-detail-actions {
    padding: 8px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.test-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.test-detail-toolbar .test-tool-group {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.test-detail-toolbar .test-tool-label {
    flex: 0 0 auto;
    margin-right: auto;
}

.test-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 154px;
    gap: 18px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fbfdff;
}

.test-editor-form {
    min-width: 0;
}

.test-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: end;
}

.test-form-grid .form-row {
    margin: 0;
}

.test-topic-field,
.test-title-field {
    min-width: 0;
}

.test-title-field,
.test-topic-field {
    grid-column: 1;
}

.test-detail-summary {
    display: grid;
    gap: 12px;
    align-content: stretch;
}

.test-publish-switch {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
    min-height: 38px;
    margin: 0;
    white-space: nowrap;
}

.topic-detail-actions .test-header-publish-switch {
    align-self: center;
    justify-self: auto;
    margin: 0;
}

.test-save-button {
    align-self: end;
    justify-self: stretch;
    width: 100%;
    min-height: 38px;
}

.test-question-count {
    display: grid;
    align-content: center;
    justify-items: start;
    min-width: 0;
    min-height: 86px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    background: #f7fafd;
}

.test-question-count strong {
    color: #071d3a;
    font-size: 24px;
    line-height: 1;
}

.test-question-count span {
    margin-top: 3px;
    color: #52627a;
    font-size: 13px;
    font-weight: 800;
}

.test-tool-strip {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e9f2;
}

.test-tool-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.test-tool-label {
    flex-basis: 100%;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.test-tool-button {
    width: auto;
    min-width: 0;
    gap: 6px;
}

.test-import-open {
    flex: 1 1 240px;
    justify-content: flex-start;
    width: auto;
    max-width: 260px;
}

.question-toolbar-tools {
    justify-self: end;
    margin: 0;
    padding: 0;
    border-top: 0;
    gap: 10px;
}

.question-toolbar-tools .test-import-open {
    flex: 0 0 auto;
    max-width: none;
}

.question-toolbar-tools .test-tool-group {
    align-items: center;
}

.question-toolbar-tools .test-tool-label {
    flex: 0 0 auto;
    align-self: center;
    margin-right: 2px;
}

.topic-editor-summary {
    align-self: stretch;
}

.topic-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.topic-summary-grid span {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    color: #52627a;
    font-weight: 700;
}

.topic-summary-grid strong {
    color: #071d3a;
    font-size: 21px;
}

.gestion-filter.compact {
    display: grid;
    gap: 10px;
}

.gestion-filter.compact label {
    min-width: 0;
}

.gestion-list-summary {
    margin: 10px 0 14px;
    color: #667085;
    font-weight: 700;
}

.gestion-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.gestion-pagination a,
.gestion-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #d8e2ee;
    border-radius: 6px;
    background: #fff;
    color: #344054;
    font-weight: 800;
}

.gestion-pagination .active,
.gestion-pagination a:hover {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    color: #fff;
}

.gestion-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 14px 0;
}

.gestion-radio-row span {
    font-weight: 800;
}

.gestion-question-modal {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    max-height: calc(100vh - 24px);
    overflow: hidden;
    padding: 0;
}

.gestion-question-modal .gestion-modal-head {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 18px;
    border-bottom: 1px solid #dbe4ef;
    background: #f8fafc;
}

.gestion-modal-head p {
    margin: 5px 0 0;
    color: #52627a;
    font-size: 14px;
    font-weight: 700;
}

.gestion-question-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.question-editor-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: 1 1 auto;
    gap: 8px;
    min-height: 0;
    overflow: auto;
    padding: 10px 18px;
    background: #f3f6f9;
}

.question-editor-main,
.question-editor-side {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
}

.question-editor-main {
    width: min(1040px, 100%);
    margin: 0 auto;
}

.question-editor-section {
    display: grid;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.question-editor-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e8eef6;
}

.question-editor-section-head span {
    color: #1f5f99;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.question-editor-section-head strong {
    color: #52627a;
    font-size: 12px;
    text-transform: uppercase;
}

.gestion-question-modal .question-editor-field {
    margin: 0;
}

.question-editor-field label,
.question-answer-content > label {
    color: #12213a;
    font-size: 13px;
    font-weight: 800;
}

.question-editor-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
    padding: 7px 9px;
    border: 1px solid #cbd6e3;
    border-radius: 6px;
    background: #fff;
    resize: none;
    font: inherit;
    line-height: 1.3;
}

.question-editor-textarea:focus,
.question-editor-field input:focus {
    border-color: #8fb9dc;
    outline: 3px solid rgba(52, 127, 189, 0.16);
}

.question-editor-field input,
.question-editor-field textarea,
.question-answer-content textarea {
    width: 100%;
    box-sizing: border-box;
}

.gestion-question-modal .question-editor-field textarea,
.gestion-question-modal .question-answer-content textarea {
    min-height: 0;
    resize: none;
}

.question-editor-prompt-textarea {
    height: 56px !important;
    color: #16253a;
    font-size: 15px;
    font-weight: 700;
}

.question-editor-help-textarea {
    height: 36px !important;
    overflow: hidden;
}

.question-meta-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.question-answer-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}

.question-answer-card {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #243044;
}

.question-answer-card:has(.question-answer-correct input:checked) {
    border-color: #86c69a;
    background: #edf8f0;
    box-shadow: none;
}

.question-answer-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e9eef5;
    color: #475467;
    font-weight: 900;
}

.question-answer-card:has(.question-answer-correct input:checked) .question-answer-number {
    background: #1f8a4c;
    color: #fff;
}

.question-answer-content {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-width: 0;
}

.question-answer-content > label {
    padding-top: 7px;
}

.question-answer-content textarea {
    height: 36px !important;
    resize: none;
}

.question-answer-correct {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid #cbd6e3;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.question-answer-correct input {
    width: auto;
    min-height: 0;
    margin: 0;
    accent-color: var(--accent);
}

.question-answer-correct:has(input:checked) {
    border-color: #86c69a;
    background: #dff3e7;
    color: #17663a;
}

.question-editor-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin: 0;
    padding: 9px 18px;
    border-top: 1px solid #dbe4ef;
    background: #fff;
}

.gestion-import-dialog {
    width: min(860px, 100%);
}

.import-question-search {
    display: grid;
    gap: 8px;
}

.import-question-search label {
    color: #344054;
    font-weight: 800;
}

.moodle-import-dialog {
    width: min(620px, 100%);
}

.moodle-import-intro {
    margin-bottom: 16px;
    color: #344054;
    line-height: 1.5;
}

.moodle-import-form {
    display: grid;
    gap: 14px;
}

.moodle-import-file {
    display: grid;
    gap: 8px;
    color: #12213a;
    font-weight: 800;
}

.moodle-import-file input {
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 9px;
    border: 1px solid #cbd6e3;
    border-radius: 6px;
    background: #f8fafc;
    color: #12213a;
}

.moodle-import-note {
    margin: 0;
    color: #52627a;
    font-size: 13px;
}

.moodle-import-note code {
    color: #174975;
    font-weight: 800;
}

.moodle-import-progress-dialog {
    width: min(520px, 100%);
}

.moodle-import-progress {
    display: flex;
    gap: 18px;
    align-items: center;
}

.moodle-import-progress span {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.moodle-import-progress h2 {
    margin: 0;
    color: #12213a;
}

.moodle-import-progress p {
    margin: 8px 0 0;
    color: #52627a;
    line-height: 1.45;
}

.moodle-import-progress-ring {
    width: 48px;
    height: 48px;
    border: 4px solid #dce8f4;
    border-top-color: var(--accent);
    border-radius: 999px;
    animation: moodle-import-spin 0.8s linear infinite;
}

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

.import-question-search-row {
    display: flex;
    gap: 8px;
}

.import-question-search-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.import-question-results {
    display: grid;
    gap: 8px;
    max-height: 360px;
    margin: 16px 0;
    overflow: auto;
    padding: 10px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.import-question-results p {
    margin: 0;
    color: #667085;
    font-weight: 700;
}

.import-question-result {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9e3ef;
    border-radius: 7px;
    background: #fff;
    color: #10223b;
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.import-question-result:hover,
.import-question-result:focus-visible {
    border-color: #8fb9dc;
    background: #f0f7ff;
    outline: none;
}

.import-question-result.is-selected {
    border-color: var(--accent);
    background: #e8f2fb;
    box-shadow: inset 3px 0 0 var(--accent);
}

.gestion-question-accordion {
    display: grid;
    gap: 8px;
}

.gestion-question-panel {
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    background: #fff;
    overflow: visible;
}

.gestion-question-panel[open] {
    border-color: #bfd3e8;
    box-shadow: 0 12px 28px rgba(22, 69, 112, 0.08);
}

.gestion-question-panel.is-dragging {
    border-color: var(--accent);
    background: #eef6ff;
    opacity: 0.72;
}

.gestion-question-panel summary {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.gestion-question-panel summary::-webkit-details-marker {
    display: none;
}

.question-order-content {
    width: 100%;
}

.question-selection-check {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 26px;
}

#questions-board.is-selecting .question-selection-check {
    display: inline-flex;
}

.question-selection-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.question-panel-summary {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.question-summary-text {
    display: -webkit-box;
    overflow: hidden;
    color: #10223b;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.question-summary-text p {
    margin: 0;
}

.question-panel-summary small {
    color: #667085;
    font-weight: 700;
}

.question-panel-actions {
    justify-content: flex-end;
    min-width: 92px;
}

.question-panel-body {
    display: grid;
    gap: 12px;
    padding: 0 14px 14px 118px;
}

.gestion-question-preview {
    color: #111827;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.gestion-answer-preview {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 24px;
}

.gestion-answer-preview li {
    padding: 8px 10px;
    border: 1px solid #dce5ef;
    border-radius: 6px;
    background: #fff;
}

.gestion-answer-preview li.correct {
    border-color: #86c994;
    background: #effaf1;
}

.gestion-answer-preview li.wrong {
    border-color: #f1a5a5;
    background: #fff1f1;
}

.gestion-note {
    padding: 10px 12px;
    border-left: 4px solid var(--accent);
    background: #f6f9fd;
    color: #4b5565;
}

.gestion-modal[hidden] {
    display: none;
}

.gestion-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.gestion-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 28, 46, 0.48);
}

.gestion-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 20px;
    border: 1px solid #d7e1ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(15, 28, 46, 0.28);
}

.gestion-modal-dialog.gestion-question-modal {
    width: min(1180px, calc(100vw - 48px));
    max-width: 1180px;
    overflow: hidden;
    padding: 0;
}

.gestion-confirm-dialog {
    width: min(500px, 100%);
}

.gestion-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.gestion-modal-head span {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.gestion-modal-head h2 {
    margin: 0;
    color: #12213a;
}

.gestion-modal-form {
    margin: 0;
}

.gestion-delete-impact {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #d8e2ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #344054;
}

.gestion-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .gestion-stat-grid,
    .gestion-action-grid,
    .gestion-action-grid.compact,
    .gestion-form-grid,
    .gestion-upload-grid,
    .gestion-answer-edit-grid,
    .topic-detail-body,
    .topic-form-grid,
    .test-editor-grid,
    .test-form-grid,
    .test-editor-layout,
    .question-editor-body,
    .results-dashboard-grid,
    .gestion-two-columns {
        grid-template-columns: 1fr;
    }

    .results-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .results-test-row {
        grid-template-columns: 1fr;
    }

    .test-form-actions,
    .test-publish-switch,
    .test-save-button {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
        justify-self: start;
        min-width: 0;
    }

    .gestion-inline-form .settings-grid,
    .gestion-form .settings-grid {
        grid-template-columns: 1fr;
    }

    .gestion-modal-dialog.gestion-question-modal {
        width: min(760px, calc(100vw - 28px));
        max-height: calc(100vh - 28px);
    }

    .question-editor-body {
        max-height: calc(100vh - 182px);
        padding: 14px;
    }

    .question-editor-main {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .gestion-modal {
        padding: 12px;
    }

    .question-answer-list {
        grid-template-columns: 1fr;
    }

    .results-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .results-bar-row,
    .results-test-score,
    .student-info-body,
    .student-visit-card {
        grid-template-columns: 1fr;
    }

    .student-info-list.compact {
        grid-template-columns: 1fr;
    }

    .results-list-head {
        display: grid;
        align-items: stretch;
    }

    .results-search-form {
        justify-content: flex-start;
    }

    .question-editor-actions {
        justify-content: flex-start;
    }

    .question-answer-card {
        grid-template-columns: 30px minmax(0, 1fr);
        padding: 10px;
    }

    .question-answer-content {
        grid-template-columns: 1fr;
    }

    .question-meta-grid {
        grid-template-columns: 1fr;
    }

    .question-answer-content > label {
        padding-top: 0;
    }

    .question-answer-correct {
        grid-column: 2;
        justify-self: start;
    }

    .question-answer-number {
        width: 30px;
        height: 30px;
    }

    .gestion-question-modal .gestion-modal-head,
    .question-editor-actions {
        padding: 14px;
    }

    .topic-summary-grid {
        grid-template-columns: 1fr;
    }

    .topic-detail-head {
        display: grid;
    }

    .topic-detail-actions {
        justify-content: flex-start;
    }

    .topic-summary-strip {
        flex-wrap: wrap;
    }

    .topics-board-head {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .topics-board-title {
        min-width: 0;
    }

    .topics-board-controls {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .topic-search-form {
        grid-template-columns: 1fr;
    }

    .topics-board-controls .gestion-filter-tabs {
        justify-self: start;
        flex-wrap: wrap;
    }

    .topics-board-controls > .button {
        justify-self: start;
    }

    .gestion-topic-table,
    .gestion-test-table,
    .gestion-topic-table thead,
    .gestion-test-table thead,
    .gestion-topic-table tbody,
    .gestion-test-table tbody,
    .gestion-topic-table tr,
    .gestion-test-table tr,
    .gestion-topic-table th,
    .gestion-test-table th,
    .gestion-topic-table td,
    .gestion-test-table td {
        display: block;
        width: 100% !important;
    }

    .gestion-topic-table,
    .gestion-test-table {
        border-spacing: 0;
    }

    .gestion-topic-table thead,
    .gestion-test-table thead {
        position: absolute;
        width: 1px !important;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .gestion-topic-table tbody,
    .gestion-test-table tbody {
        display: grid;
        gap: 12px;
    }

    .gestion-topic-table tbody tr,
    .gestion-test-table tbody tr {
        display: grid;
        gap: 8px;
        padding: 14px;
        border: 1px solid #dfe7f1;
        border-radius: 8px;
        background: #fff;
    }

    .gestion-topic-table tbody td,
    .gestion-topic-table tbody td:first-child,
    .gestion-topic-table tbody td:last-child,
    .gestion-test-table tbody td,
    .gestion-test-table tbody td:first-child,
    .gestion-test-table tbody td:last-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .gestion-topic-table tbody tr:hover td,
    .gestion-test-table tbody tr:hover td {
        background: transparent;
    }

    .gestion-topic-table tbody td::before,
    .gestion-test-table tbody td::before {
        content: attr(data-label);
        color: #667085;
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .gestion-topic-title {
        align-items: flex-start !important;
    }

    .gestion-topic-title::before {
        margin-bottom: 2px;
    }

    .gestion-actions-cell {
        justify-content: flex-end !important;
    }

    .gestion-actions-cell::before {
        margin-right: auto;
    }

    .gestion-question-panel summary {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .question-order-content {
        grid-column: 1 / -1;
    }

    .question-panel-body {
        padding-left: 14px;
    }

    .test-import-open {
        flex-basis: 100%;
        max-width: none;
    }

    .import-question-search-row {
        display: grid;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--soft);
}

a {
    color: var(--accent);
    text-decoration: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.brand {
    font-weight: 700;
    color: var(--ink);
}

.topbar nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.topbar-user {
    color: var(--muted);
    font-size: 14px;
}

.topbar-user strong {
    color: var(--ink);
}

.page {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1,
.book-hero h1,
.auth-panel h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.15;
}

.page-header p,
.book-hero p,
.auth-panel p {
    margin: 0 0 12px;
    color: var(--muted);
}

.home-page {
    --uclm-red: #971b2f;
    --uclm-red-dark: #681321;
    --uclm-gold: #bf8b3f;
    --uclm-blue: #14395f;
    background: #eef2f6;
}

.home-page .page {
    max-width: 1220px;
    padding-top: 24px;
}

.home-hero {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 24px;
    background: #0b1d33;
    color: #fff;
}

.home-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 19, 36, 0.9) 0%, rgba(7, 19, 36, 0.72) 42%, rgba(7, 19, 36, 0.24) 100%),
        linear-gradient(0deg, rgba(7, 19, 36, 0.78) 0%, rgba(7, 19, 36, 0) 52%);
}

.home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    padding: 72px 54px 150px;
}

.home-eyebrow,
.home-section-head > div > span,
.home-research-list article > span,
.home-book-kicker,
.home-user-chip span {
    color: var(--uclm-red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-hero .home-eyebrow {
    color: #f2d08a;
}

.home-hero h1 {
    margin: 10px 0 12px;
    color: #fff;
    font-size: 72px;
    line-height: 0.96;
}

.home-lead {
    max-width: 700px;
    margin: 0;
    color: #eef4fb;
    font-size: 22px;
    line-height: 1.45;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.home-hero .button.ghost {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.home-hero-facts {
    position: absolute;
    z-index: 1;
    left: 28px;
    right: 28px;
    bottom: 24px;
    display: grid;
    grid-template-columns: 0.7fr 0.55fr 1.1fr 0.95fr;
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.home-hero-facts div {
    min-height: 92px;
    padding: 18px 20px;
    background: rgba(4, 16, 29, 0.48);
}

.home-hero-facts span {
    display: block;
    margin-bottom: 6px;
    color: #cbd7e5;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.home-hero-facts strong {
    display: block;
    color: #fff;
    font-size: 20px;
    line-height: 1.15;
}

.home-overview,
.home-platform-band {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
    padding: 30px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.home-overview-main h2,
.home-platform-copy h2 {
    margin: 7px 0 12px;
    color: #071d3a;
    font-size: 34px;
    line-height: 1.12;
}

.home-overview-main p,
.home-platform-copy p {
    margin: 0;
    color: #42536b;
    font-size: 17px;
    line-height: 1.58;
}

.home-overview-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home-overview-stats div {
    min-height: 112px;
    padding: 18px;
    border-left: 4px solid var(--uclm-red);
    background: #f7fafc;
}

.home-overview-stats strong {
    display: block;
    color: #071d3a;
    font-size: 34px;
    line-height: 1;
}

.home-overview-stats span {
    display: block;
    margin-top: 9px;
    color: #52627a;
    font-weight: 800;
}

.home-research-band {
    margin-bottom: 28px;
}

.home-section-head.compact {
    margin-bottom: 16px;
}

.home-research-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.home-research-list article {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 16px;
    min-height: 178px;
    padding: 22px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.home-research-list article > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #f4e8eb;
}

.home-research-list h3 {
    margin: 0 0 9px;
    color: #071d3a;
    font-size: 22px;
    line-height: 1.15;
}

.home-research-list p {
    margin: 0;
    color: #52627a;
    line-height: 1.5;
}

.home-platform-band {
    background: #132d4d;
    border-color: #132d4d;
}

.home-platform-band .home-eyebrow {
    color: #f2d08a;
}

.home-platform-copy h2,
.home-platform-copy p {
    color: #fff;
}

.home-platform-copy p {
    color: #dbe6f2;
}

.home-platform-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home-platform-steps div {
    min-height: 96px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.home-platform-steps strong {
    display: block;
    color: #f2d08a;
    font-size: 28px;
    line-height: 1;
}

.home-platform-steps span {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-weight: 800;
}

.home-books-section {
    display: grid;
    gap: 16px;
}

.home-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    padding: 4px 0 10px;
    border-bottom: 1px solid #dbe4ef;
}

.home-section-head h2 {
    margin: 5px 0 4px;
    color: #071d3a;
    font-size: 32px;
    line-height: 1.12;
}

.home-section-head p {
    margin: 0;
    color: #52627a;
}

.home-user-chip {
    min-width: 230px;
    padding: 12px 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.home-user-chip strong {
    display: block;
    margin-top: 4px;
    color: #071d3a;
}

.home-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.home-book-card {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 18px;
    min-height: 255px;
    padding: 18px;
    border: 1px solid #dbe4ef;
    border-left: 4px solid var(--book-accent, var(--uclm-gold));
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(14, 30, 52, 0.06);
}

.home-book-cover {
    display: grid;
    place-items: center;
    align-self: start;
    width: 130px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid #cfd9e6;
    border-radius: 6px;
    background: linear-gradient(145deg, #15233a, var(--book-color, #1f5f99));
    color: #fff;
    font-size: 44px;
    font-weight: 900;
}

.home-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-book-main {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
}

.home-book-main h3 {
    margin: 0;
    color: #071d3a;
    font-size: 23px;
    line-height: 1.16;
}

.home-book-main h3 a {
    color: inherit;
}

.home-book-main p {
    margin: 0;
    color: #52627a;
    line-height: 1.45;
}

.home-book-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 6px 0 4px;
}

.home-book-stats div {
    padding: 10px;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    background: #f8fafc;
}

.home-book-stats dt {
    color: #52627a;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.home-book-stats dd {
    margin: 3px 0 0;
    color: #071d3a;
    font-size: 21px;
    font-weight: 900;
}

.home-book-main .button {
    justify-self: start;
    margin-top: 4px;
}

.home-empty {
    padding: 26px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.home-empty h3 {
    margin: 0 0 8px;
    color: #071d3a;
}

.home-empty p {
    margin: 0;
    color: #52627a;
}

.notice {
    padding: 12px 14px;
    margin-bottom: 22px;
    border: 1px solid #f1c27d;
    background: #fff7e6;
}

.notice.success {
    border-color: #88c79a;
    background: #edf8f0;
}

.notice.error {
    border-color: #d78989;
    background: #fff0f0;
}

.toast-region {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 4000;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 36px));
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 13px 14px;
    border: 1px solid #cbd6e3;
    border-left-width: 4px;
    border-radius: 8px;
    background: #fff;
    color: #12213a;
    box-shadow: 0 18px 40px rgba(15, 28, 46, 0.18);
    pointer-events: auto;
    animation: toast-in 0.18s ease-out;
}

.toast.success {
    border-left-color: #1f8a4c;
}

.toast.error {
    border-left-color: #c24141;
}

.toast span {
    line-height: 1.4;
    font-weight: 700;
}

.toast button {
    width: 26px;
    height: 26px;
    border: 1px solid #cbd6e3;
    border-radius: 6px;
    background: #f8fafc;
    color: #344054;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-action {
    margin: 0 0 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-action p {
    margin: 10px 0 0;
    color: var(--muted);
}

.admin-panel {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.admin-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-section-head h2 {
    margin: 4px 0 0;
    color: #071d3a;
}

.admin-section-head span,
.gestion-modal-dialog header span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-book-list {
    display: grid;
    gap: 10px;
}

.admin-book-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(340px, 0.9fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.admin-book-row h3 {
    margin: 8px 0 2px;
    color: #071d3a;
}

.admin-book-row p,
.admin-book-row small,
.muted {
    margin: 0;
    color: #52627a;
}

.admin-book-row dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.admin-book-row dl div {
    padding: 9px;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    background: #fff;
}

.admin-book-row dt {
    color: #52627a;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-book-row dd {
    margin: 3px 0 0;
    color: #071d3a;
    font-size: 19px;
    font-weight: 900;
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.admin-book-form .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-book-form .form-row.full {
    grid-column: 1 / -1;
}

.admin-book-editor .gestion-form {
    display: grid;
    gap: 18px;
}

.admin-switch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 8px;
}

.admin-switch-grid .switch-row {
    margin-bottom: 0;
}

.admin-role-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px auto;
    gap: 12px;
    align-items: end;
}

.admin-role-form label,
.admin-search label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 800;
}

.admin-role-form input,
.admin-role-form select,
.admin-search input,
.admin-book-form input,
.admin-book-form textarea {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #ced8e5;
    border-radius: 6px;
    background: #fff;
}

.admin-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-role-list {
    display: grid;
    gap: 8px;
}

.admin-role-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.admin-role-user strong,
.admin-role-user span {
    display: block;
}

.admin-role-user span {
    color: #52627a;
    font-size: 13px;
}

.admin-users-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

#admin-users-board .admin-section-head > div:first-child {
    flex: 0 0 250px;
}

.admin-users-head-actions .admin-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    gap: 10px;
    align-items: end;
    flex: 1 1 620px;
}

.admin-users-head-actions .admin-search.admin-search-with-add {
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    flex-basis: 760px;
}

.admin-users-head-actions .admin-search label:first-child {
    min-width: 0;
}

.admin-users-head-actions .admin-search input[type="search"] {
    width: 100%;
    min-width: 0;
}

.admin-add-button {
    min-width: 205px;
}

.admin-section-head .admin-add-button,
.admin-section-head .admin-add-button .button-icon,
.admin-section-head .admin-add-button span {
    color: #fff;
}

.admin-search .admin-filter-check {
    display: inline-flex;
    align-items: center;
    align-self: end;
    gap: 8px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    background: #f8fafc;
    color: #344054;
    font-weight: 800;
    white-space: nowrap;
}

.admin-search .admin-filter-check input {
    min-width: 0;
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.admin-user-selection-toolbar {
    margin: 12px 0 14px;
}

.admin-user-select-col {
    width: 46px;
    text-align: center;
}

.admin-user-selection-check {
    display: none;
    align-items: center;
    justify-content: center;
}

#admin-users-board.is-selecting .admin-user-selection-check {
    display: inline-flex;
}

.admin-user-selection-check input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.admin-users-table tr.is-selected td {
    background: #eef6ff;
}

.admin-users-table td:nth-child(3),
.admin-users-table td:nth-child(4) {
    max-width: 280px;
}

.admin-users-table th:last-child,
.admin-users-table td:last-child {
    text-align: right;
}

.admin-user-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
}

.admin-add-admin-modal {
    width: min(720px, calc(100vw - 48px));
}

.admin-add-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.admin-add-search label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 800;
}

.admin-add-search input {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #ced8e5;
    border-radius: 6px;
}

.admin-candidate-results {
    display: grid;
    gap: 8px;
}

.admin-candidate-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.admin-candidate-row strong,
.admin-candidate-row span,
.admin-candidate-row small {
    display: block;
}

.admin-candidate-row span,
.admin-candidate-row small {
    margin-top: 3px;
    color: #52627a;
    font-size: 13px;
}

.admin-candidate-row .button,
.admin-candidate-row .button .button-icon,
.admin-candidate-row .button span {
    color: #fff;
}

.admin-user-edit-modal {
    width: min(1060px, calc(100vw - 48px));
}

.admin-user-edit-form {
    display: grid;
    gap: 14px;
}

.admin-user-edit-section {
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
}

.admin-user-edit-section h3 {
    margin: 0 0 12px;
    color: #0b213d;
    font-size: 16px;
}

.admin-user-edit-section .muted {
    margin-top: -4px;
}

.admin-user-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-user-edit-grid label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-weight: 800;
}

.admin-user-edit-grid label.wide {
    grid-column: span 2;
}

.admin-user-edit-grid input {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #ced8e5;
    border-radius: 6px;
    background: #fff;
}

.admin-user-edit-grid input[readonly] {
    background: #eef3f8;
    color: #52627a;
}

.admin-user-edit-grid .switch-row {
    display: inline-flex;
    margin: 0;
    align-self: center;
}

.legal-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid #dbe4ef;
    background: #0b213d;
    color: #dbe7f4;
}

.legal-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 18px 0;
}

.legal-footer strong,
.legal-footer span {
    display: block;
}

.legal-footer strong {
    color: #fff;
    font-size: 16px;
}

.legal-footer span {
    margin-top: 3px;
    color: #b9c7d8;
    font-size: 13px;
}

.legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
}

.legal-footer a {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.legal-footer a:hover {
    color: #e1b369;
}

.error-page {
    display: grid;
    min-height: 52vh;
    place-items: center;
    padding: 32px 16px;
}

.error-panel {
    width: min(620px, 100%);
    padding: 30px;
    border: 1px solid #d8e2ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 28, 46, 0.12);
}

.error-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.error-panel h1 {
    margin: 8px 0 10px;
    color: #071d3a;
    font-size: 34px;
    line-height: 1.12;
}

.error-panel p {
    margin: 0 0 16px;
    color: #52627a;
    font-size: 16px;
    line-height: 1.55;
}

.error-reference {
    padding: 10px 12px;
    border: 1px solid #dbe4ef;
    border-radius: 6px;
    background: #f8fafc;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.legal-page {
    display: grid;
    gap: 16px;
    max-width: 980px;
    margin: 0 auto;
}

.legal-kicker {
    color: #bf8b3f;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.legal-page h1 {
    margin: 0;
    color: #0b213d;
    font-size: clamp(32px, 5vw, 48px);
}

.legal-lead {
    max-width: 780px;
    margin: 0 0 8px;
    color: #42526b;
    font-size: 18px;
    line-height: 1.5;
}

.legal-card,
.legal-source-box {
    padding: 20px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
}

.legal-card h2 {
    margin: 0 0 10px;
    color: #0b213d;
    font-size: 22px;
}

.legal-card p {
    margin: 0 0 10px;
    color: #344054;
    line-height: 1.55;
}

.legal-card p:last-child {
    margin-bottom: 0;
}

.legal-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    color: #344054;
    line-height: 1.5;
}

.legal-definition-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.legal-definition-list div {
    display: grid;
    grid-template-columns: minmax(160px, 0.34fr) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #e4ebf3;
}

.legal-definition-list dt {
    color: #52627a;
    font-weight: 900;
}

.legal-definition-list dd {
    margin: 0;
    color: #18243a;
}

.legal-source-box {
    border-color: #c9d9ea;
    background: #f8fbff;
}

.legal-source-box strong,
.legal-source-box a {
    color: #0b5792;
    font-weight: 900;
}

.legal-source-box p {
    margin: 6px 0 10px;
    color: #344054;
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.legal-table-wrap {
    overflow-x: auto;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
}

.legal-table th,
.legal-table td {
    padding: 12px;
    border-bottom: 1px solid #e4ebf3;
    text-align: left;
    vertical-align: top;
}

.legal-table th {
    background: #eef4fa;
    color: #0b213d;
    font-size: 13px;
    text-transform: uppercase;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: #52627a;
    font-weight: 800;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.book-card,
.auth-panel,
.book-hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
}

.book-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
}

.book-cover {
    display: grid;
    place-items: center;
    width: 92px;
    aspect-ratio: 3 / 4;
    background: linear-gradient(145deg, #29323c, var(--accent));
    color: #fff;
    border-radius: 4px;
    font-size: 42px;
    font-weight: 700;
}

.book-cover.large {
    width: min(190px, 35vw);
    font-size: 76px;
}

.book-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.book-card dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    margin: 12px 0 16px;
    color: var(--muted);
}

.book-card dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
}

.book-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 26px;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid rgba(15, 57, 93, 0.22);
    border-radius: 6px;
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    color: #fff;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(31, 95, 153, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.button-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.icon-plus {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

.icon-edit {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}

.icon-list {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13'/%3E%3Cpath d='M8 12h13'/%3E%3Cpath d='M8 18h13'/%3E%3Cpath d='M3 6h.01'/%3E%3Cpath d='M3 12h.01'/%3E%3Cpath d='M3 18h.01'/%3E%3C/svg%3E");
}

.icon-grip {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 5h.01'/%3E%3Cpath d='M15 5h.01'/%3E%3Cpath d='M9 12h.01'/%3E%3Cpath d='M15 12h.01'/%3E%3Cpath d='M9 19h.01'/%3E%3Cpath d='M15 19h.01'/%3E%3C/svg%3E");
}

.icon-print {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E");
}

.icon-export {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M12 18v-6'/%3E%3Cpath d='m9 15 3 3 3-3'/%3E%3C/svg%3E");
}

.icon-import {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M12 12v6'/%3E%3Cpath d='m9 15 3-3 3 3'/%3E%3C/svg%3E");
}

.icon-copy {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 8h11v13H8z'/%3E%3Cpath d='M5 16H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h11a1 1 0 0 1 1 1v1'/%3E%3C/svg%3E");
}

.icon-arrow-up {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
}

.icon-arrow-down {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.icon-trash {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E");
}

.icon-save {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2Z'/%3E%3Cpath d='M17 21v-8H7v8'/%3E%3Cpath d='M7 3v5h8'/%3E%3C/svg%3E");
}

.icon-shield {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z'/%3E%3Cpath d='m9 12 2 2 4-5'/%3E%3C/svg%3E");
}

.icon-shield-off {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 3 18 18'/%3E%3Cpath d='M10 5.25 12 4l8 3v5c0 1.5-.5 2.9-1.3 4.1'/%3E%3Cpath d='M16.5 19.1C14.4 21 12 22 12 22s-8-4-8-10V7l2.7-1'/%3E%3C/svg%3E");
}

.icon-close {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

.button:hover,
.button.secondary:hover,
.button.link-button:hover {
    background: linear-gradient(180deg, #2d76b2, var(--accent-dark));
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 95, 153, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.button:focus-visible {
    outline: 3px solid rgba(52, 127, 189, 0.26);
    outline-offset: 2px;
}

.button.secondary {
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
}

.button:active,
.button.secondary:active,
.button.link-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(31, 95, 153, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.18);
}

.button.link-button {
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    color: #fff;
}

.auth-panel {
    max-width: 440px;
}

.auth-page {
    background: #eef2f6;
}

.auth-page .page {
    max-width: 1180px;
    padding-top: 24px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    min-height: calc(100vh - 138px);
    overflow: hidden;
    border: 1px solid #d6e0eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 46px rgba(21, 38, 62, 0.13);
}

.auth-visual {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: #10213a;
    color: #fff;
}

.auth-visual-image,
.auth-visual-shade {
    position: absolute;
    inset: 0;
}

.auth-visual-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-visual-shade {
    background:
        linear-gradient(90deg, rgba(9, 23, 43, 0.9) 0%, rgba(9, 23, 43, 0.68) 56%, rgba(9, 23, 43, 0.28) 100%),
        linear-gradient(0deg, rgba(6, 17, 31, 0.82), rgba(6, 17, 31, 0.18));
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px;
}

.auth-visual-content .home-eyebrow {
    color: #f2d08a;
}

.auth-visual-content h1 {
    max-width: 560px;
    margin: 12px 0 14px;
    color: #fff;
    font-size: 48px;
    line-height: 1.02;
}

.auth-visual-content p {
    max-width: 540px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 17px;
    line-height: 1.5;
}

.auth-visual-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 34px;
}

.auth-visual-points div {
    min-height: 98px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(8, 22, 39, 0.48);
}

.auth-visual-points strong {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: 17px;
}

.auth-visual-points span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
    line-height: 1.35;
}

.auth-login-panel {
    display: flex;
    max-width: none;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 54px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-login-panel .home-eyebrow {
    margin-bottom: 10px;
}

.auth-login-panel h1 {
    font-size: 38px;
}

.auth-login-panel .form-row input {
    min-height: 44px;
    border-radius: 6px;
    background: #f8fafc;
}

.auth-login-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 18px;
}

.auth-login-options .check-row {
    margin: 0;
}

.auth-submit {
    width: 100%;
    min-height: 44px;
    font-weight: 800;
}

.auth-register-callout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #52627a;
}

.auth-register-callout span {
    font-weight: 800;
}

.auth-register-callout a,
.auth-login-options a {
    color: var(--accent);
    font-weight: 800;
}

.auth-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #dfe7f1;
}

.auth-secondary-actions a {
    color: var(--accent);
    font-weight: 800;
}

.auth-register-shell {
    grid-template-columns: minmax(300px, 0.48fr) minmax(0, 1.52fr);
    align-items: stretch;
}

.auth-register-visual {
    min-height: auto;
}

.auth-register-visual .auth-visual-content {
    justify-content: flex-start;
    padding: 44px 38px;
}

.auth-register-visual .auth-visual-content h1 {
    font-size: 42px;
}

.auth-register-points {
    grid-template-columns: 1fr;
}

.auth-register-points div {
    min-height: 86px;
}

.auth-register-panel {
    max-width: none;
    margin: 0;
    padding: 34px 38px 38px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-register-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dfe7f1;
}

.auth-register-head h1 {
    margin: 8px 0;
}

.auth-register-head p {
    max-width: 640px;
}

.auth-register-panel .register-form {
    max-width: none;
}

.auth-register-panel .register-section {
    border-radius: 8px;
}

.auth-register-panel .form-actions {
    justify-content: flex-end;
}

.auth-register-panel .form-actions .button {
    min-width: 190px;
    min-height: 42px;
}

.book-auth-panel {
    max-width: 520px;
    margin: 0;
}

.auth-links {
    display: flex;
    gap: 14px;
    margin-top: 18px;
}

.form-row {
    margin: 14px 0;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    box-sizing: border-box;
}

.form-row textarea {
    min-height: 132px;
    resize: vertical;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 4px 18px;
}

.settings-grid .check-row {
    align-self: end;
}

.settings-grid small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.register-panel {
    max-width: 920px;
}

.register-form {
    max-width: 940px;
}

.register-section {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #fff;
}

.register-section legend {
    padding: 0 8px;
    color: #16253a;
    font-size: 18px;
    font-weight: 800;
}

.register-section.institutional {
    background: #f8fafc;
}

.register-section.access {
    background: #fffaf1;
    border-color: #ead7b4;
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 2px 18px;
}

.register-grid .wide {
    grid-column: 1 / -1;
}

.register-grid .form-row {
    margin: 10px 0;
}

.register-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #243044;
}

.privacy-consent {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #f8fafc;
    color: #243044;
}

.privacy-consent p {
    margin: 0 0 8px;
    line-height: 1.45;
}

.consent-check {
    align-items: flex-start;
    margin: 12px 0 6px;
}

.consent-check input {
    width: auto;
    margin-top: 3px;
}

.privacy-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.account-warning {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid #f0b9b9;
    border-radius: 8px;
    background: #fff5f5;
    color: #7f1d1d;
    line-height: 1.45;
}

.account-warning a {
    color: #0b5f99;
    font-weight: 800;
}

.subscription-panel {
    max-width: 900px;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid #d6e1ee;
    border-radius: 8px;
    background: #ffffff;
}

.subscription-book {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}

.subscription-book img {
    width: 128px;
    max-height: 178px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 20px rgba(16, 36, 60, 0.14);
}

.subscription-book .eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.subscription-book h2 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 28px;
    line-height: 1.15;
}

.subscription-book p {
    margin: 0 0 10px;
    color: #4a5d78;
    line-height: 1.45;
}

.book-subscription-form {
    border-top: 1px solid #dfe7f0;
    padding-top: 18px;
}

.subscription-consent {
    margin-top: 0;
}

@media (max-width: 720px) {
    .register-grid {
        grid-template-columns: 1fr;
    }

    .subscription-panel {
        padding: 16px;
    }

    .subscription-book {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
    }

    .subscription-book img {
        width: 96px;
    }

    .subscription-book h2 {
        font-size: 22px;
    }
}

.check-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 12px 0 18px;
}

.switch-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 18px;
    color: #243044;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.switch-row input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.switch-control {
    position: relative;
    width: 46px;
    height: 24px;
    flex: 0 0 46px;
    border: 1px solid #cbd6e3;
    border-radius: 999px;
    background: #e8eef5;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.switch-control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 28, 46, 0.22);
    transition: transform 0.16s ease;
}

.switch-row input[type="checkbox"]:checked ~ .switch-control {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
}

.switch-row input[type="checkbox"]:checked ~ .switch-control::after {
    transform: translateX(22px);
}

.switch-row input[type="checkbox"]:focus-visible ~ .switch-control {
    outline: 3px solid rgba(52, 127, 189, 0.26);
    outline-offset: 2px;
}

.validation,
.field-validation-error {
    color: var(--accent);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.stats div {
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stats strong {
    display: block;
    font-size: 24px;
}

.stats span {
    color: var(--muted);
}

.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    background: #edf1f5;
}

@media (max-width: 640px) {
    .home-hero,
    .home-overview,
    .home-research-list,
    .home-platform-band,
    .home-book-card {
        grid-template-columns: 1fr;
    }

    .home-hero {
        min-height: 620px;
    }

    .home-hero-content {
        max-width: none;
        padding: 34px 24px 250px;
    }

    .home-hero h1 {
        font-size: 48px;
    }

    .home-lead {
        font-size: 17px;
    }

    .home-hero-facts {
        left: 14px;
        right: 14px;
        bottom: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-hero-facts div {
        min-height: 82px;
        padding: 14px;
    }

    .home-hero-facts strong {
        font-size: 16px;
    }

    .home-overview,
    .home-platform-band {
        padding: 22px;
    }

    .home-overview-main h2,
    .home-platform-copy h2 {
        font-size: 26px;
    }

    .home-research-list article {
        min-height: auto;
    }

    .home-section-head {
        display: grid;
        align-items: start;
    }

    .home-user-chip {
        min-width: 0;
    }

    .home-book-cover {
        width: 122px;
    }

    .home-book-grid {
        grid-template-columns: 1fr;
    }

    .home-book-card {
        min-height: auto;
    }

    .topbar,
    .book-hero,
    .book-card {
        display: block;
    }

    .admin-section-head,
    .admin-book-row,
    .admin-role-form,
    .admin-role-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-book-row dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-row-actions,
    .admin-search,
    .admin-users-head-actions {
        justify-content: flex-start;
    }

    .admin-add-search,
    .admin-candidate-row,
    .admin-users-head-actions .admin-search {
        grid-template-columns: 1fr;
    }

    .topbar nav {
        margin-top: 10px;
        flex-wrap: wrap;
    }

    .book-cover {
        margin-bottom: 16px;
    }
}

@media (max-width: 900px) {
    .auth-page .page {
        padding: 16px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 360px;
    }

    .auth-visual-content {
        padding: 34px;
    }

    .auth-visual-content h1 {
        font-size: 38px;
    }

    .auth-login-panel {
        padding: 34px;
    }

    .auth-register-shell {
        grid-template-columns: 1fr;
    }

    .auth-register-visual {
        min-height: 300px;
    }

    .auth-register-visual .auth-visual-content {
        padding: 34px;
    }

    .auth-register-points {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-register-panel {
        padding: 34px;
    }
}

@media (max-width: 560px) {
    .auth-page .page {
        padding: 0;
    }

    .auth-shell {
        min-height: 0;
        border-radius: 0;
    }

    .auth-visual {
        min-height: 320px;
    }

    .auth-visual-content {
        padding: 28px 22px;
    }

    .auth-visual-content h1 {
        font-size: 32px;
    }

    .auth-visual-points {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .auth-visual-points div {
        min-height: 0;
    }

    .auth-login-panel {
        padding: 28px 22px 34px;
    }

    .auth-register-visual .auth-visual-content {
        padding: 28px 22px;
    }

    .auth-register-points {
        grid-template-columns: 1fr;
    }

    .auth-register-panel {
        padding: 28px 22px 34px;
    }

    .auth-register-head {
        display: grid;
    }

    .auth-register-head .button {
        width: 100%;
    }
}

.book-entry-page {
    background: #000;
}

.book-entry-page .topbar {
    display: none;
}

.book-entry-page .page {
    max-width: 820px;
    padding: 22px 24px 40px;
}

.book-entry-shell {
    overflow: hidden;
    background: #fff;
    border: 2px solid #000;
}

.book-entry-header {
    min-height: 155px;
    background-color: #1554df;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.book-entry-title {
    display: flex;
    min-height: 155px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px;
    color: #fff;
    text-align: center;
}

.book-entry-title strong {
    font-size: 28px;
}

.book-entry-nav {
    display: flex;
    flex-wrap: wrap;
    background: #1e5cdf;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
}

.book-entry-nav a {
    display: block;
    padding: 5px 12px;
    border-right: 1px solid #fff;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.book-entry-nav a:hover {
    background: #c99444;
    color: #fff;
}

.book-entry-content {
    min-height: 368px;
    padding: 14px 20px 18px;
    background: #fff url("/Content/books/guerrasynavas/fondo-contenido.gif") no-repeat right top;
}

.book-entry-content h1 {
    margin: 0 0 18px;
    color: #263a53;
    font-size: 18px;
}

.book-entry-main {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
    align-items: start;
}

.book-entry-cover img {
    display: block;
    width: 100%;
    max-width: 250px;
    height: auto;
    border: 0;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.book-entry-side {
    min-width: 0;
}

.entry-login-form {
    display: grid;
    gap: 10px;
    max-width: 430px;
    margin-bottom: 18px;
    padding: 12px 28px;
    border: 1px solid #e2d8a7;
    background: #faf8eb;
    text-align: center;
}

.entry-field {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 8px;
    align-items: center;
    text-align: left;
}

.entry-field label {
    text-align: right;
}

.entry-field input {
    width: 100%;
    min-height: 26px;
    border: 1px solid #9aa6b2;
}

.button.wide {
    width: min(185px, 100%);
    min-height: 40px;
    justify-self: center;
    text-transform: uppercase;
}

.book-entry-copy {
    max-width: 430px;
    line-height: 1.35;
}

.book-entry-copy p {
    margin: 0 0 12px;
}

.book-entry-copy a {
    color: #263a53;
    font-weight: 700;
    text-decoration: underline;
}

.book-entry-footer {
    min-height: 20px;
    padding-top: 3px;
    background: #283953;
    color: #fff;
    text-align: center;
    font-size: 10px;
}

@media (max-width: 740px) {
    .book-entry-page .page {
        padding: 0;
    }

    .book-entry-shell {
        border: 0;
    }

    .book-entry-header {
        min-height: 120px;
    }

    .book-entry-main {
        grid-template-columns: 1fr;
    }

    .book-entry-cover img {
        max-width: 220px;
        margin: 0 auto;
    }

    .entry-login-form,
    .book-entry-copy {
        max-width: none;
    }
}

/* Entrada moderna de libro, conservando la estructura de la portada antigua. */
.book-entry-page {
    background: #eef2f6;
}

.book-entry-page .page {
    max-width: none;
    padding: 28px;
}

.book-entry-shell {
    max-width: 1180px;
    margin: 0 auto;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(25, 38, 57, 0.18);
}

.book-entry-header {
    position: relative;
    min-height: 230px;
    background-color: #1554df;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.book-entry-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(9, 26, 55, 0.18), rgba(9, 26, 55, 0.02));
    pointer-events: none;
}

.book-entry-header-badge {
    position: absolute;
    left: 24px;
    bottom: 20px;
    z-index: 1;
}

.book-entry-header-badge span {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.book-entry-nav {
    justify-content: center;
    gap: 2px;
    padding: 0 18px;
    background: #203753;
    border: 0;
}

.book-entry-nav-links {
    display: flex;
    justify-content: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 2px;
}

.book-entry-nav a {
    min-height: 42px;
    padding: 12px 16px;
    border: 0;
    color: #fff;
    text-decoration: none;
}

.book-entry-nav a:hover {
    background: #bf8b3f;
}

.book-entry-session {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-left: 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.book-entry-session span {
    overflow-wrap: anywhere;
}

.book-entry-session strong {
    color: #fff;
}

.book-entry-session a {
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.book-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 42px;
    border-bottom: 1px solid #dfe6ef;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
}

.book-breadcrumb a {
    color: var(--accent);
    font-weight: 700;
}

.book-breadcrumb a:hover {
    color: var(--accent-dark);
}

.book-breadcrumb span {
    min-width: 0;
}

.book-breadcrumb-text {
    overflow-wrap: anywhere;
    color: #4b5565;
    font-weight: 600;
}

.book-breadcrumb [aria-current="page"] {
    overflow-wrap: anywhere;
    color: #243044;
    font-weight: 600;
}

.book-breadcrumb-separator {
    flex: 0 0 auto;
    color: #98a2b3;
}

.book-entry-content {
    min-height: 0;
    padding: 34px 42px 40px;
    background: #fff;
}

.book-entry-intro {
    margin-bottom: 24px;
}

.book-entry-intro span {
    display: inline-block;
    margin-bottom: 8px;
    color: #bf8b3f;
    font-weight: 800;
    text-transform: uppercase;
}

.book-entry-intro h1 {
    margin: 0 0 8px;
    color: #16253a;
    font-size: 34px;
    line-height: 1.12;
}

.book-entry-intro p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.book-entry-main {
    grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
    gap: 42px;
    align-items: start;
}

.book-entry-cover img {
    width: min(100%, 310px);
    max-width: none;
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(25, 38, 57, 0.24);
}

.book-entry-side {
    display: grid;
    gap: 16px;
}

.entry-login-form {
    width: min(100%, 500px);
    max-width: 500px;
    justify-self: center;
    margin: 0 auto;
    padding: 18px 20px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #f8fafc;
    text-align: left;
}

.entry-login-form > strong {
    display: block;
    margin-bottom: 6px;
    color: #16253a;
    font-size: 18px;
    text-align: center;
}

.entry-access-panel {
    width: 100%;
    padding: 18px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #f8fafc;
}

.entry-access-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.entry-access-head .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.entry-session-text {
    min-width: 0;
}

.entry-session-text span,
.entry-session-text strong {
    display: block;
}

.entry-session-text span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.entry-session-text strong {
    overflow-wrap: anywhere;
    color: #16253a;
    font-size: 17px;
}

.entry-field {
    grid-template-columns: 95px minmax(220px, 320px);
    justify-content: center;
}

.entry-field input {
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid #b9c5d3;
    border-radius: 5px;
    background: #fff;
}

.button.wide {
    width: min(180px, 100%);
    min-height: 38px;
    letter-spacing: 0;
}

.entry-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.entry-stat-row div {
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.entry-stat-row strong {
    display: block;
    color: #16253a;
    font-size: 24px;
    line-height: 1;
}

.entry-stat-row span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.entry-access-stats {
    margin-top: 16px;
}

.entry-access-stats div {
    padding: 12px;
    background: #fff;
}

.entry-user-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
}

.entry-user-stats div {
    padding: 12px;
    background: #fff;
}

.entry-user-stats strong {
    font-size: 20px;
}

.book-entry-copy {
    max-width: 680px;
    color: #243044;
    font-size: 16px;
    line-height: 1.5;
}

.book-entry-footer {
    min-height: 34px;
    padding: 10px 16px;
    background: #203753;
    color: rgba(255, 255, 255, 0.88);
}

.tests-choice-intro {
    margin-bottom: 18px;
}

.tests-orientation-panel {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 26px;
    padding: 16px 18px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #f8fafc;
}

.tests-orientation-cover img {
    display: block;
    width: 100%;
    border-radius: 7px;
    box-shadow: 0 10px 22px rgba(25, 38, 57, 0.2);
}

.tests-orientation-cover .book-cover.large {
    width: 100%;
}

.tests-orientation-body {
    display: grid;
    gap: 16px;
}

.tests-orientation-copy {
    display: grid;
    gap: 8px;
    color: #243044;
    line-height: 1.5;
}

.tests-orientation-copy p {
    margin: 0;
}

.tests-student-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.tests-student-user span,
.tests-student-user strong {
    display: block;
}

.tests-student-user span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.tests-student-user strong {
    overflow-wrap: anywhere;
    color: #16253a;
    font-size: 17px;
}

.tests-student-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(105px, 1fr));
    gap: 10px;
}

.tests-student-stats div {
    min-width: 105px;
    padding: 10px 12px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.tests-student-stats strong,
.tests-student-stats span {
    display: block;
}

.tests-student-stats strong {
    color: #16253a;
    font-size: 22px;
    line-height: 1;
}

.tests-student-stats span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.tests-mode-section {
    margin-top: 0;
}

.tests-mode-section h2 {
    margin: 0 0 14px;
    color: #16253a;
    font-size: 24px;
}

.tests-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tests-mode-card,
.tests-pending-panel {
    padding: 22px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.tests-mode-card {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    gap: 16px;
}

.tests-mode-copy {
    display: grid;
    gap: 8px;
}

.tests-mode-kicker {
    color: #bf8b3f;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.tests-mode-card h3,
.tests-pending-panel h2 {
    margin: 0;
    color: #16253a;
    font-size: 24px;
    line-height: 1.15;
}

.tests-mode-card p,
.tests-pending-panel p {
    margin: 0;
    color: #475467;
    line-height: 1.5;
}

.tests-mode-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tests-mode-meta span {
    padding: 5px 8px;
    border: 1px solid #dfe6ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    font-weight: 600;
}

.tests-mode-card .button,
.tests-pending-panel .button {
    align-self: flex-start;
    margin-top: auto;
    white-space: nowrap;
}

.tests-report-note {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #f8fafc;
}

.tests-report-note strong {
    flex: 0 0 auto;
    color: #16253a;
}

.tests-report-note span {
    color: var(--muted);
    font-size: 14px;
}

.inline-form {
    display: inline-flex;
}

.learning-page .book-entry-content {
    min-height: 520px;
}

.learning-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: #bf8b3f;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.learning-resume-panel,
.learning-start-panel,
.learning-final-panel {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #f8fafc;
}

.learning-resume-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.learning-resume-panel h2,
.learning-list-section h2,
.learning-section-head h2 {
    margin: 0;
    color: #16253a;
}

.learning-resume-panel p {
    margin: 6px 0 0;
    color: #475467;
}

.learning-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.learning-list-section {
    display: grid;
    gap: 14px;
}

.learning-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.learning-topic-list {
    display: grid;
    gap: 10px;
}

.learning-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
    color: #16253a;
}

.learning-list-item:hover {
    border-color: #b8c7d9;
    background: #f8fafc;
    color: #16253a;
}

.learning-list-item span {
    font-weight: 700;
}

.learning-list-item small {
    color: var(--muted);
    white-space: nowrap;
}

.evaluation-topic-form {
    display: grid;
    gap: 18px;
}

.evaluation-topic-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.evaluation-topic-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 74px;
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
    color: #16253a;
    cursor: pointer;
}

.evaluation-topic-item:hover {
    border-color: #b8c7d9;
    background: #f8fafc;
}

.evaluation-topic-item input {
    margin-top: 4px;
}

.evaluation-topic-item strong,
.evaluation-topic-item small {
    display: block;
}

.evaluation-topic-item small {
    margin-top: 5px;
    color: var(--muted);
}

.evaluation-selected-topics {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.evaluation-selected-topics li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
    color: #16253a;
    font-weight: 700;
}

.evaluation-selected-topics span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.learning-help-note p {
    margin: 8px 0 0;
    color: #475467;
    line-height: 1.5;
}

.learning-start-form fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.learning-start-form legend {
    margin-bottom: 12px;
    color: #16253a;
    font-size: 20px;
    font-weight: 800;
}

.learning-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.learning-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border: 1px solid #dfe6ef;
    border-radius: 999px;
    background: #fff;
    font-weight: 600;
}

.learning-start-form small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
}

.learning-question-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.learning-question-side,
.learning-question-card,
.learning-solution-item {
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.learning-question-side {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.learning-progress strong,
.learning-progress span {
    display: block;
}

.learning-progress strong {
    color: #16253a;
    font-size: 24px;
    line-height: 1;
}

.learning-progress span {
    margin-top: 6px;
    color: var(--muted);
}

.learning-question-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.learning-nav-item,
.learning-nav-finish {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #dfe6ef;
    border-radius: 6px;
    background: #f8fafc;
    color: #475467;
    font-weight: 700;
}

.learning-nav-item.correct {
    border-color: #8fc79d;
    background: #edf8f0;
    color: #17663a;
}

.learning-nav-item.wrong {
    border-color: #e1a0a0;
    background: #fff1f1;
    color: #a12828;
}

.learning-nav-item.answered {
    border-color: #a9bfd8;
    background: #edf4ff;
    color: #1f5f99;
}

.learning-nav-item.current:not(.correct):not(.wrong) {
    border-color: #347fbd;
    background: #1f5f99;
    color: #fff;
}

.learning-nav-item.current.correct,
.learning-nav-item.current.wrong {
    box-shadow: 0 0 0 3px rgba(52, 127, 189, 0.18);
}

.learning-nav-finish {
    flex: 1 1 100%;
    color: var(--accent);
}

.learning-help-box {
    padding-top: 14px;
    border-top: 1px solid #dfe6ef;
    color: #475467;
    line-height: 1.45;
}

.learning-help-box strong {
    display: block;
    margin-bottom: 6px;
    color: #16253a;
}

.learning-question-card {
    padding: 22px;
}

.learning-question-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #bf8b3f;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.learning-question-head small {
    color: var(--muted);
    font-weight: 600;
    text-transform: none;
}

.learning-question-text {
    margin-bottom: 18px;
    color: #16253a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
}

.learning-question-text p {
    margin: 0 0 10px;
}

.learning-answers {
    display: grid;
    gap: 10px;
}

.learning-answer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #f8fafc;
    color: #243044;
    line-height: 1.45;
}

label.learning-answer {
    grid-template-columns: auto auto minmax(0, 1fr);
    cursor: pointer;
}

.learning-answer input {
    margin: 6px 0 0;
}

.learning-answer-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #e9eef5;
    color: #475467;
    font-weight: 800;
}

.learning-answer-text {
    min-width: 0;
}

.learning-answer-text p {
    margin: 0 0 8px;
}

.learning-answer-text p:last-child {
    margin-bottom: 0;
}

.learning-answer.correct {
    border-color: #86c69a;
    background: #edf8f0;
}

.learning-answer.correct .learning-answer-marker {
    background: #1f8a4c;
    color: #fff;
}

.learning-answer.wrong {
    border-color: #e1a0a0;
    background: #fff1f1;
}

.learning-answer.wrong .learning-answer-marker {
    background: #c24141;
    color: #fff;
}

.evaluation-blank-answer {
    background: #fff;
}

.evaluation-blank-answer .learning-answer-marker {
    background: #eef2f7;
    color: #667085;
}

.learning-answer em {
    display: block;
    margin-top: 6px;
    color: #667085;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.learning-result {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.learning-result.correct {
    border: 1px solid #86c69a;
    background: #edf8f0;
    color: #17663a;
}

.learning-result.wrong {
    border: 1px solid #e1a0a0;
    background: #fff1f1;
    color: #a12828;
}

.learning-result.neutral {
    border: 1px solid #b8c7d9;
    background: #f8fafc;
    color: #243044;
}

.learning-final-stats,
.learning-result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.learning-final-stats div,
.learning-result-summary div {
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.learning-final-stats strong,
.learning-result-summary strong {
    display: block;
    color: #16253a;
    font-size: 24px;
    line-height: 1;
}

.learning-final-stats span,
.learning-result-summary span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.learning-final-message p {
    margin: 0 0 14px;
    color: #475467;
    line-height: 1.5;
}

.learning-solutions {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.learning-solution-item {
    padding: 18px;
}

.learning-solution-note {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475467;
    line-height: 1.45;
}

.learning-solution-note strong {
    color: #16253a;
}

@media (max-width: 900px) {
    .book-entry-page .page {
        padding: 16px;
    }

    .book-entry-header {
        min-height: 180px;
    }

    .book-entry-content {
        padding: 28px 24px 34px;
    }

    .book-entry-main {
        grid-template-columns: 1fr;
    }

    .book-entry-cover img {
        width: min(240px, 100%);
        margin: 0 auto;
    }

    .book-entry-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .book-entry-session {
        justify-content: center;
        padding: 10px 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .book-breadcrumb {
        padding: 9px 24px;
    }

    .tests-orientation-panel,
    .tests-student-panel,
    .tests-mode-grid,
    .learning-resume-panel,
    .learning-question-layout {
        grid-template-columns: 1fr;
    }

    .tests-student-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tests-mode-card .button {
        align-self: flex-start;
    }

    .tests-report-note {
        align-items: flex-start;
        flex-direction: column;
    }

    .learning-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .book-entry-page .page {
        padding: 0;
    }

    .book-entry-shell {
        border-radius: 0;
    }

    .book-entry-nav {
        justify-content: stretch;
        padding: 0;
    }

    .book-entry-nav-links {
        width: 100%;
    }

    .book-entry-nav-links a {
        flex: 1 1 50%;
        text-align: center;
    }

    .book-entry-session {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .book-entry-session a {
        justify-content: center;
    }

    .book-breadcrumb {
        flex-wrap: wrap;
        padding: 10px 16px;
    }

    .book-entry-intro h1 {
        font-size: 28px;
    }

    .entry-field {
        grid-template-columns: 1fr;
    }

    .entry-field label {
        text-align: left;
    }

    .entry-stat-row {
        grid-template-columns: 1fr;
    }

    .tests-student-stats {
        grid-template-columns: 1fr;
    }

    .tests-mode-card {
        min-height: 0;
    }

    .tests-mode-card .button {
        width: 100%;
    }

    .learning-section-head,
    .learning-list-item,
    .learning-question-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .learning-list-item {
        display: flex;
    }

    .learning-list-item small {
        white-space: normal;
    }

    .learning-options {
        flex-direction: column;
    }

    .learning-options label,
    .learning-actions .button,
    .inline-form,
    .inline-form .button {
        width: 100%;
    }

    .entry-access-head {
        align-items: stretch;
        flex-direction: column;
    }

    .entry-access-head .button {
        width: 100%;
    }
}
