/* ═══ Aula virtual · Laetitia Padilla ═══
   Misma paleta y tipografías que la web principal. */

:root {
    --c-navy: #0c2b5e;
    --c-blue: #6ca0dc;
    --c-blue-soft: #eef4fb;
    --c-beige: #fbf6ec;
    --c-coral: #e67a5d;
    --c-white: #ffffff;
    --c-bg: #f7f9fc;
    --c-text: #3f4a5c;
    --c-muted: #7f8ca3;
    --c-line: rgba(108, 160, 220, 0.22);
    --c-line-strong: rgba(108, 160, 220, 0.45);
    --c-ok: #2f8a5f;
    --c-ok-soft: #eaf6f0;
    --c-warn: #a86b12;
    --c-warn-soft: #fdf5e6;
    --c-danger: #b94a2c;
    --c-danger-soft: #fdf0ed;

    --font-serif: 'Libre Baskerville', Georgia, serif;
    --font-script: 'Dancing Script', cursive;
    --font-sans: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(12, 43, 94, 0.06);
    --shadow-sm: 0 2px 10px rgba(12, 43, 94, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--c-navy);
    text-decoration-color: var(--c-line-strong);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--c-coral);
}

img {
    max-width: 100%;
}

h1, h2, h3 {
    color: var(--c-navy);
    line-height: 1.3;
}

code, pre {
    font-family: ui-monospace, Consolas, monospace;
    font-size: .88em;
}

[hidden] {
    display: none !important;
}

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--c-navy);
    color: #fff;
    padding: .5rem 1rem;
    z-index: 200;
}

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 3px solid rgba(108, 160, 220, .55);
    outline-offset: 2px;
}

.muted { color: var(--c-muted); }
.small { font-size: .85rem; }
.t-right { text-align: right; }

/* ─── Cabecera ─── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .7rem 5%;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-line);
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand img {
    height: 42px;
    display: block;
}

.brand-text {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--c-navy);
    font-size: 1.05rem;
    padding-left: .75rem;
    border-left: 1px solid var(--c-line);
}

.brand-text em {
    font-family: var(--font-script);
    font-style: normal;
    color: var(--c-blue);
    font-size: 1.25rem;
    font-weight: 600;
}

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

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .25rem;
    margin: 0;
    padding: 0;
}

.nav-links a,
.dropdown > summary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--c-navy);
    font-size: .92rem;
    cursor: pointer;
    position: relative;
    transition: background .2s;
}

.nav-links a:hover,
.dropdown > summary:hover {
    background: var(--c-blue-soft);
    color: var(--c-navy);
}

.nav-links a.active,
.dropdown > summary.active {
    background: var(--c-navy);
    color: var(--c-white);
}

.nav-links i {
    font-size: .9rem;
    opacity: .85;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 0;
    font-size: 1.4rem;
    color: var(--c-navy);
    cursor: pointer;
    padding: .4rem;
}

/* Desplegables con <details> */
.dropdown {
    position: relative;
}

.dropdown > summary {
    list-style: none;
}

.dropdown > summary::-webkit-details-marker {
    display: none;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(12, 43, 94, .14);
    padding: .4rem;
    z-index: 120;
}

.dropdown-right {
    left: auto;
    right: 0;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .55rem .75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--c-navy);
    background: none;
    border: 0;
    font: inherit;
    font-size: .92rem;
    cursor: pointer;
    text-align: left;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--c-blue-soft);
}

.dropdown-menu i {
    width: 1.1rem;
    text-align: center;
    color: var(--c-blue);
}

.dropdown-head {
    padding: .5rem .75rem .65rem;
    border-bottom: 1px solid var(--c-line);
    margin-bottom: .3rem;
    display: flex;
    flex-direction: column;
}

.dropdown-head small {
    color: var(--c-muted);
}

.user-menu > summary {
    padding: .3rem .8rem .3rem .3rem;
}

/* ─── Estructura ─── */

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 4rem;
    flex: 1;
}

.container-wide {
    max-width: 1400px;
}

.foot {
    text-align: center;
    padding: 1.5rem;
    font-size: .85rem;
    color: var(--c-muted);
    background: var(--c-beige);
    border-top: 1px solid var(--c-line);
    display: flex;
    justify-content: center;
    gap: .75rem;
}

.foot a {
    color: var(--c-navy);
    text-decoration: none;
}

.crumbs {
    font-size: .85rem;
    color: var(--c-muted);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.crumbs a {
    color: var(--c-muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--c-coral);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    margin: 0 0 .35rem;
}

.kicker {
    margin: 0 0 .35rem;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c-coral);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin: 0 0 1rem;
}

.grid-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.75rem;
    align-items: start;
}

