@charset "UTF-8";
* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

:root {
    color-scheme: light;
    --bg: #eef2f7;
    --surface: rgba(255, 255, 255, 0.66);
    --surface-strong: rgba(255, 255, 255, 0.86);
    --line: rgba(15, 32, 48, 0.12);
    --text: #0b1c2b;
    --muted: rgba(11, 28, 43, 0.64);
    --brand: #1f4f86;
    --brand-ink: #163a63;
    --brand-soft: rgba(31, 79, 134, 0.12);
    --success: #167a4b;
    --warning: #a36a12;
    --error: #b0303a;
    --shadow: 0 22px 60px rgba(10, 24, 40, 0.12);
    --shadow-soft: 0 10px 30px rgba(10, 24, 40, 0.08);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
    --focus: 0 0 0 4px rgba(31, 79, 134, 0.18);
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(31, 79, 134, 0.16), transparent 42rem),
        radial-gradient(circle at 88% 24%, rgba(10, 31, 60, 0.12), transparent 46rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

textarea {
    font: inherit;
}

.site-header,
.site-footer,
.topbar {
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.site-header {
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-footer {
    border-top: 1px solid var(--line);
}

.topbar {
    border-bottom: 1px solid var(--line);
}

.container {
    width: min(100% - 2rem, 1100px);
    margin: 0 auto;
}

.narrow {
    width: min(100%, 760px);
}

.site-header .container,
.topbar-inner,
.site-nav,
.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header .container,
.topbar-inner {
    justify-content: space-between;
}

.site-header .container {
    padding: 1rem 0;
}

.topbar-inner {
    padding: 0.8rem 0;
}

.site-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav a,
.brand {
    text-decoration: none;
}

.brand {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-nav a {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    color: rgba(11, 28, 43, 0.78);
    transition: background-color 160ms var(--ease-standard), color 160ms var(--ease-standard), transform 160ms var(--ease-standard);
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
}

.site-nav a:active {
    transform: scale(0.98);
}

.section {
    padding: 3rem 0 4rem;
}

.stack {
    display: grid;
    gap: 1.25rem;
}

.grid {
    display: grid;
    gap: 1.25rem;
}

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

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

.learner-shell {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    align-items: start;
}

.learner-main-column {
    min-width: 0;
}

.learner-subcards {
    min-width: 0;
}

.panel {
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, var(--shadow);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.panel-hero {
    padding: 1.8rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.62));
}

.login-hero {
    margin-bottom: 1.25rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 0.85rem;
    font-weight: 600;
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 1.02;
}

h2 {
    font-size: 1.25rem;
}

p,
li,
td,
th,
small,
label span {
    color: var(--muted);
}

.feature-list,
.status-list {
    margin: 0;
    padding-left: 1.1rem;
}

.status-list li {
    margin-bottom: 0.65rem;
}

.status-list li.ok {
    color: var(--success);
}

.status-list li.warn {
    color: var(--warning);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0.75rem 1.05rem;
    border: 0;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, var(--shadow-soft);
    transition: transform 180ms var(--ease-standard), opacity 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), filter 180ms var(--ease-standard);
}

.btn:active {
    transform: scale(0.98);
}

.btn:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 16px 40px rgba(10, 24, 40, 0.14);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, rgba(52, 128, 206, 0.98), rgba(31, 79, 134, 0.98));
}

.btn-success {
    color: #fff;
    background: linear-gradient(180deg, rgba(44, 166, 94, 0.98), rgba(24, 121, 64, 0.98));
}

.btn-secondary {
    color: var(--brand-ink);
    background: rgba(255, 255, 255, 0.6);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(180deg, rgba(210, 76, 88, 0.98), rgba(176, 48, 58, 0.98));
}

