:root {
    color-scheme: light;
    --bg: #f5f7f9;
    --panel: #ffffff;
    --panel-soft: #eef3f7;
    --text: #17212b;
    --muted: #667382;
    --line: #d9e0e7;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --danger: #b42318;
    --warning: #9a5b13;
    --success: #167647;
    --accent: #c47f16;
    --info: #2f5f98;
}

/* Learning v2 */
:root { --shadow-sm:0 1px 2px rgba(16,24,40,.05); --shadow-md:0 12px 30px rgba(16,24,40,.08); }
.brand-mark{align-items:center;background:var(--brand);border-radius:10px;display:inline-flex;height:36px;justify-content:center;width:36px}.brand strong{color:#87ddd3}.nav .admin-link{background:rgba(255,255,255,.1);border-radius:7px;padding:8px 11px}.account-menu{position:relative}.account-menu summary{align-items:center;cursor:pointer;display:flex;gap:8px;list-style:none}.account-menu summary::-webkit-details-marker{display:none}.account-menu>div{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow-md);display:grid;min-width:180px;padding:8px;position:absolute;right:0;top:42px;z-index:20}.account-menu>div a{color:var(--text);padding:8px}.avatar{align-items:center;background:#d9f3ef;border-radius:50%;color:var(--brand-dark);display:inline-flex;font-weight:800;height:32px;justify-content:center;width:32px}.admin-subnav{background:#fff;border-bottom:1px solid var(--line);display:flex;gap:24px;padding:11px max(28px,calc((100vw - 1180px)/2 + 28px))}.admin-subnav a{color:var(--muted);font-size:13px;font-weight:700}
.empty-state{background:var(--panel);border:1px dashed #bcc8d3;border-radius:14px;padding:44px 24px;text-align:center}.empty-state h2{margin-top:0}.learning-grid{display:grid;gap:18px;grid-template-columns:repeat(3,minmax(0,1fr))}.learning-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-sm);overflow:hidden}.learning-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);transition:.18s ease}.route-cover{background:linear-gradient(135deg,var(--route-color),color-mix(in srgb,var(--route-color),#fff 55%));height:100px}.learning-card-body{display:flex;flex-direction:column;gap:10px;min-height:245px;padding:20px}.learning-card-body h2,.learning-card-body h3{margin:0}.learning-card-body form{margin-top:auto}.learning-card.compact .route-cover{height:62px}.learning-card.compact .learning-card-body{min-height:190px}.status-text{color:var(--muted);font-size:12px;font-weight:700}.status-overdue,.status-completed_late{color:var(--danger)}.status-completed{color:var(--success)}.deadline{color:var(--warning);font-size:13px;font-weight:700}
.route-hero{align-items:center;background:linear-gradient(135deg,color-mix(in srgb,var(--route-color),#fff 88%),#fff);border:1px solid color-mix(in srgb,var(--route-color),#fff 65%);border-radius:18px;display:flex;justify-content:space-between;min-height:230px;padding:34px}.route-hero h1{font-size:38px;margin:8px 0}.route-hero p{color:var(--muted);max-width:720px}.back-link{display:block;font-size:13px;margin-bottom:18px}.route-progress-number{align-items:center;background:#fff;border:1px solid var(--line);border-radius:50%;display:flex;flex-direction:column;height:130px;justify-content:center;min-width:130px}.route-progress-number strong{font-size:30px}.route-progress-number span{color:var(--muted);font-size:12px}.learning-outline{display:grid;gap:12px}.outline-item{align-items:center;background:#fff;border:1px solid var(--line);border-radius:12px;display:grid;gap:18px;grid-template-columns:44px 1fr auto;padding:18px}.outline-item.locked{background:#f8fafb;opacity:.78}.outline-number{align-items:center;background:var(--panel-soft);border-radius:50%;display:flex;font-weight:800;height:40px;justify-content:center;width:40px}.outline-content h3{margin:2px 0}.outline-content p{margin:3px 0}.outline-actions{align-items:center;display:flex;gap:8px}.outline-actions form{margin:0}.button.ghost{background:transparent;border-color:transparent;color:var(--muted)}.danger-zone{align-items:center;background:#fff8f7;border:1px solid #f5cbc7;border-radius:12px;display:flex;justify-content:space-between;padding:20px}.danger-zone h3,.danger-zone p{margin:0}
.wizard-shell{align-items:start;display:grid;gap:22px;grid-template-columns:220px 1fr}.wizard-steps{background:#fff;border:1px solid var(--line);border-radius:12px;display:grid;gap:6px;padding:14px;position:sticky;top:20px}.wizard-steps span,.wizard-steps strong{border-radius:7px;color:var(--muted);padding:10px}.wizard-steps .active{background:#eaf7f5;color:var(--brand-dark)}.wizard-panel,.wizard-section{background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-sm);padding:24px}.wizard-section{margin-top:18px}.wizard-progress{background:#fff;border:1px solid var(--line);border-radius:10px;display:flex;gap:8px;overflow-x:auto;padding:8px}.wizard-progress a{border-radius:7px;color:var(--muted);font-size:13px;font-weight:700;padding:9px 14px;white-space:nowrap}.wizard-progress a:hover{background:var(--panel-soft);text-decoration:none}.wizard-actions{align-items:center;display:flex;justify-content:space-between;margin-top:10px}.save-indicator{color:var(--success);font-size:12px;font-weight:700}.step-number{align-items:center;background:var(--brand);border-radius:50%;color:#fff;display:inline-flex;font-size:13px;height:28px;justify-content:center;width:28px}.section-title>div{align-items:center;display:flex;gap:10px}.authoring-help,.review-note{align-items:center;background:#eef8f7;border:1px solid #c7e9e4;border-radius:12px;display:flex;gap:14px;margin-bottom:18px;padding:15px}.authoring-help p,.review-note p{margin:2px 0 0}.step-dot{align-items:center;background:var(--brand);border-radius:50%;color:#fff;display:flex;height:32px;justify-content:center;min-width:32px}.admin-card-list,.outline-builder{display:grid;gap:10px}.admin-content-card{align-items:center;background:#fff;border:1px solid var(--line);border-radius:12px;display:grid;gap:16px;grid-template-columns:10px 1fr auto;overflow:hidden;padding:18px}.route-color-dot{align-self:stretch;background:var(--route-color);border-radius:999px}.admin-content-main h2{margin:5px 0}.admin-content-main p{color:var(--muted);margin:0 0 5px}.workflow-badge{background:var(--panel-soft);border-radius:999px;font-size:11px;font-weight:800;padding:4px 9px}.status-published{background:#dff7ea;color:var(--success)}.status-in_review{background:#e5effb;color:var(--info)}.status-changes_requested{background:#fff3d8;color:var(--warning)}.builder-item{align-items:center;border:1px solid var(--line);border-radius:10px;display:grid;gap:12px;grid-template-columns:38px 1fr auto;padding:12px}.builder-item div{display:grid}.builder-item small{color:var(--muted)}.drag-handle,.type-icon{align-items:center;background:var(--panel-soft);border-radius:7px;display:flex;font-weight:800;height:34px;justify-content:center}.quick-add-form{align-items:center;background:#f8fafb;border:1px dashed #b8c5d0;border-radius:10px;display:grid;gap:12px;grid-template-columns:1fr minmax(240px,1fr) auto;margin-top:14px;padding:14px}.quick-add-form p{margin:0}.review-checklist{display:grid;gap:6px;margin-bottom:16px}.review-checklist p{color:var(--muted);margin:0}.review-checklist .done{color:var(--success)}.review-form{display:flex;gap:8px}.authoring-columns{align-items:start}.visual-option{align-items:center;display:grid;gap:10px;grid-template-columns:24px 1fr}.visual-option>input:first-child{min-height:auto;width:auto}.role-route-row{align-items:center;display:flex;justify-content:space-between}
.report-filters{align-items:end;background:#fff;border:1px solid var(--line);border-radius:12px;display:grid;gap:12px;grid-template-columns:repeat(4,1fr) auto;margin-bottom:16px;padding:15px}.report-tabs{background:#fff;border:1px solid var(--line);border-radius:10px;display:flex;gap:4px;overflow-x:auto;padding:6px}.report-tabs a{border-radius:7px;color:var(--muted);font-size:13px;font-weight:700;padding:8px 12px;white-space:nowrap}.report-tabs a:hover{background:var(--panel-soft);text-decoration:none}.report-section{background:#fff;border:1px solid var(--line);border-radius:12px;margin-top:16px;padding:20px;scroll-margin-top:12px}td small{color:var(--muted);display:block}.badge-gallery,.certificate-list{display:grid;gap:10px}.achievement{align-items:center;border:1px solid var(--line);border-radius:10px;display:flex;gap:12px;padding:12px}.achievement p{color:var(--muted);margin:2px 0}.achievement-mark{align-items:center;background:#fff3d8;border-radius:50%;color:var(--accent);display:flex;height:38px;justify-content:center;min-width:38px}.certificate-row{align-items:center;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;padding:10px 0}.certificate-row span:first-child{display:grid}.certificate-row small{color:var(--muted)}.profile-grid{display:grid;gap:10px;grid-template-columns:repeat(3,1fr)}.profile-option{align-items:start;border:1px solid var(--line);border-radius:10px;display:flex;gap:10px;padding:12px}.profile-option input{min-height:auto;width:auto}.profile-option span{display:grid}.profile-option small{color:var(--muted)}.permission-table{display:grid}.permission-table>div{align-items:center;border-bottom:1px solid var(--line);display:grid;gap:10px;grid-template-columns:1fr repeat(3,110px);padding:8px 0}.permission-table span{display:grid}.permission-table label{align-items:center;display:flex;gap:5px}.permission-table input{min-height:auto;width:auto}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    align-items: center;
    background: #101820;
    color: #fff;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    min-height: 70px;
    padding: 0 28px;
}

.brand {
    align-items: center;
    color: #fff;
    display: inline-flex;
    font-size: 18px;
    font-weight: 700;
    gap: 10px;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.nav a {
    color: #dce6ee;
    font-size: 14px;
}

.nav .user-chip {
    color: #ffffff;
    font-size: 13px;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 30px;
    line-height: 1.2;
    margin: 0;
}

.page-header p {
    color: var(--muted);
    margin: 6px 0 0;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.card h2,
.card h3 {
    margin-top: 0;
}

.metric {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.metric strong {
    color: var(--text);
    display: block;
    font-size: 28px;
    line-height: 1.1;
    margin-top: 4px;
    text-transform: none;
}

.dashboard-focus {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
}

.focus-card,
.progress-panel,
.panel,
.topic-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.focus-card {
    align-items: flex-end;
    background: linear-gradient(135deg, #ffffff 0%, #eef7f4 100%);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px;
}

.focus-card h2,
.progress-panel h2,
.panel h2,
.topic-card h2,
.topic-card h3 {
    margin: 0;
}

.focus-card p {
    color: var(--muted);
    margin: 8px 0 0;
}

.eyebrow {
    color: var(--brand-dark);
    display: inline-flex;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.progress-panel {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 20px;
}

.progress-ring {
    align-items: center;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at center, #fff 58%, transparent 60%),
        conic-gradient(var(--brand) 0deg, var(--brand) var(--progress-deg), var(--panel-soft) var(--progress-deg), var(--panel-soft) 360deg);
    border: 1px solid var(--line);
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.progress-ring strong {
    font-size: 24px;
    line-height: 1;
}

.progress-ring span {
    color: var(--muted);
    font-size: 11px;
}

.metric-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
}

.metric-tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 14px;
    text-transform: uppercase;
}

.metric-tile strong {
    color: var(--text);
    display: block;
    font-size: 24px;
    line-height: 1.1;
    margin-top: 4px;
    text-transform: none;
}

.section-gap {
    margin-top: 18px;
}

.section-title {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
}

.panel {
    padding: 18px;
}

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

.mini-badge {
    align-items: center;
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.mini-badge img {
    aspect-ratio: 1;
    height: 72px;
    object-fit: contain;
    width: 72px;
}

.mini-badge span {
    font-size: 12px;
    font-weight: 700;
}

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

.event-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: 58px minmax(0, 1fr);
    padding-bottom: 10px;
}

.event-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.event-row strong {
    color: var(--success);
}

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

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

.topic-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 240px;
    padding: 18px;
}

.topic-card-top,
.topic-card-footer,
.topic-card-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.topic-card p {
    margin: 0;
}

.topic-card-footer,
.topic-card-meta {
    color: var(--muted);
    font-size: 13px;
    margin-top: auto;
}

.button,
button {
    align-items: center;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 650;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    text-decoration: none;
}

.button:hover,
button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.button.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.button.secondary:hover {
    background: var(--panel-soft);
}

.button.danger {
    background: var(--danger);
    border-color: var(--danger);
}

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

.form-fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 14px;
}

.form-fieldset legend {
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
    padding: 0 6px;
}

.form-hint {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.field-section {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    padding: 14px;
}

.field-section.optional {
    background: #fafbfc;
}

.advanced-fields summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    list-style: none;
}

.advanced-fields summary::-webkit-details-marker {
    display: none;
}

.advanced-fields summary::before {
    color: var(--muted);
    content: "+";
    font-size: 18px;
    font-weight: 750;
    line-height: 1;
}

.advanced-fields[open] summary {
    margin-bottom: 14px;
}

.advanced-fields[open] summary::before {
    content: "-";
}

.details-summary-text {
    display: grid;
    flex: 1;
    gap: 3px;
}

.details-summary-text strong {
    color: var(--text);
    font-size: 16px;
}

.details-summary-text small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.field-section-title {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.field-section-title h3 {
    font-size: 16px;
    margin: 0;
}

.field-label {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.required-mark,
.optional-mark {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    padding: 5px 8px;
}

.required-mark {
    background: #fff4e5;
    color: var(--warning);
}

.optional-mark {
    background: var(--panel-soft);
    color: var(--muted);
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    font-weight: 650;
    gap: 6px;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.checkbox-row input {
    min-height: auto;
    width: auto;
}

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

.topic-media {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
}

.topic-media-item {
    display: grid;
    gap: 14px;
}

.topic-media-item + .topic-media-item {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.topic-media-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.topic-media-header h2 {
    font-size: 20px;
    line-height: 1.2;
    margin: 0;
}

.topic-media-header p {
    color: var(--muted);
    margin: 6px 0 0;
}

.media-frame {
    aspect-ratio: 16 / 9;
    background: #101820;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.media-frame.document {
    aspect-ratio: 4 / 3;
    min-height: min(72vh, 680px);
}

.media-frame iframe,
.media-video {
    border: 0;
    display: block;
    height: 100%;
    width: 100%;
}

.media-video {
    aspect-ratio: 16 / 9;
    background: #101820;
    border-radius: 8px;
    height: auto;
}

.media-image {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    height: auto;
    max-height: 680px;
    object-fit: contain;
    width: 100%;
}

.media-download {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 14px;
}

.media-download strong,
.media-download span {
    display: block;
}

.media-download span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.media-actions {
    justify-content: flex-end;
}

.media-attribution {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.row-actions {
    align-items: center;
    gap: 10px;
}

.row-actions form {
    margin: 0;
}

.row-actions .button {
    min-height: 34px;
    padding: 6px 10px;
}

.topic-progress {
    margin-bottom: 18px;
}

.topic-progress h2 {
    margin: 0;
}

.topic-progress-header {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.topic-progress-header p {
    color: var(--muted);
    margin: 6px 0 0;
}

.topic-progress-header strong {
    color: var(--brand-dark);
    font-size: 26px;
    line-height: 1;
}

.topic-progress-track {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    height: 16px;
    margin-top: 12px;
    overflow: hidden;
}

.topic-progress-track span {
    background: linear-gradient(90deg, #0f766e 0%, #2e9a90 100%);
    display: block;
    height: 100%;
}

.topic-progress-hint {
    color: var(--muted);
    margin: 10px 0 0;
}

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

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    background: var(--panel-soft);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-size: 12px;
    font-weight: 650;
    padding: 3px 9px;
}

.badge.success {
    background: #dff7ea;
    color: var(--success);
}

.badge.warning {
    background: #fff3d8;
    color: var(--warning);
}

.badge.danger {
    background: #fee4e2;
    color: var(--danger);
}

.flash,
.attempt-result {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.flash.success {
    background: #dff7ea;
    color: var(--success);
}

.flash.error {
    background: #fee4e2;
    color: var(--danger);
}

.attempt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.attempt-result {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 18px;
}

.attempt-result.success {
    border-color: #9bd7b3;
}

.attempt-result.error {
    border-color: #f1aaa4;
}

.attempt-result-header {
    align-items: flex-start;
    display: grid;
    gap: 12px;
    grid-template-columns: 96px minmax(0, 1fr);
}

.attempt-result-header p {
    color: var(--muted);
    margin: 6px 0 0;
}

.result-mark {
    align-items: center;
    background: var(--panel-soft);
    border-radius: 8px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 750;
    justify-content: center;
    min-height: 42px;
    padding: 8px;
}

.attempt-result.success .result-mark {
    background: #dff7ea;
    color: var(--success);
}

.attempt-result.error .result-mark {
    background: #fee4e2;
    color: var(--danger);
}

.attempt-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}

.attempt-stat {
    background: var(--panel-soft);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 12px;
    text-transform: uppercase;
}

.attempt-stat strong {
    color: var(--text);
    display: block;
    font-size: 22px;
    margin-top: 4px;
    text-transform: none;
}

.reward-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.reward-list span {
    background: #fff7e8;
    border: 1px solid #f1d09c;
    border-radius: 999px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
}

.next-step {
    background: #eef3f7;
    border-radius: 8px;
    display: grid;
    gap: 2px;
    margin-top: 14px;
    padding: 12px;
}

.next-step span,
.next-step small {
    color: var(--muted);
}

.options {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.scenario-box {
    background: #eef7f4;
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.option {
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 12px;
}

.option input {
    margin-top: 4px;
    min-height: auto;
    width: auto;
}

.progress-bar {
    background: var(--panel-soft);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress-bar.large {
    height: 12px;
    margin-top: 10px;
}

.progress-bar span {
    background: var(--brand);
    display: block;
    height: 100%;
}

.topic-progress-cell {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(90px, 1fr) 44px;
    min-width: 160px;
}

.topic-progress-cell span {
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

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

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.directory-search {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.directory-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.user-directory-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
    min-height: 190px;
    padding: 18px;
}

.user-card h2 {
    font-size: 20px;
    line-height: 1.25;
    margin: 0 0 8px;
}

.user-card p {
    margin: 3px 0 0;
}

.code-box {
    background: #101820;
    border-radius: 8px;
    color: #e6edf3;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    overflow-x: auto;
    padding: 12px;
    white-space: pre-wrap;
}

.filter-toolbar {
    display: grid;
    gap: 12px;
}

.filter-toolbar strong {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--muted);
}

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 14px;
    text-decoration: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.filter-chip:hover {
    background: #e4ecef;
    text-decoration: none;
}

.filter-chip.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

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

.badge-item {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    padding: 10px;
}

.badge-art {
    aspect-ratio: 1;
    border-radius: 8px;
    flex: 0 0 72px;
    height: 72px;
    object-fit: contain;
    width: 72px;
}

.badge-zoom-trigger {
    border-radius: 10px;
    display: inline-flex;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.badge-zoom-trigger:hover {
    box-shadow: 0 10px 24px rgba(16, 24, 32, 0.14);
    text-decoration: none;
    transform: scale(1.04);
}

.badge-lightbox {
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.18s ease;
    z-index: 40;
}

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

.badge-lightbox-backdrop {
    background: rgba(16, 24, 32, 0.72);
    inset: 0;
    position: absolute;
}

.badge-lightbox-dialog {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(16, 24, 32, 0.35);
    left: 50%;
    max-width: min(92vw, 560px);
    padding: 20px;
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.badge-lightbox-dialog strong {
    display: block;
    font-size: 20px;
    margin-top: 10px;
}

.badge-lightbox-art {
    aspect-ratio: 1;
    display: block;
    height: auto;
    margin: 8px auto 0;
    max-height: 58vh;
    max-width: 100%;
    object-fit: contain;
    width: min(100%, 360px);
}

.badge-lightbox-close {
    align-items: center;
    background: var(--panel-soft);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    margin-left: auto;
    min-height: 34px;
    padding: 6px 12px;
}

.badge-lightbox-close:hover {
    background: #dde6ec;
    text-decoration: none;
}

@media (max-width: 900px) {
    .learning-grid,
    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .wizard-steps {
        display: flex;
        overflow-x: auto;
        position: static;
    }

    .permission-table > div {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .topbar,
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .container {
        padding: 20px;
    }

    .grid-2,
    .grid-3,
    .learning-grid,
    .profile-grid,
    .report-filters,
    .dashboard-focus,
    .metric-strip,
    .topic-grid,
    .user-directory-grid,
    .attempt-stats {
        grid-template-columns: 1fr;
    }

    .route-hero,
    .danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }

    .route-progress-number {
        height: 100px;
        min-width: 100px;
    }

    .outline-item {
        grid-template-columns: 38px 1fr;
    }

    .outline-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .outline-actions .button,
    .outline-actions form {
        width: 100%;
    }

    .quick-add-form,
    .admin-content-card {
        grid-template-columns: 1fr;
    }

    .admin-content-card .route-color-dot {
        height: 8px;
    }

    .admin-subnav {
        overflow-x: auto;
        padding: 10px 20px;
    }

    .account-menu summary > span:last-child {
        display: none;
    }

    .wizard-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .review-form {
        flex-direction: column;
    }

    .focus-card,
    .directory-search,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .directory-search {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .directory-search label {
        width: 100%;
    }

    .focus-actions,
    .directory-search-actions,
    .attempt-actions,
    .media-download {
        width: 100%;
    }

    .focus-actions .button,
    .directory-search-actions .button,
    .directory-search-actions button,
    .attempt-actions .button,
    .media-download .button,
    .media-actions .button {
        width: 100%;
    }

    .topic-media-header,
    .media-download {
        align-items: stretch;
        flex-direction: column;
    }

    .topic-progress-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .progress-panel,
    .attempt-result-header {
        grid-template-columns: 1fr;
    }

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