.side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card {
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.side .card {
    margin-bottom: 0;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    margin: 0 0 .9rem;
    display: flex;
    align-items: center;
    gap: .55rem;
}

.card-title i {
    color: var(--c-blue);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    font-size: 2.2rem;
    color: var(--c-blue);
    margin-bottom: .75rem;
}

.prose {
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose h2, .prose h3, .prose h4 {
    font-family: var(--font-serif);
    margin: 1.4em 0 .5em;
}

.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.12rem; }

.prose blockquote {
    margin: 1em 0;
    padding: .75rem 1.1rem;
    border-left: 4px solid var(--c-blue);
    background: var(--c-blue-soft);
    border-radius: 0 10px 10px 0;
}

.prose iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 12px;
}

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

.prose td, .prose th {
    border: 1px solid var(--c-line);
    padding: .4rem .6rem;
}

.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }
.prose .ql-size-small { font-size: .85em; }
.prose .ql-size-large { font-size: 1.3em; }
.prose .ql-size-huge { font-size: 1.7em; }

/* ─── Botones ─── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.3rem;
    border-radius: 50px;
    border: 1.5px solid var(--c-blue);
    background: var(--c-white);
    color: var(--c-navy);
    font: inherit;
    font-size: .93rem;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s ease;
    line-height: 1.2;
    white-space: nowrap;
}

.btn:hover {
    background: var(--c-navy);
    border-color: var(--c-navy);
    color: var(--c-white);
}

.btn-primary {
    background: var(--c-navy);
    border-color: var(--c-navy);
    color: var(--c-white);
    box-shadow: 0 6px 18px rgba(12, 43, 94, .15);
}

.btn-primary:hover {
    background: var(--c-coral);
    border-color: var(--c-coral);
    color: var(--c-white);
}

.btn-ghost {
    border-color: var(--c-line-strong);
    background: transparent;
}

.btn-danger {
    border-color: var(--c-danger);
    color: var(--c-danger);
    background: var(--c-white);
}

.btn-danger:hover {
    background: var(--c-danger);
    border-color: var(--c-danger);
}

.btn-sm {
    padding: .42rem .9rem;
    font-size: .85rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: .6;
    cursor: wait;
}

.btn-row {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--c-muted);
    cursor: pointer;
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.icon-btn:hover {
    background: var(--c-blue-soft);
    color: var(--c-navy);
}

.icon-btn:disabled {
    opacity: .35;
    cursor: default;
}

.icon-danger:hover {
    background: var(--c-danger-soft);
    color: var(--c-danger);
}

.icon-sm {
    width: 26px;
    height: 26px;
    font-size: .78rem;
}

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: .85rem;
    color: var(--c-blue);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-more {
    display: inline-block;
    margin-top: .75rem;
    font-size: .88rem;
}

.inline-post {
    display: inline;
    margin: 0;
}

.tools {
    display: flex;
    align-items: center;
    gap: .1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ─── Etiquetas y avisos ─── */

.tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    padding: .2rem .6rem;
    border-radius: 50px;
    background: var(--c-blue-soft);
    color: var(--c-navy);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.tag-ok { background: var(--c-ok-soft); color: var(--c-ok); }
.tag-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.tag-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.tag-muted { background: #f0f2f6; color: var(--c-muted); }
.tag-sm { font-size: .7rem; padding: .05rem .45rem; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--c-coral);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
}

.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.1rem;
    border: 1px solid;
    font-size: .95rem;
}

.alert p { margin: 0 0 .5rem; }
.alert-ok { background: var(--c-ok-soft); color: #23704c; border-color: #b3dfc9; }
.alert-error { background: var(--c-danger-soft); color: var(--c-danger); border-color: #f0c4b8; }
.alert-info { background: var(--c-blue-soft); color: var(--c-navy); border-color: var(--c-line-strong); }
.alert-warn { background: var(--c-warn-soft); color: var(--c-warn); border-color: #efd7a8; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-beige);
    color: var(--c-navy);
    font-weight: 700;
    font-size: .85rem;
    border: 1px solid var(--c-line);
}

.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: .72rem;
}

.avatar-announce {
    background: #fdeee9;
    color: var(--c-coral);
}

/* ─── Formularios ─── */

.form .field,
.field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1.1rem;
    min-width: 0;
}

.field label,
.field > label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--c-navy);
    letter-spacing: .02em;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-check {
    justify-content: center;
    gap: .2rem;
}

input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], select, textarea {
    font: inherit;
    font-size: 1rem;
    color: var(--c-navy);
    background: var(--c-white);
    border: 1.5px solid var(--c-line-strong);
    border-radius: var(--radius-sm);
    padding: .65rem .9rem;
    width: 100%;
    transition: border-color .2s, box-shadow .2s;
    min-width: 0;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(108, 160, 220, .18);
}

textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.55;
}

input[type=file] {
    font: inherit;
    font-size: .9rem;
    padding: .6rem;
    border: 1.5px dashed var(--c-line-strong);
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    width: 100%;
}