.btn-small {
    min-height: 2.2rem;
    padding: 0.55rem 0.9rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    padding-top: 1rem;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.flash-success {
    border-color: rgba(23, 114, 69, 0.14);
    color: var(--success);
}

.flash-error {
    border-color: rgba(155, 47, 51, 0.14);
    color: var(--error);
}

.flash-info {
    border-color: rgba(4, 71, 68, 0.14);
    color: var(--brand);
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field input,
.field select {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    transition: box-shadow 160ms var(--ease-standard), border-color 160ms var(--ease-standard), background-color 160ms var(--ease-standard);
}

.textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    resize: vertical;
    transition: box-shadow 160ms var(--ease-standard), border-color 160ms var(--ease-standard), background-color 160ms var(--ease-standard);
}

.field input:focus-visible,
.field select:focus-visible {
    outline: none;
    border-color: rgba(31, 79, 134, 0.45);
    box-shadow: var(--focus);
}

.textarea:focus-visible {
    outline: none;
    border-color: rgba(31, 79, 134, 0.45);
    box-shadow: var(--focus);
}

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

.admin-filters {
    gap: 0.85rem;
}

.admin-filters-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

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

.field-compact {
    gap: 0.32rem;
}

.field-compact span {
    font-size: 0.8rem;
}

.field-compact input,
.field-compact select {
    min-height: 2.65rem;
    padding: 0.72rem 0.88rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 0.82rem;
}

.warning-list {
    display: grid;
    gap: 0.9rem;
}

.warning-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.warning-card-warning {
    border-color: rgba(163, 106, 18, 0.2);
    background: rgba(255, 244, 224, 0.78);
}

.warning-card-error {
    border-color: rgba(176, 48, 58, 0.2);
    background: rgba(255, 235, 237, 0.8);
}

.stat-card {
    display: grid;
    gap: 0.25rem;
}

.stat-card-compact {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.62);
}

.learner-stats-grid {
    gap: 0.45rem;
}

.learner-stats-grid .stat-card {
    gap: 0.12rem;
}

.learner-stats-grid .stat-card-compact {
    padding: 0.55rem 0.65rem;
}

.learner-stats-grid .stat-label {
    font-size: 0.76rem;
    line-height: 1.1;
}

.learner-stats-grid .stat-value {
    font-size: 1.25rem;
    line-height: 1;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

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

.stat-value {
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

.chapter-progress-list {
    display: grid;
    gap: 0.45rem;
}

.chapter-progress-item {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0.3rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
    cursor: pointer;
    transition:
        transform 180ms var(--ease-standard),
        box-shadow 180ms var(--ease-standard),
        border-color 180ms var(--ease-standard),
        background-color 180ms var(--ease-standard),
        opacity 180ms var(--ease-standard),
        filter 180ms var(--ease-standard);
}

.chapter-progress-item:hover:not(.is-disabled) {
    transform: translateY(-1px);
    border-color: rgba(31, 79, 134, 0.18);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 10px 28px rgba(10, 24, 40, 0.1);
}

.chapter-progress-item:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.chapter-progress-item.active {
    border-color: rgba(31, 79, 134, 0.36);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(223, 237, 252, 0.96));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.86) inset,
        0 18px 38px rgba(19, 56, 98, 0.16);
    transform: translateY(-1px);
}

.chapter-progress-item.active::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.34rem;
    background: linear-gradient(180deg, rgba(52, 128, 206, 0.98), rgba(31, 79, 134, 0.98));
}

.chapter-progress-item.active .chapter-progress-title {
    color: var(--brand-ink);
}

.chapter-progress-item.active .chapter-progress-percent {
    color: var(--brand-ink);
    font-weight: 700;
}

.chapter-progress-item.is-disabled {
    opacity: 0.52;
    filter: saturate(0.7);
    cursor: not-allowed;
    box-shadow: none;
}

.chapter-progress-item.is-disabled:hover {
    transform: none;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.52);
}

.chapter-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chapter-progress-head strong {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    line-height: 1.2;
}

.chapter-progress-title {
    color: var(--text);
}