.hint {
    font-size: .8rem;
    color: var(--c-muted);
    font-weight: 400;
}

.hint-check {
    display: block;
    margin: -.4rem 0 .8rem 1.7rem;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .93rem;
    margin-bottom: .75rem;
    cursor: pointer;
    line-height: 1.45;
    font-weight: 400 !important;
    color: var(--c-text) !important;
}

.check input {
    margin-top: .2rem;
    width: 17px;
    height: 17px;
    accent-color: var(--c-navy);
    flex: 0 0 auto;
}

.fieldset {
    border: 1px solid var(--c-line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem .3rem;
    margin: 0 0 1.25rem;
}

.fieldset legend {
    font-weight: 700;
    color: var(--c-navy);
    padding: 0 .4rem;
    font-size: .9rem;
}

.form-narrow { max-width: 620px; }
.form-wide { max-width: 860px; }

.inline-form {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
    flex: 1;
    min-width: 160px;
    width: auto;
}

.input-code {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
}

.input-code::placeholder {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    right: .4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--c-muted);
    cursor: pointer;
    padding: .4rem;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.current-file {
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    background: var(--c-blue-soft);
    font-size: .92rem;
    margin: 0 0 .8rem;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    padding: 1rem 0;
    background: linear-gradient(transparent, var(--c-bg) 35%);
}

.upload-progress {
    margin-top: .4rem;
    font-size: .82rem;
    color: var(--c-muted);
}

.upload-progress .progress {
    margin-top: .3rem;
}

/* Editor (Quill) */
.ql-toolbar.ql-snow {
    border: 1.5px solid var(--c-line-strong) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--c-bg);
    font-family: var(--font-sans) !important;
}

.ql-container.ql-snow {
    border: 1.5px solid var(--c-line-strong) !important;
    border-top: 0 !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-family: var(--font-sans) !important;
    font-size: 1rem !important;
    background: var(--c-white);
}

.ql-editor {
    min-height: 140px;
    line-height: 1.7;
    color: var(--c-text);
}

/* ─── Barra de progreso ─── */

.progress {
    height: 8px;
    border-radius: 8px;
    background: #e9eef6;
    overflow: hidden;
    margin: .6rem 0 .35rem;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--c-blue), var(--c-navy));
    transition: width .4s ease;
}

.progress-sm {
    height: 6px;
    margin: 0 0 .2rem;
    min-width: 90px;
}

.big-number {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--c-navy);
    line-height: 1.1;
}

/* ─── Login / registro ─── */

.auth-body {
    background: linear-gradient(160deg, var(--c-beige) 0%, #f2f7fc 100%);
}

.auth-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
    flex: 1;
}

.auth-brand {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand img {
    height: 64px;
}

.auth-card {
    background: var(--c-white);
    border-radius: 22px;
    padding: 2.2rem 2rem;
    box-shadow: 0 20px 50px rgba(12, 43, 94, .09);
    border: 1px solid var(--c-line);
}

.auth-kicker {
    text-align: center;
    font-family: var(--font-script);
    font-size: 1.5rem;
    color: var(--c-blue);
    margin: 0 0 .2rem;
}

.auth-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    text-align: center;
    margin: 0 0 1.25rem;
}

.auth-card > .muted {
    text-align: center;
    margin-top: -.5rem;
}

.auth-links {
    text-align: center;
    font-size: .9rem;
    margin: 1.1rem 0 0;
}

.auth-alt {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--c-line);
    text-align: center;
    font-size: .92rem;
}

.auth-foot {
    text-align: center;
    font-size: .85rem;
    margin-top: 1.5rem;
    display: flex;
    gap: .6rem;
    justify-content: center;
}

.auth-foot a {
    color: var(--c-muted);
    text-decoration: none;
}

/* ─── Panel ─── */

.welcome {
    background: linear-gradient(120deg, var(--c-beige), #fff);
}

.course-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--c-text);
    margin: 0;
    transition: transform .2s, box-shadow .2s;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(12, 43, 94, .1);
    color: var(--c-text);
}

.course-card h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin: .6rem 0 .4rem;
}

.course-card p {
    font-size: .9rem;
    margin: 0 0 .6rem;
    flex: 1;
}

.course-card {
    overflow: hidden;
}

.course-card-cover {
    height: 140px;
    margin: -1.4rem -1.5rem .4rem;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: .9rem 1.5rem;
    margin: 0;
}

.course-row-cover {
    display: block;
    min-height: 96px;
    border-radius: 12px;
    overflow: hidden;
}

.course-row-cover .cover {
    height: 100%;
}

.course-row-cover .cover-word {
    font-size: 1.35rem;
}

.course-row h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin: 0 0 .6rem;
}

.course-row h3 a {
    text-decoration: none;
}

.course-row-code {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .3rem;
}

.course-row-code small {
    color: var(--c-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.course-row-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding-top: .9rem;
    border-top: 1px solid var(--c-line);
}

.code-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: ui-monospace, Consolas, monospace;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .08em;
    padding: .35rem .75rem;
    border-radius: 8px;
    border: 1.5px dashed var(--c-blue);
    background: var(--c-blue-soft);
    color: var(--c-navy);
    cursor: pointer;
}

.code-chip i {
    font-size: .8rem;
    color: var(--c-blue);
}

.code-chip.copied,
.link-btn.copied,
.btn.copied {
    border-color: var(--c-ok);
    color: var(--c-ok);
}

.mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mini-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--c-line);
    font-size: .92rem;
}

.mini-list li:last-child {
    border-bottom: 0;
}

.mini-list li > a {
    flex: 1;
    min-width: 0;
}

.mini-list li > span:first-child:not(.avatar) {
    flex: 1;
}

.mini-progress {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

.mini-progress .progress-sm {
    min-width: 60px;
    width: 60px;
    margin: 0;
}

.enrol-more {
    margin: .9rem 0 .35rem;
}

.join-form label {
    display: block;
    margin-bottom: .6rem;
}

/* ─── Curso ─── */

.course-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: start;
    background: linear-gradient(120deg, #fff 55%, var(--c-beige));
    overflow: hidden;
}

.course-hero-cover {
    grid-column: 1 / -1;
    position: relative;
    height: 220px;
    margin: -1.4rem -1.5rem 0;
}

.course-hero-cover .cover {
    height: 100%;
}

.course-hero-cover .cover-word {
    font-size: 3.4rem;
}

.cover-edit {
    position: absolute;
    top: .8rem;
    right: .8rem;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-sm);
}

/* ─── Portadas ─── */

.cover {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    overflow: hidden;
    color: #fff;
    background-color: var(--c-navy);
}

.cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .22) 1.2px, transparent 1.7px);
    background-size: 16px 16px;
    -webkit-mask-image: linear-gradient(105deg, #000 10%, transparent 60%);
    mask-image: linear-gradient(105deg, #000 10%, transparent 60%);
}

.cover-image {
    background: var(--c-blue-soft);
}

.cover-image::before {
    display: none;
}

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

.cover-word {
    position: relative;
    font-family: var(--font-script);
    font-size: 2.3rem;
    line-height: 1;
    padding: 0 .45em .3em 0;
    transform: rotate(-5deg);
    text-shadow: 0 2px 12px rgba(12, 43, 94, .25);
    white-space: nowrap;
}

.cover-marino {
    background:
        radial-gradient(circle at 12% 18%, rgba(108, 160, 220, .55) 0 16%, transparent 16.5%),
        radial-gradient(circle at 88% 115%, rgba(230, 122, 93, .55) 0 32%, transparent 32.5%),
        radial-gradient(circle at 62% 28%, rgba(255, 255, 255, .1) 0 9%, transparent 9.5%),
        linear-gradient(135deg, #0c2b5e, #1f4f93);
}

.cover-coral {
    background:
        radial-gradient(circle at 18% 120%, rgba(251, 246, 236, .45) 0 30%, transparent 30.5%),
        radial-gradient(circle at 78% 10%, rgba(12, 43, 94, .18) 0 18%, transparent 18.5%),
        radial-gradient(circle at 45% 40%, rgba(255, 255, 255, .14) 0 7%, transparent 7.5%),
        linear-gradient(135deg, #e0694c, #f3a585);
}

.cover-tricolor {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .5) 0 12%, transparent 12.5%),
        linear-gradient(100deg, #0c2b5e 0 33%, #fbf6ec 33% 66%, #e67a5d 66%);
}

.cover-tricolor .cover-word {
    color: var(--c-navy);
    text-shadow: 0 0 10px rgba(255, 255, 255, .9);
}

.cover-lavanda {
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .3) 0 12%, transparent 12.5%),
        radial-gradient(ellipse at 20% 130%, rgba(76, 52, 140, .45) 0 45%, transparent 45.5%),
        repeating-linear-gradient(75deg, rgba(255, 255, 255, .07) 0 10px, transparent 10px 26px),
        linear-gradient(135deg, #7d68b8, #c3b4e6);
}

.cover-mar {
    background:
        radial-gradient(circle at 80% 26%, #ffd99a 0 9%, rgba(255, 217, 154, .35) 9.5% 13%, transparent 13.5%),
        radial-gradient(ellipse at 30% 150%, rgba(12, 43, 94, .65) 0 55%, transparent 55.5%),
        radial-gradient(ellipse at 90% 160%, rgba(255, 255, 255, .25) 0 50%, transparent 50.5%),
        linear-gradient(170deg, #9cc3ee, #4f86c9 60%, #2b5d9e);
}

.cover-field .cover-current {
    margin-bottom: 1rem;
}

.cover-preview {
    height: 160px;
    border-radius: var(--radius-sm);
    margin-bottom: .75rem;
}

.cover-pick-label {
    font-weight: 700;
    color: var(--c-navy);
    font-size: .92rem;
    margin: .25rem 0 .5rem;
}

.cover-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.cover-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    cursor: pointer;
    font-size: .85rem;
    text-align: center;
}

.cover-option input {
    position: absolute;
    opacity: 0;
}

.cover-option .cover {
    height: 72px;
    border-radius: var(--radius-sm);
    border: 3px solid transparent;
    transition: border-color .15s, transform .15s;
}

.cover-option .cover-word {
    font-size: 1.15rem;
}

.cover-option:hover .cover {
    transform: translateY(-2px);
}

.cover-option input:checked + .cover {
    border-color: var(--c-coral);
    box-shadow: 0 0 0 3px rgba(230, 122, 93, .25);
}

.cover-option input:focus-visible + .cover {
    outline: 2px solid var(--c-navy);
    outline-offset: 2px;
}

.course-hero .page-title {
    font-size: 2rem;
}

.course-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .35rem;
    min-width: 220px;
}

.course-hero-side > small:first-child {
    color: var(--c-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.course-hero-side .progress {
    width: 100%;
}

.course-hero-side .btn-row {
    margin-top: .5rem;
    justify-content: flex-end;
}

.card.unit {
    padding: 0;
}

.card.unit > :first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Menú «Mover a otro apartado» de cada contenido */
.move-menu > summary.icon-btn {
    padding: 0;
    gap: 0;
    border-radius: 50%;
    font-size: .9rem;
    color: var(--c-muted);
}

.move-menu[open] {
    z-index: 130;
}

.move-menu[open] > summary.icon-btn {
    background: var(--c-blue-soft);
    color: var(--c-navy);
}

.move-menu .dropdown-menu {
    min-width: 240px;
    max-height: 60vh;
    overflow-y: auto;
}

.move-menu .inline-post {
    display: block;
}

.unit.is-hidden,
.res-item.is-hidden {
    opacity: .6;
}

.unit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--c-line);
    background: linear-gradient(90deg, var(--c-beige), #fff);
}

.announcements .unit-head {
    background: none;
    padding: 0 0 .5rem;
    border: 0;
}

.unit-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin: 0;
}

.unit-summary {
    padding: 1rem 1.5rem 0;
}

.unit-edit {
    padding: 1.1rem 1.5rem;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-line);
}