.chapter-progress-percent {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.chapter-progress-bar {
    height: 0.3rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(31, 79, 134, 0.08);
}

.chapter-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(31, 79, 134, 0.72), rgba(31, 79, 134, 0.95));
}

.chapter-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    line-height: 1;
    transform: translateY(-0.015rem);
}

.chapter-lock svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.chapter-lock-open {
    color: var(--success);
}

.chapter-lock-closed {
    color: var(--error);
}

.chapter-progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.progress-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.4rem;
    padding: 0.08rem 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.1;
}

.progress-pill-success {
    color: var(--success);
    border-color: rgba(23, 114, 69, 0.14);
    background: rgba(23, 114, 69, 0.08);
}

.progress-pill-warning {
    color: var(--warning);
    border-color: rgba(163, 106, 18, 0.14);
    background: rgba(255, 244, 224, 0.72);
}

.chapter-reset-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

.chapter-reset-button {
    min-height: 1.7rem;
    padding: 0.18rem 0.48rem;
    font-size: 0.72rem;
    box-shadow: none;
    color: #fff;
    border: 1px solid rgba(176, 48, 58, 0.16);
    background: linear-gradient(180deg, rgba(210, 76, 88, 0.98), rgba(176, 48, 58, 0.98));
}

.chapter-reset-button:hover {
    color: #fff;
}

.chapter-reset-button svg {
    width: 0.82rem;
    height: 0.82rem;
    fill: currentColor;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
}

.status-pill.success {
    background: rgba(23, 114, 69, 0.08);
    color: var(--success);
}

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

.chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.chapter-progress-header {
    display: grid;
    justify-items: start;
    gap: 0;
}

.chapter-progress-header h3,
.chapter-progress-header small {
    margin: 0;
    line-height: 1.1;
}

.chat-header-text {
    gap: 0.45rem;
}

.chat-thread {
    display: grid;
    gap: 1rem;
    max-height: 46rem;
    padding-right: 0.25rem;
    overflow: auto;
}

.chat-message {
    display: grid;
    gap: 0.45rem;
}

.chat-message-user {
    justify-items: end;
}

.chat-message-system {
    justify-items: start;
}

.chat-message-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.88rem;
}

.chat-bubble {
    width: min(100%, 48rem);
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.chat-message-user .chat-bubble {
    border-color: rgba(31, 79, 134, 0.22);
    background: rgba(31, 79, 134, 0.12);
}

.chat-bubble p {
    margin: 0;
    color: var(--text);
}

.streaming-placeholder {
    color: var(--muted);
    font-style: italic;
}

.streaming-active {
    opacity: 1;
}

.streaming-active::after {
    content: "▍";
    display: inline-block;
    margin-left: 0.18rem;
    color: var(--brand);
    animation: streaming-caret 0.85s steps(1, end) infinite;
}

@keyframes streaming-caret {
    50% {
        opacity: 0;
    }
}

.learner-reset-block {
    padding-top: 0.25rem;
}

.md p {
    margin: 0.55rem 0 0;
    color: var(--text);
}

.md p:first-child {
    margin-top: 0;
}

.md ul,
.md ol {
    margin: 0.55rem 0 0;
    padding-left: 1.2rem;
    color: var(--text);
}

.md ul:first-child,
.md ol:first-child {
    margin-top: 0;
}

.md li {
    margin: 0.2rem 0;
}

.md h1,
.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
    margin: 0.8rem 0 0.35rem;
    color: var(--ink);
    line-height: 1.25;
}

.md h1:first-child,
.md h2:first-child,
.md h3:first-child,
.md h4:first-child,
.md h5:first-child,
.md h6:first-child {
    margin-top: 0;
}

.md blockquote {
    margin: 0.75rem 0 0;
    padding: 0.25rem 0 0.25rem 0.85rem;
    border-left: 3px solid rgba(31, 79, 134, 0.35);
    color: var(--muted);
}