.unit-empty {
    padding: 1rem 1.5rem;
    margin: 0;
}

.res-list {
    list-style: none;
    margin: 0;
    padding: .5rem .75rem;
}

.res-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-radius: 12px;
    padding: .2rem .25rem .2rem 0;
    transition: background .15s;
    scroll-margin-top: 90px;
}

.res-item:hover {
    background: var(--c-bg);
}

.res-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .65rem .75rem;
    text-decoration: none;
    color: var(--c-navy);
}

.res-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.res-title {
    font-weight: 700;
    line-height: 1.35;
}

.res-ext {
    font-size: .7rem;
    color: var(--c-muted);
}

.res-meta {
    font-size: .8rem;
    color: var(--c-muted);
}

.res-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: var(--c-blue-soft);
    color: var(--c-navy);
}

.res-icon-sm {
    width: 24px;
    height: 24px;
    font-size: .72rem;
    border-radius: 6px;
}

.res-icon-pdf { background: #fdeee9; color: #c4533a; }
.res-icon-audio { background: #efeafc; color: #6b4fc4; }
.res-icon-video { background: #fdecef; color: #c43a5a; }
.res-icon-page { background: #eef4fb; color: var(--c-navy); }
.res-icon-link { background: #e9f6f6; color: #1f7a7a; }
.res-icon-file { background: #f4f1ea; color: #8a6a2f; }
.res-icon-scorm { background: #eaf6f0; color: var(--c-ok); }
.res-icon-folder { background: #fdf3dc; color: #b07d1a; }

/* Carpetas del índice: se abren en el sitio y su contenido va sangrado debajo */
.res-folder {
    flex-wrap: wrap;
}

.res-folder:hover {
    background: none;
}

.folder-toggle {
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    transition: background .15s;
}

.folder-toggle:hover {
    background: var(--c-bg);
}

.res-icon-folder .fa-folder-open,
.res-folder.is-open > .folder-toggle .res-icon-folder .fa-folder {
    display: none;
}

.res-folder.is-open > .folder-toggle .res-icon-folder .fa-folder-open {
    display: inline-block;
}

.folder-caret {
    margin-left: auto;
    color: var(--c-muted);
    font-size: .8rem;
    transition: transform .2s;
}

.res-folder.is-open > .folder-toggle .folder-caret {
    transform: rotate(180deg);
}

.folder-body {
    flex-basis: 100%;
    min-width: 0;
    margin: 0 0 .5rem 1.95rem;
    padding-left: .6rem;
    border-left: 2px solid #f1e3bf;
}

.folder-body .res-list {
    padding: 0;
}

.folder-desc {
    padding: .25rem .75rem .5rem;
}

.folder-empty {
    margin: 0;
    padding: .5rem .75rem;
    font-size: .9rem;
}

.folder-body .add-menu {
    border-top: 0;
    padding: .35rem .75rem .5rem;
}

.move-dest {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding-left: calc(var(--depth, 0) * 1.1rem);
}

.move-here {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .75rem;
    font-size: .92rem;
    color: var(--c-muted);
}

.kicker-sep {
    opacity: .6;
}

.res-status {
    color: var(--c-line-strong);
    font-size: 1.15rem;
    padding: 0 .5rem;
}

.res-status.done {
    color: var(--c-ok);
}

.add-menu {
    border-top: 1px dashed var(--c-line);
    padding: .75rem 1.5rem;
}

.add-menu > summary,
.add-unit > summary {
    cursor: pointer;
    color: var(--c-blue);
    font-weight: 700;
    font-size: .92rem;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.add-menu > summary::-webkit-details-marker,
.add-unit > summary::-webkit-details-marker {
    display: none;
}

.add-unit[open] > summary {
    margin-bottom: 1rem;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .75rem;
    margin-top: .9rem;
}

.type-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .9rem;
    border: 1px solid var(--c-line);
    border-radius: 12px;
    text-decoration: none;
    color: var(--c-text);
    transition: border-color .2s, box-shadow .2s;
}

.type-card:hover {
    border-color: var(--c-blue);
    box-shadow: var(--shadow-sm);
    color: var(--c-text);
}

.type-card strong {
    color: var(--c-navy);
}

.type-card small {
    font-size: .8rem;
    color: var(--c-muted);
    line-height: 1.4;
}

.danger-zone {
    border-color: #f0c4b8;
}

.danger-zone .card-title i {
    color: var(--c-danger);
}

/* ─── Página de contenido ─── */

.resource-desc {
    margin-bottom: 1.25rem;
}

.resource-body {
    margin-bottom: 1.5rem;
}

.resource-body > .btn-row {
    margin-bottom: 1rem;
}

.pdf-frame,
.embed-frame {
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #e9edf3;
    box-shadow: var(--shadow);
}

.pdf-frame iframe,
.embed-frame iframe {
    display: block;
    width: 100%;
    height: 80vh;
    border: 0;
}

.pdf-hint {
    margin-top: .5rem;
}

/* Reproductores de Spotify, Deezer, SoundCloud… (ya traen su propio fondo) */
.embed-player iframe {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.video-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow);
}

.video-frame iframe,
.video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.audio-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.audio-box audio {
    flex: 1;
    min-width: 260px;
}

.audio-speed {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.audio-speed button {
    border: 1px solid var(--c-line-strong);
    background: #fff;
    color: var(--c-navy);
    border-radius: 6px;
    font: inherit;
    font-size: .8rem;
    padding: .2rem .5rem;
    cursor: pointer;
}

.audio-speed button.active {
    background: var(--c-navy);
    color: #fff;
    border-color: var(--c-navy);
}

.transcript > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--c-navy);
}

.transcript[open] > summary {
    margin-bottom: 1rem;
}

.page-content {
    padding: 2rem 2.25rem;
    font-size: 1.05rem;
}

.file-box {
    text-align: center;
}

.image-view {
    margin: 0;
    padding: .75rem;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.image-view a {
    display: block;
    cursor: zoom-in;
}

.image-view img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}

.image-hint {
    margin-top: .5rem;
}

.prose img {
    cursor: zoom-in;
}

/* ─── Visor de imágenes ─── */

.lightbox-open,
.lightbox-open body {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: rgba(10, 20, 40, .94);
}

.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding: .6rem .8rem;
    color: rgba(255, 255, 255, .75);
    font-size: .85rem;
}

.lightbox-hint {
    margin-right: auto;
}

.lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

.lightbox-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: auto;
    padding: 0 1rem 1rem;
    cursor: zoom-out;
}

.lightbox-stage img {
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
    cursor: zoom-in;
    user-select: none;
}

.lightbox.zoomed .lightbox-stage img {
    max-width: none;
    max-height: none;
    height: auto;
    cursor: grab;
}

.pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--c-line);
}

.pager-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    font-weight: 700;
    font-size: .92rem;
    min-width: 0;
}

.pager-link span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pager-link small {
    font-weight: 400;
    color: var(--c-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pager-next {
    justify-content: flex-end;
    text-align: right;
}

.pager-up {
    font-size: .88rem;
    text-decoration: none;
    color: var(--c-muted);
}

/* ─── Tablas ─── */

.card.table-card {
    padding: .4rem 0;
    overflow-x: auto;
}

.table-card .card-title {
    padding: 1rem 1.5rem 0;
}

.table-card > p {
    padding: 0 1.5rem;
}

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

.table th,
.table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--c-line);
    text-align: left;
    vertical-align: middle;
}

.table th:first-child,
.table td:first-child {
    padding-left: 1.5rem;
}

.table th:last-child,
.table td:last-child {
    padding-right: 1.5rem;
}

.table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-muted);
    font-weight: 700;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
    border-bottom: 0;
}

.table tbody th {
    font-weight: 700;
    color: var(--c-navy);
    width: 40%;
}

.table .ok { color: var(--c-ok); }
.table .warn { color: var(--c-warn); }

.person {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
}

.person > span:not(.avatar):not(.tag) {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.person small {
    color: var(--c-muted);
    font-size: .8rem;
}

.t-progress {
    min-width: 130px;
}

.filters {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem;
}

.filters input,
.filters select {
    flex: 1;
    min-width: 160px;
    width: auto;
}

.log {
    max-height: 340px;
    overflow: auto;
    background: var(--c-bg);
    padding: 1rem;
    border-radius: 8px;
    font-size: .78rem;
    white-space: pre-wrap;
}

/* ─── Extensiones ─── */

.plugin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plugin {
    display: flex;
    gap: 1.1rem;
    align-items: center;
    margin: 0;
}

.plugin-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f6;
    color: var(--c-muted);
    font-size: 1.2rem;
}

.plugin.is-on .plugin-icon {
    background: var(--c-blue-soft);
    color: var(--c-navy);
}

.plugin-text {
    flex: 1;
}

.plugin-text h2 {
    font-size: 1.05rem;
    margin: 0 0 .2rem;
}

.plugin-text p {
    margin: 0;
    font-size: .9rem;
}