.md a {
    color: var(--brand-ink);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

.md code {
    padding: 0.12rem 0.35rem;
    border-radius: 0.4rem;
    background: rgba(31, 79, 134, 0.12);
    color: var(--text);
}

.md pre {
    margin: 0.75rem 0 0;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(31, 79, 134, 0.08);
    overflow: auto;
}

.md pre code {
    padding: 0;
    background: transparent;
    white-space: pre;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.56);
}

.md-table th,
.md-table td {
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.md-table th {
    font-weight: 700;
    color: var(--ink);
    background: rgba(31, 79, 134, 0.08);
}

.md-table tr:last-child td {
    border-bottom: 0;
}

.md-img {
    display: block;
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    margin-top: 0.75rem;
    cursor: zoom-in;
}

.md-img:first-child {
    margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
    .streaming-active::after {
        animation: none;
    }
}

.source-block {
    width: min(100%, 48rem);
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.56);
}

.source-block summary {
    cursor: pointer;
    color: var(--brand-ink);
    font-weight: 600;
}

.source-note {
    margin: 0.75rem 0 0;
    color: var(--warning);
}

.source-group {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.source-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1rem;
}

.source-list li {
    display: grid;
    gap: 0.1rem;
}

.source-preview-link {
    width: fit-content;
    margin-top: 0.4rem;
}

.source-preview {
    width: 100%;
    max-width: 240px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    display: block;
    cursor: zoom-in;
}

.session-list {
    display: grid;
    gap: 0.75rem;
}

.session-item {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.52);
    text-decoration: none;
    transition: background-color 120ms ease, transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.82);
    transform: translateY(-1px);
}

.session-item.active {
    position: relative;
    border-color: rgba(31, 79, 134, 0.34);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(226, 239, 252, 0.94));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.88) inset,
        0 14px 30px rgba(19, 56, 98, 0.14);
}

.session-item.active::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.36rem;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: linear-gradient(180deg, rgba(52, 128, 206, 0.98), rgba(31, 79, 134, 0.98));
}

.session-item.active strong,
.session-item.active span,
.session-item.active small {
    color: var(--brand-ink);
}

.chapter-reset-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(8, 16, 22, 0.34);
    backdrop-filter: blur(8px);
}

.chapter-reset-modal-card {
    width: min(100%, 26rem);
    padding: 1.15rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 20px 60px rgba(10, 24, 40, 0.2);
}

.chapter-reset-modal-eyebrow {
    margin: 0 0 0.3rem;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chapter-reset-modal-card h3 {
    margin: 0 0 0.45rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms var(--ease-standard);
}

.lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 22, 0.7);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 1200px);
    display: grid;
    gap: 0.85rem;
}

.lightbox-toolbar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.lightbox-action {
    min-height: 2.5rem;
    min-width: 2.8rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.lightbox-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-action:disabled {
    opacity: 0.5;
    cursor: default;
}

.lightbox-action-close {
    padding-inline: 1rem;
}

.lightbox-figure {
    position: relative;
    margin: 0;
    width: 100%;
    max-height: calc(100vh - 6.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(4, 11, 20, 0.28);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.2);
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
    transition: width 180ms var(--ease-standard), height 180ms var(--ease-standard);
    cursor: zoom-in;
}

.lightbox.is-zoomed .lightbox-figure {
    justify-content: flex-start;
    align-items: flex-start;
}

.lightbox.is-zoomed .lightbox-image {
    cursor: zoom-out;
}

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

.data-table th,
.data-table td {
    padding: 0.9rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    color: var(--text);
    font-size: 0.95rem;
}

.site-footer .container {
    padding: 1.2rem 0 2rem;
}

@media (max-width: 820px) {
    .learner-shell,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .site-header .container,
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .chat-header {
        flex-direction: column;
    }

    .lightbox {
        padding: 1rem;
    }

    .lightbox-figure {
        padding: 0.7rem;
        max-height: calc(100vh - 7.5rem);
    }

    .admin-filters-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .admin-filters-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        justify-content: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header,
    .site-footer,
    .topbar,
    .panel,
    .flash {
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