/* ─── Mensajería ─── */

.msg-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tabs {
    display: flex;
    gap: .3rem;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    padding: .25rem;
    border-radius: 50px;
}

.tabs a {
    padding: .45rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: .9rem;
    display: inline-flex;
    gap: .45rem;
    align-items: center;
}

.tabs a.active {
    background: var(--c-navy);
    color: #fff;
}

.card.conv-list {
    list-style: none;
    padding: 0;
    overflow: hidden;
}

.conv a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    text-decoration: none;
    color: var(--c-text);
    border-bottom: 1px solid var(--c-line);
    transition: background .15s;
}

.conv:last-child a {
    border-bottom: 0;
}

.conv a:hover {
    background: var(--c-bg);
    color: var(--c-text);
}

.conv.is-unread a {
    background: #f6f9fe;
}

.conv.is-unread .conv-who,
.conv.is-unread .conv-subject {
    color: var(--c-navy);
    font-weight: 700;
}

.conv-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.conv-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.conv-top time {
    font-size: .78rem;
    color: var(--c-muted);
    white-space: nowrap;
}

.conv-who {
    color: var(--c-navy);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-subject {
    font-size: .92rem;
}

.conv-excerpt {
    font-size: .85rem;
    color: var(--c-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-conv {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mini-conv a {
    display: flex;
    flex-direction: column;
    padding: .55rem 0;
    border-bottom: 1px solid var(--c-line);
    text-decoration: none;
    color: var(--c-text);
    font-size: .88rem;
}

.mini-conv strong {
    font-weight: 400;
    color: var(--c-navy);
}

.mini-conv .is-unread strong,
.mini-conv .is-unread span {
    font-weight: 700;
}

.thread-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.thread-head .page-title {
    font-size: 1.5rem;
}

.thread-head p.muted {
    margin: 0;
}

.thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: .5rem 0 1.5rem;
}

.msg {
    display: flex;
    gap: .7rem;
    align-items: flex-end;
    max-width: 82%;
    scroll-margin-top: 90px;
}

.msg-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-bubble {
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: 18px 18px 18px 4px;
    padding: .75rem 1.05rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.msg-mine .msg-bubble {
    background: var(--c-navy);
    border-color: var(--c-navy);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.msg-mine .msg-bubble a {
    color: #fff;
}

.msg-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    margin-bottom: .25rem;
    flex-wrap: wrap;
}

.msg-head strong {
    color: var(--c-navy);
}

/* Nombres de alumnado que abren su ficha (solo los ve el profesorado) */
.person-link,
.msg-head .person-link strong {
    color: #2e6db4;
}

.person-link {
    text-decoration: underline dotted;
    text-decoration-color: rgba(46, 109, 180, .5);
    text-underline-offset: 3px;
}

.person-link:hover,
.person-link:hover strong {
    color: var(--c-navy);
    text-decoration-style: solid;
}

a.avatar-link {
    text-decoration: none;
    background: var(--c-blue-soft);
    color: #2e6db4;
    border-color: var(--c-line-strong);
    transition: background .15s, color .15s;
}

a.avatar-link:hover {
    background: #2e6db4;
    color: #fff;
}

.msg-mine .msg-head strong {
    color: #fff;
}

.msg-head time {
    color: var(--c-muted);
}

.msg-mine .msg-head time {
    color: rgba(255, 255, 255, .7);
}

.msg-del {
    opacity: 0;
    transition: opacity .2s;
}

.msg:hover .msg-del,
.msg-del:focus {
    opacity: 1;
}

.msg-mine .msg-del {
    color: rgba(255, 255, 255, .8);
}

.msg-body {
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.msg-deleted {
    margin: 0;
    font-style: italic;
    opacity: .7;
    font-size: .9rem;
}

.msg-files {
    list-style: none;
    margin: .6rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.msg-files img {
    max-width: 220px;
    max-height: 180px;
    border-radius: 10px;
    display: block;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .75rem;
    border-radius: 8px;
    background: var(--c-blue-soft);
    color: var(--c-navy);
    text-decoration: none;
    font-size: .85rem;
}

.msg-mine .file-chip {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.file-chip small {
    opacity: .7;
}

.msg.is-new .msg-bubble {
    animation: pop .4s ease;
}

@keyframes pop {
    from { transform: scale(.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.reply-box {
    padding: 1rem 1.1rem .6rem;
}

.reply-box .field {
    margin-bottom: .6rem;
}

.reply-box textarea {
    min-height: 60px;
    max-height: 320px;
}

.reply-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.reply-actions .btn-primary {
    margin-left: auto;
}

.file-pick {
    position: relative;
}

.file-names {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.reply-note {
    text-align: center;
}

.people > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--c-navy);
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: 50px;
    padding: .25rem;
    margin-bottom: 1.25rem;
}

.segmented label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--c-navy);
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented label:has(input:checked) {
    background: var(--c-navy);
    color: #fff;
}

.picker {
    border: 1.5px solid var(--c-line-strong);
    border-radius: var(--radius-sm);
    max-height: 340px;
    overflow: auto;
    padding: .75rem;
}

.picker input[type=search] {
    margin-bottom: .5rem;
}

.picker-group {
    border: 0;
    padding: 0;
    margin: 0 0 .75rem;
}

.picker-group legend {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-muted);
    font-weight: 700;
    padding: .3rem 0;
}

.picker-item {
    margin: 0;
    padding: .3rem .25rem;
    border-radius: 6px;
}

.picker-item:hover {
    background: var(--c-bg);
}

.to-fixed {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    font-weight: 700;
    color: var(--c-navy);
}

.announce-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.announce-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--c-line);
}

.announce-list li:last-child {
    border-bottom: 0;
}

.announce-list a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    min-width: 0;
}

.announce-list .muted {
    font-size: .88rem;
}

/* ─── Responsive ─── */

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

@media (max-width: 820px) {
    .topbar {
        flex-wrap: wrap;
        padding: .6rem 1rem;
        gap: .5rem;
    }

    .nav-toggle {
        display: block;
    }

    .mainnav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: .5rem 0;
    }

    .mainnav.open {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links a,
    .dropdown > summary {
        border-radius: 10px;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: 0;
        padding: 0 0 0 1rem;
    }

    .user-menu {
        border-top: 1px solid var(--c-line);
        padding-top: .5rem;
    }

    .container {
        padding: 1.25rem 1rem 3rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .course-hero {
        grid-template-columns: 1fr;
    }

    .course-hero .page-title {
        font-size: 1.6rem;
    }

    .course-hero-side {
        align-items: flex-start;
    }

    .course-hero-cover {
        height: 150px;
        margin: -1.1rem -1.1rem 0;
    }

    .course-hero-cover .cover-word {
        font-size: 2.4rem;
    }

    .course-card-cover {
        margin: -1.1rem -1.1rem .4rem;
    }

    .course-row-cover {
        height: 110px;
    }

    .image-view {
        padding: .4rem;
    }

    .lightbox-hint {
        display: none;
    }

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

    .course-row-code {
        align-items: flex-start;
    }

    .card {
        padding: 1.1rem 1.1rem;
    }

    .unit-head {
        flex-wrap: wrap;
        gap: .25rem;
    }

    .unit-head .tools {
        margin-left: auto;
    }

    .unit-head,
    .unit-summary,
    .add-menu,
    .unit-edit {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .res-list {
        padding: .4rem;
    }

    .res-item {
        flex-wrap: wrap;
    }

    .res-item .tools {
        width: 100%;
        justify-content: flex-start;
        padding-left: 3.5rem;
        margin-top: -.5rem;
    }

    .folder-body {
        margin-left: 1rem;
        padding-left: .3rem;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .msg {
        max-width: 94%;
    }

    .pager {
        grid-template-columns: 1fr 1fr;
    }

    .pager-up {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: center;
    }

    .page-content {
        padding: 1.25rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
    }

    .table th,
    .table td {
        padding: .6rem .7rem;
    }
}
