:root {
    --admin-ink: #17201d;
    --admin-muted: #66716d;
    --admin-line: #dce2df;
    --admin-surface: #ffffff;
    --admin-canvas: #f4f6f5;
    --admin-sidebar: #182320;
    --admin-accent: #16725a;
    --admin-accent-dark: #0f5945;
    --admin-warning: #a86416;
    --admin-danger: #b33a3a;
}

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); background: var(--admin-canvas); color: var(--admin-ink); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: 20px 14px; background: var(--admin-sidebar); color: #fff; }
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; color: #fff; text-decoration: none; }
.admin-brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #e6b85c; color: #1c241f; border-radius: 6px; font-size: 18px; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 14px; }
.admin-brand small { color: #aebbb6; font-size: 11px; margin-top: 1px; }
.admin-nav { display: grid; gap: 4px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 3px; }
.admin-nav a, .admin-sidebar-footer a { display: flex; align-items: center; gap: 11px; padding: 10px 11px; color: #bdc8c4; text-decoration: none; border-radius: 6px; font-size: 14px; }
.admin-nav a:hover, .admin-nav a.active, .admin-sidebar-footer a:hover { background: #26332f; color: #fff; }
.admin-nav a.active { box-shadow: inset 3px 0 #48b996; }
.admin-nav i, .admin-sidebar-footer i { width: 18px; text-align: center; font-size: 16px; }
.admin-sidebar-footer { flex: 0 0 auto; margin-top: auto; border-top: 1px solid #33413c; padding-top: 12px; }
.admin-main { min-width: 0; }
.admin-topbar { height: 58px; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--admin-line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.admin-environment { color: var(--admin-muted); font-size: 13px; font-weight: 600; }
.admin-content { padding: 28px; max-width: 1600px; margin: 0 auto; }
.admin-page-heading, .admin-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-page-heading { margin-bottom: 24px; }
.admin-page-heading h1, .catalog-list-header h1, .catalog-title-meta h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: 0; }
.admin-page-heading p, .admin-section-heading p { color: var(--admin-muted); margin: 5px 0 0; font-size: 13px; }
.admin-eyebrow { color: var(--admin-accent) !important; margin: 0 0 4px !important; font-size: 11px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .08em !important; }
.admin-command, .admin-icon-button { border: 1px solid #cbd3d0; background: #fff; color: var(--admin-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.admin-command { padding: 7px 12px; }
.admin-icon-button { width: 36px; padding: 0; flex: 0 0 36px; }
.admin-command:hover, .admin-icon-button:hover { border-color: #8e9b96; color: var(--admin-ink); background: #f7f9f8; }
.admin-command.primary, .admin-icon-button.primary { background: var(--admin-accent); border-color: var(--admin-accent); color: #fff; }
.admin-command.primary:hover, .admin-icon-button.primary:hover { background: var(--admin-accent-dark); color: #fff; }
.admin-command:disabled, .admin-icon-button:disabled { opacity: .45; cursor: not-allowed; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--admin-line); background: var(--admin-surface); border-radius: 6px; margin-bottom: 24px; }
.admin-metric { padding: 18px 20px; border-right: 1px solid var(--admin-line); }
.admin-metric:last-child { border-right: 0; }
.admin-metric span, .admin-metric small { display: block; color: var(--admin-muted); font-size: 12px; }
.admin-metric strong { display: block; font-size: 26px; margin: 4px 0; }
.admin-section { background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 6px; }
.admin-section-heading { padding: 18px 20px; border-bottom: 1px solid var(--admin-line); align-items: center; }
.admin-section-heading h2 { margin: 0; font-size: 17px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 20px; background: #f8faf9; color: var(--admin-muted); font-size: 11px; text-transform: uppercase; font-weight: 700; }
.admin-table td { padding: 13px 20px; border-top: 1px solid #edf0ef; vertical-align: middle; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { color: var(--admin-muted); margin-top: 2px; }
.admin-status { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #edf0ef; color: #59635f; }
.admin-status.done, .admin-status.succeeded { background: #dff2e9; color: #17654d; }
.admin-status.running, .admin-status.processing { background: #dceef5; color: #22647c; }
.admin-status.queued, .admin-status.enqueued { background: #fff0d8; color: #85520f; }
.admin-status.failed { background: #f8dddd; color: #9d2f2f; }
.admin-loading { padding: 50px; text-align: center; color: var(--admin-muted); }
.admin-empty { min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 6px; padding: 28px; color: var(--admin-muted); }
.admin-empty.large { min-height: 65vh; }
.admin-empty i { font-size: 28px; color: #8fa09a; margin-bottom: 4px; }
.admin-empty strong { color: var(--admin-ink); }

.catalog-shell { min-height: calc(100vh - 115px); display: grid; grid-template-columns: 294px minmax(0, 1fr); background: #fff; border: 1px solid var(--admin-line); border-radius: 6px; overflow: hidden; }
.catalog-list-pane { border-right: 1px solid var(--admin-line); min-width: 0; background: #fafbfa; }
.catalog-list-header { display: flex; align-items: center; justify-content: space-between; padding: 18px; }
.catalog-list-header h1 { font-size: 23px; }
.admin-search { margin: 0 14px 10px; position: relative; }
.admin-search i { position: absolute; left: 10px; top: 9px; color: #7b8883; }
.admin-search input { width: 100%; height: 36px; border: 1px solid #cad2cf; border-radius: 5px; background: #fff; padding: 7px 10px 7px 32px; font-size: 13px; }
.catalog-filter { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; margin: 0 14px 12px; background: #e9edeb; padding: 3px; border-radius: 6px; }
.catalog-filter button { border: 0; border-radius: 4px; background: transparent; padding: 6px; font-size: 12px; color: var(--admin-muted); }
.catalog-filter button.active { background: #fff; color: var(--admin-ink); box-shadow: 0 1px 2px rgba(20,40,33,.1); }
.catalog-title-list { overflow-y: auto; max-height: calc(100vh - 260px); padding: 0 8px 12px; }
.catalog-title-row { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) 10px; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--admin-ink); }
.catalog-title-row:hover { background: #f0f3f2; }
.catalog-title-row.selected { background: #e6f1ed; box-shadow: inset 3px 0 var(--admin-accent); }
.catalog-title-thumb { width: 38px; height: 46px; display: grid; place-items: center; overflow: hidden; background: #dfe5e2; color: #53635d; border-radius: 4px; }
.catalog-title-thumb img { width: 100%; height: 100%; object-fit: cover; }
.catalog-title-copy { min-width: 0; }
.catalog-title-copy strong, .catalog-title-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-title-copy strong { font-size: 13px; }
.catalog-title-copy small { color: var(--admin-muted); font-size: 11px; margin-top: 3px; }
.admin-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #a9b2af; }
.admin-dot.published { background: #27a276; }
.admin-dot.draft { background: #d29743; }
.catalog-detail-pane { min-width: 0; }
.catalog-title-hero { min-height: 184px; padding: 22px 24px; display: grid; grid-template-columns: 104px minmax(0,1fr) auto; gap: 20px; border-bottom: 1px solid var(--admin-line); background: #fff; }
.catalog-poster { width: 104px; aspect-ratio: 2/3; background: #dce3e0; border-radius: 5px; overflow: hidden; display: grid; place-items: center; color: #53615c; font-size: 30px; }
.catalog-poster img { width: 100%; height: 100%; object-fit: cover; }
.catalog-title-meta h1 { margin: 7px 0; }
.catalog-title-meta > p { color: var(--admin-muted); max-width: 720px; font-size: 13px; line-height: 1.55; margin: 0 0 12px; }
.catalog-kicker { display: flex; gap: 7px; flex-wrap: wrap; }
.catalog-kicker span { color: #52605b; font-size: 11px; text-transform: uppercase; font-weight: 700; }
.catalog-kicker span + span::before { content: "·"; margin-right: 7px; color: #a3aca9; }
.catalog-readiness { font-size: 12px; color: var(--admin-muted); }
.catalog-readiness strong { color: var(--admin-accent); }
.catalog-title-actions { display: flex; align-items: flex-start; gap: 8px; }
.season-toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; padding: 9px 20px; border-bottom: 1px solid var(--admin-line); gap: 12px; }
.season-tabs { display: flex; gap: 4px; overflow-x: auto; }
.season-tabs button { border: 0; background: transparent; padding: 8px 10px; border-radius: 5px; color: var(--admin-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.season-tabs button.active { color: var(--admin-accent-dark); background: #e6f1ed; }
.season-tabs span { margin-left: 4px; color: #89938f; }
.catalog-episodes { border: 0; border-radius: 0; }
.episode-list { width: 100%; }
.episode-row { min-height: 67px; padding: 10px 16px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #edf0ef; }
.episode-main { min-width: 0; }
.episode-chips { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.episode-row:hover { background: #fbfcfb; }
.episode-number { font-size: 12px; font-weight: 800; color: var(--admin-accent); }
.episode-copy { min-width: 0; }
.episode-copy strong, .episode-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-copy strong { font-size: 13px; }
.episode-copy small { color: var(--admin-muted); font-size: 11px; margin-top: 3px; }
.asset-state { display: flex; align-items: center; gap: 6px; color: #9aa39f; font-size: 11px; }
.asset-state i { font-size: 15px; }
.asset-state i.ready { color: var(--admin-accent); }
.episode-state { display: flex; align-items: center; gap: 6px; color: var(--admin-muted); font-size: 11px; }
.episode-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.episode-actions .admin-icon-button { width: 31px; height: 31px; min-height: 31px; flex-basis: 31px; }
.episode-action-panel { margin: 0; min-height: 74px; padding: 12px 18px 12px 74px; display: flex; align-items: center; gap: 18px; background: #f5f8f7; border-bottom: 1px solid var(--admin-line); }
.episode-action-panel label { flex: 1; font-size: 12px; }
.episode-action-panel label span, .episode-action-panel label small, .process-panel span strong, .process-panel span small { display: block; }
.episode-action-panel label span { font-weight: 700; margin-bottom: 4px; }
.episode-action-panel label small, .process-panel span small { color: var(--admin-muted); margin-top: 3px; }
.process-panel > span { margin-right: auto; }
.inline-create-row, .episode-editor, .catalog-editor-band { background: #f7f9f8; border-bottom: 1px solid var(--admin-line); }
.inline-create-row { padding: 14px 20px; display: grid; grid-template-columns: 150px minmax(180px,1fr) auto; gap: 10px; align-items: end; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.season-commands { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.inline-create-row label span, .admin-form-grid label > span { display: block; color: #53605b; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.inline-create-row input, .admin-form-grid input:not([type=checkbox]), .admin-form-grid select, .admin-form-grid textarea { width: 100%; border: 1px solid #c8d1cd; border-radius: 5px; background: #fff; padding: 8px 9px; font-size: 13px; min-height: 36px; }
.episode-editor { padding: 16px 20px; }
.catalog-editor-band { padding: 22px 24px; }
.catalog-editor-band .admin-section-heading { padding: 0 0 18px; border: 0; }
.admin-form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.admin-form-grid label.wide { grid-column: span 2; }
.admin-form-grid textarea { resize: vertical; }
.admin-check { display: flex; align-items: center; gap: 8px; }
.admin-check input { width: 16px; height: 16px; accent-color: var(--admin-accent); }
.admin-check span { margin: 0 !important; }
.admin-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.admin-notice { margin: 12px 20px 0; padding: 9px 11px; border-radius: 5px; display: flex; gap: 8px; align-items: center; font-size: 12px; }
.admin-notice.success { color: #155d48; background: #e3f2ec; }
.admin-notice.error { color: #932f2f; background: #fae7e7; }

@media (max-width: 1100px) {
    .admin-shell { grid-template-columns: 68px minmax(0,1fr); }
    .admin-sidebar { padding: 16px 9px; }
    .admin-brand { padding-left: 8px; }
    .admin-brand > span:last-child, .admin-nav span, .admin-sidebar-footer span { display: none; }
    .admin-nav a, .admin-sidebar-footer a { justify-content: center; }
    .catalog-shell { grid-template-columns: 250px minmax(0,1fr); }
    .episode-chips .asset-state span { display: none; }
}

@media (max-width: 760px) {
    .admin-shell { display: block; }
    .admin-sidebar { position: fixed; z-index: 40; bottom: 0; top: auto; width: 100%; height: 58px; padding: 5px 10px; flex-direction: row; }
    .admin-brand, .admin-sidebar-footer { display: none; }
    .admin-nav { width: 100%; display: flex; gap: 3px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-gutter: auto; padding: 0 0 3px; }
    .admin-nav a { flex: 0 0 72px; justify-content: center; flex-direction: column; gap: 0; padding: 3px; font-size: 10px; }
    .admin-nav span { display: block; }
    .admin-nav a.active { box-shadow: inset 0 -3px #48b996; }
    .admin-topbar { padding: 0 14px; }
    .admin-content { padding: 12px 12px 74px; }
    .admin-metrics { grid-template-columns: 1fr 1fr; }
    .admin-metric:nth-child(2) { border-right: 0; }
    .admin-metric:nth-child(-n+2) { border-bottom: 1px solid var(--admin-line); }
    .catalog-shell { display: block; }
    .catalog-list-pane { border-right: 0; border-bottom: 1px solid var(--admin-line); }
    .catalog-title-list { display: flex; overflow-x: auto; max-height: none; }
    .catalog-title-row { min-width: 230px; }
    .catalog-title-hero { grid-template-columns: 72px minmax(0,1fr); padding: 16px; }
    .catalog-poster { width: 72px; }
    .catalog-title-actions { grid-column: 1/-1; }
    .episode-row { grid-template-columns: 36px minmax(0,1fr); }
    .episode-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .season-toolbar { flex-wrap: wrap; }
    .episode-action-panel { padding: 12px; flex-wrap: wrap; }
    .upload-panel label { flex-basis: 100%; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-form-grid label.wide { grid-column: span 1; }
    .inline-create-row { grid-template-columns: 1fr; }
}

/* ---------- Quiz & phrases (StudyContent.razor) ---------- */
.admin-notice.warning { color: #7a4a0c; background: #fff3dc; }
.asset-state.study-state { text-decoration: none; color: inherit; }
.asset-state.study-state:hover span { text-decoration: underline; }
.admin-icon-button.danger:hover { color: var(--admin-danger); border-color: var(--admin-danger); background: #fdf1f1; }
.text-ok { color: var(--admin-accent); }
.muted { color: var(--admin-muted); font-size: 13px; }

.study-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--admin-muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.study-back:hover { color: var(--admin-ink); }
.admin-page-heading + .admin-notice, .study-cards { margin-left: 0; margin-right: 0; }
.admin-notice { margin-bottom: 4px; }

.study-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0 22px; }
.study-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.study-card-head { display: flex; gap: 12px; align-items: center; }
.study-card-head strong { display: block; font-size: 16px; }
.study-card-head small { color: var(--admin-muted); font-size: 12px; }
.study-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: #e3f2ec; color: var(--admin-accent); font-size: 18px; flex: 0 0 auto; }

.job-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--admin-muted); width: 100%; }
.job-line .admin-status { gap: 5px; }
.job-error { flex-basis: 100%; margin: 2px 0 0; padding: 8px 10px; border-radius: 5px; background: #fae7e7; color: #932f2f; line-height: 1.4; }
.spin { display: inline-block; animation: study-spin 1s linear infinite; }
@keyframes study-spin { to { transform: rotate(360deg); } }

.study-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--admin-line); margin-bottom: -1px; }
.study-tabs button { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 9px 14px; border-radius: 6px 6px 0 0; font-size: 13px; font-weight: 600; color: var(--admin-muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.study-tabs button.active { background: var(--admin-surface); border-color: var(--admin-line); color: var(--admin-ink); }
.study-tabs .count { background: #edf0ef; border-radius: 999px; padding: 1px 7px; font-size: 11px; }
.study-panel { border-top-left-radius: 0; }

.study-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #edf0ef; }
.study-toolbar .admin-search { margin: 0; flex: 0 1 320px; }

.study-list { list-style: none; margin: 0; padding: 0; }
.study-list.questions { counter-reset: q; }
.study-item { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid #edf0ef; }
.study-list.questions > .study-item { counter-increment: q; }
.study-list.questions > .study-item .study-item-main > strong::before { content: counter(q) ". "; color: var(--admin-muted); }
.study-item-main { min-width: 0; flex: 1; }
.study-item-main p { margin: 3px 0 0; font-size: 13px; }
.study-item .term { font-size: 15px; }
.study-item .translation { margin-left: 8px; color: var(--admin-accent); font-size: 13px; }
.study-item blockquote { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid #dce2df; color: #4f5a56; font-size: 12px; font-style: italic; }
.study-item .structure { display: block; margin-top: 6px; color: var(--admin-muted); font-size: 12px; }
.study-item-actions { display: flex; align-items: flex-start; gap: 6px; flex: 0 0 auto; }

.options { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.options li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 8px; border-radius: 5px; }
.options li.correct { background: #e3f2ec; font-weight: 600; }
.letter { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; background: #edf0ef; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.options li.correct .letter { background: var(--admin-accent); color: #fff; }
.difficulty { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: #edf0ef; color: #59635f; }
.difficulty.d2 { background: #fff0d8; color: #85520f; }
.difficulty.d3 { background: #f8dddd; color: #9d2f2f; }

.study-editor { padding: 16px; background: #f8faf9; border-bottom: 1px solid var(--admin-line); }
.study-editor label.block { display: block; margin-bottom: 12px; }
.study-editor label.block > span { display: block; color: #53605b; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.study-editor textarea { width: 100%; border: 1px solid #c8d1cd; border-radius: 5px; padding: 8px 9px; font-size: 13px; resize: vertical; }
.option-editor { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.option-editor legend { color: #53605b; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-row input[type=radio] { width: 16px; height: 16px; accent-color: var(--admin-accent); flex: 0 0 auto; }
.option-row input:not([type=radio]) { flex: 1; border: 1px solid #c8d1cd; border-radius: 5px; padding: 7px 9px; font-size: 13px; min-height: 34px; }

@media (max-width: 760px) {
    .study-cards { grid-template-columns: 1fr; }
    .study-toolbar { flex-wrap: wrap; }
    .study-toolbar .admin-search { flex-basis: 100%; }
    .study-item { flex-direction: column; }
    .episode-actions { flex-wrap: wrap; }
}

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

/* ---------- Users (Users.razor) ---------- */
.admin-notice.page { margin: 0 0 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.user-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.user-stat { text-align: left; border: 1px solid var(--admin-line); background: var(--admin-surface); border-radius: 6px; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.user-stat strong { font-size: 22px; line-height: 1.1; }
.user-stat span { color: var(--admin-muted); font-size: 12px; }
.user-stat:hover { border-color: #8e9b96; }
.user-stat.active { border-color: var(--admin-accent); box-shadow: inset 0 -3px var(--admin-accent); }
.user-stat.warn strong { color: var(--admin-warning); }
.user-stat.danger strong { color: var(--admin-danger); }

.user-toolbar { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #edf0ef; flex-wrap: wrap; }
.user-toolbar .admin-search { margin: 0; flex: 1 1 260px; }
.user-toolbar select { height: 36px; border: 1px solid #cad2cf; border-radius: 5px; background: #fff; padding: 0 10px; font-size: 13px; }

.user-row { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(140px, 1.2fr) 150px minmax(170px, 1.2fr) 96px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #edf0ef; }
.user-row.head { padding-top: 9px; padding-bottom: 9px; background: #f8faf9; color: var(--admin-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.user-row.selected { background: #f2f8f5; }
.user-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-identity strong, .user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { color: var(--admin-muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #e3f2ec; color: var(--admin-accent-dark); font-weight: 700; font-size: 13px; }
.you { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #e6b85c; color: #1c241f; margin-left: 4px; vertical-align: middle; }
.user-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #edf0ef; color: #4a5551; }
.role-badge.admin { background: #e3f2ec; color: var(--admin-accent-dark); }
.user-activity { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.user-activity small { flex-basis: 100%; color: var(--admin-muted); font-size: 12px; }
.user-actions { text-align: right; }
.user-pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px; font-size: 13px; color: var(--admin-muted); }

/* Side panel */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 22, .35); z-index: 60; }
.user-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 61; background: var(--admin-surface); box-shadow: -8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--admin-line); }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-head small { color: var(--admin-muted); }
.drawer-body { overflow-y: auto; padding: 4px 20px 24px; flex: 1; }
.user-drawer .admin-notice { margin: 12px 20px 0; }
.drawer-section { padding: 16px 0; border-bottom: 1px solid #edf0ef; }
.drawer-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--admin-muted); margin: 0 0 10px; }
.drawer-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer-status small, .hint { color: var(--admin-muted); font-size: 12px; }
.hint { display: block; margin-top: 6px; }
.admin-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form-grid.two label.wide { grid-column: 1 / -1; }
.password-field { display: flex; gap: 6px; }
.password-field input { flex: 1; }

.role-options { display: grid; gap: 8px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--admin-line); border-radius: 6px; cursor: pointer; }
.role-option.checked { border-color: var(--admin-accent); background: #f2f8f5; }
.role-option input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--admin-accent); }
.role-option strong, .role-option small { display: block; }
.role-option small { color: var(--admin-muted); font-size: 12px; }

.access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-command.warn { color: var(--admin-warning); }
.admin-command.danger { background: var(--admin-danger); border-color: var(--admin-danger); color: #fff; }
.admin-command.danger:hover { background: #962f2f; color: #fff; }

.activity-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.activity-tiles div { border: 1px solid var(--admin-line); border-radius: 6px; padding: 10px; }
.activity-tiles strong { display: block; font-size: 16px; }
.activity-tiles span { color: var(--admin-muted); font-size: 11px; }
.attempt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attempt-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 13px; padding: 8px 10px; background: #f8faf9; border-radius: 5px; }
.attempt-list .score { font-weight: 700; }
.attempt-list small { flex-basis: 100%; color: var(--admin-muted); }

.danger-zone { border: 1px solid #f0c9c9; border-radius: 6px; padding: 14px; margin-top: 16px; background: #fdf6f6; }
.danger-zone h3 { color: var(--admin-danger); }
.danger-zone p { font-size: 13px; margin: 0 0 10px; }
.danger-zone label.block { display: block; margin-bottom: 10px; font-size: 12px; }
.danger-zone input { width: 100%; margin-top: 4px; border: 1px solid #c8d1cd; border-radius: 5px; padding: 8px 9px; font-size: 13px; }

@media (max-width: 1100px) {
    .user-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .user-row { grid-template-columns: minmax(200px, 2fr) minmax(120px, 1fr) 140px 96px; }
    .user-row > :nth-child(4) { display: none; }
}

/* Phones: rows become cards, the side panel fills the screen. */
@media (max-width: 760px) {
    .user-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-stat:first-child { grid-column: 1 / -1; }
    .user-row.head { display: none; }
    .user-row { grid-template-columns: 1fr auto; gap: 8px; }
    .user-row > :nth-child(4) { display: flex; }
    .user-identity { grid-column: 1 / -1; }
    .user-roles { grid-column: 1; }
    .user-row > [role=cell]:nth-child(3) { grid-column: 2; grid-row: 2; justify-self: end; }
    .user-activity { grid-column: 1; }
    .user-actions { grid-column: 2; grid-row: 3; align-self: center; }
    .user-drawer { width: 100%; }
    .admin-form-grid.two { grid-template-columns: 1fr; }
    .activity-tiles strong { font-size: 14px; }
}


/* ---------- Grammar patterns & Difficulty ---------- */
.pattern-editor { padding: 18px; margin-bottom: 16px; }
.pattern-editor .admin-form-grid label > span small { font-weight: 400; color: var(--admin-muted); }
.pattern-test { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; background: #f8faf9; border-radius: 6px; font-size: 13px; }
.pattern-test ul { flex-basis: 100%; margin: 0; padding-left: 18px; color: var(--admin-muted); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .admin-icon-button { margin-left: 4px; }

.frequency-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 18px; margin-bottom: 16px; }
.frequency-card h2 { font-size: 16px; margin: 0 0 6px; }
.frequency-card p { margin: 0 0 6px; font-size: 13px; }
.frequency-card .warn { color: var(--admin-warning); }
.frequency-card .hint { color: var(--admin-muted); max-width: 680px; }
.frequency-card code { font-size: 12px; }
.frequency-upload { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.admin-table select { height: 32px; border: 1px solid #cad2cf; border-radius: 5px; background: #fff; padding: 0 6px; font-size: 13px; }
.upload-panel label em { font-style: normal; font-weight: 400; color: var(--admin-muted); }

@media (max-width: 760px) {
    .admin-nav a { font-size: 9px; }
}

/* ---------- Episode grammar (StudyContent.razor) ---------- */
.study-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pattern-select { height: 36px; flex: 1 1 260px; max-width: 420px; border: 1px solid #cad2cf; border-radius: 5px; background: #fff; padding: 0 8px; font-size: 13px; }
.study-item-main .role-badge { margin-left: 6px; vertical-align: middle; }
.study-item-main .admin-status { margin-left: 6px; vertical-align: middle; }
.study-item-actions .admin-command { min-height: 36px; }

@media (max-width: 1100px) {
    .study-cards { grid-template-columns: 1fr; }
}

/* Overview: dictionary maintenance */
.admin-dictionary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-dictionary-note { margin: 10px 0 0; font-size: 13px; color: var(--admin-muted); }

/* ---------- Catalog: delete ---------- */
.admin-icon-button.danger:hover { color: #b42318; border-color: #f0b9b4; background: #fdf0ee; }
.admin-command.danger { background: #b42318; border-color: #b42318; color: #fff; }
.admin-command.danger:hover { background: #8f1c13; color: #fff; }
.admin-command.danger-link { border-color: transparent; background: transparent; color: #b42318; margin-right: auto; }
.admin-command.danger-link:hover { background: #fdf0ee; }
.admin-form-actions .danger-link { margin-right: auto; }
.admin-notice.flush { margin: 0 0 12px; }

.delete-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 20px; background: #fdf0ee; border-bottom: 1px solid #f0c4be; color: #7a1c13; }
.delete-confirm > i { font-size: 20px; }
.delete-confirm-copy { flex: 1 1 260px; min-width: 0; font-size: 12px; }
.delete-confirm-copy strong { display: block; font-size: 13px; margin-bottom: 2px; }
.delete-confirm-actions { display: flex; gap: 8px; }
.delete-confirm.blocked { background: #fff7e6; border-color: #f4d9a6; color: #6b4a0c; }
.catalog-editor-band .delete-confirm { margin-top: 14px; border: 1px solid #f0c4be; border-radius: 6px; }

/* ---------- Site settings (Settings.razor) ---------- */
.settings-card { max-width: 920px; }
.settings-card-head { padding: 18px 20px 6px; }
.settings-card-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.settings-card-head h2 i { color: var(--admin-accent); }
.settings-card-head p { color: var(--admin-muted); font-size: 13px; margin: 5px 0 0; }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 20px; align-items: center; padding: 14px 20px; border-top: 1px solid #edf0ef; }
.settings-card-head + .settings-row { border-top: 0; }
.settings-row.stacked { grid-template-columns: 1fr; gap: 6px; }
.settings-label strong { display: block; font-size: 14px; }
.settings-label small { display: block; color: var(--admin-muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.settings-control { display: flex; align-items: center; gap: 8px; }
.settings-control span { color: var(--admin-muted); font-size: 12px; }
.settings-control input, .settings-control select, .settings-row textarea { border: 1px solid #c8d1cd; border-radius: 5px; background: #fff; padding: 8px 9px; font-size: 13px; min-height: 36px; }
.settings-control input { width: 96px; }
.settings-row textarea { width: 100%; resize: vertical; unicode-bidi: plaintext; }
.clip-limit { display: grid; gap: 8px; }
.clip-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.clip-presets button { border: 1px solid #cbd3d0; background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--admin-ink); }
.clip-presets button.active { background: var(--admin-accent); border-color: var(--admin-accent); color: #fff; }
.settings-updated { max-width: 920px; }

@media (max-width: 760px) {
    .settings-row { grid-template-columns: 1fr; gap: 10px; }
}

/* "Not protected" chip in the catalog: a button that queues stream protection. */
.asset-state.protect-state { border: 0; background: transparent; padding: 0; font: inherit; color: var(--admin-warning); cursor: pointer; }
.asset-state.protect-state:hover span { text-decoration: underline; }

/* ---------- Sync to server (Sync.razor) ---------- */
.sync-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sync-actions { text-align: right; white-space: nowrap; }
.sync-actions .admin-command + .admin-command { margin-left: 6px; }
.sync-confirm { color: var(--admin-warning); font-size: 12px; font-weight: 700; margin-right: 6px; }
.sync-error { color: var(--admin-danger); max-width: 360px; white-space: normal; }
.sync-server-only { margin: 0; padding: 14px 20px 18px 38px; font-size: 13px; }
.sync-code { margin: 0; padding: 12px; background: #f4f6f5; border-radius: 6px; font-size: 12px; white-space: pre-wrap; }
.settings-control input.sync-settings-input { width: 100%; }
.sync-settings-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sync-settings-actions small { color: var(--admin-muted); }


/* ---------- Plans (Plans.razor) and the Plan section in Users ---------- */
.plan-actions { padding: 0 20px 18px; }
.plan-row-actions { white-space: nowrap; text-align: right; }
.plan-row-actions .admin-command + .admin-command { margin-left: 6px; }
.admin-table td strong .admin-status { margin-left: 6px; vertical-align: middle; }
.plan-now { margin: 0 0 10px; font-size: 13px; }

.settings-control input.wide-input { width: 100%; }

/* ---------- Gift codes (GiftCodes.razor) ---------- */
.gift-create .admin-form-grid label small { display: block; margin-top: 4px; font-size: 11px; }
.gift-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.gift-presets button { border: 1px solid #cbd3d0; background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--admin-ink); }
.gift-presets button.active { background: var(--admin-accent); border-color: var(--admin-accent); color: #fff; }
.gift-created { border-color: var(--admin-accent); }
.gift-created textarea { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .04em; }
.gift-link { display: block; color: var(--admin-muted); font-size: 12px; word-break: break-all; }
.gift-created-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.gift-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.gift-open td { background: #f2f8f5; }
.gift-redemptions td { background: #f8faf9; padding-top: 6px; }
.gift-redemptions ul { margin: 0; padding-left: 18px; font-size: 13px; }
.gift-redemptions strong { display: inline; }
.gift-limit { padding: 10px 20px; margin: 0; font-size: 12px; }

/* The learner site's sketch table style (app.css: thick borders, rounded cells, hover lift) doesn't belong in admin tables. */
.admin-table { border-collapse: collapse; border-spacing: 0; margin-bottom: 0; }
.admin-table th { border-bottom: 0; }
.admin-table td { border: 0; border-top: 1px solid #edf0ef; border-radius: 0 !important; background: transparent; }
.admin-table tbody tr:hover td { transform: none; box-shadow: none; }
.admin-table .admin-status, .gift-code { white-space: nowrap; }

/* ---------- Payments (Payments.razor) ---------- */
.pay-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pay-metrics .admin-metric { background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 6px; padding: 14px 16px; }
.pay-metrics .admin-metric strong { display: block; font-size: 22px; margin: 4px 0 2px; }
.pay-metrics .admin-metric.warn strong { color: var(--admin-danger); }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 0; }
.pay-intro { padding: 4px 20px 12px; margin: 0; font-size: 13px; }
.pay-price-form { border-top: 1px solid #edf0ef; }
.pay-price-form .admin-form-grid label small { display: block; margin-top: 4px; font-size: 11px; }
.pay-price-form .admin-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pay-list { margin-top: 16px; }
.pay-error { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .pay-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Classes (Classes.razor) ---------- */
.class-archived td { color: var(--admin-muted); }
.user-toolbar .admin-check { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- Library (Library.razor) and private titles in the catalog ---------- */
.catalog-lock { color: var(--admin-danger); font-size: 12px; flex: 0 0 auto; }
.lib-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lib-tabs button { border: 1px solid #cbd3d0; background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lib-tabs button.active { background: var(--admin-accent); border-color: var(--admin-accent); color: #fff; }
.lib-tabs .count { background: var(--admin-danger); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-size: 11px; }
.lib-request-actions { display: grid; gap: 8px; padding: 12px 20px 16px; background: #f8faf9; border-top: 1px solid #edf0ef; }
.lib-request-actions .lib-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-request-actions input, .lib-request-actions select, .lib-request-actions textarea { border: 1px solid #c8d1cd; border-radius: 5px; padding: 7px 9px; font-size: 13px; background: #fff; }
.lib-request-actions textarea { width: 100%; min-height: 54px; resize: vertical; unicode-bidi: plaintext; }
.lib-details { white-space: pre-line; unicode-bidi: plaintext; font-size: 12px; color: var(--admin-ink); max-width: 420px; }
.lib-grants { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lib-grants li { display: inline-flex; align-items: center; gap: 6px; background: #edf0ef; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12px; }
.lib-grants li.group { background: #e3f2ec; }
.lib-grants button { border: 0; background: transparent; cursor: pointer; color: var(--admin-muted); padding: 0 4px; }
.lib-grant-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: start; padding: 10px 0 0; }
.lib-grant-form textarea, .lib-grant-form select, .lib-grant-form input { border: 1px solid #c8d1cd; border-radius: 5px; padding: 7px 9px; font-size: 13px; background: #fff; width: 100%; }
.lib-grant-form textarea { min-height: 36px; resize: vertical; }
@media (max-width: 900px) { .lib-grant-form { grid-template-columns: 1fr; } }

/* ---------- Catalog: episode rows and workspace (EpisodeWorkspace.razor) ---------- */
.episode-row { transition: background .15s; }
.episode-row.open { background: #f3f8f6; border-bottom-color: transparent; }
.episode-open { all: unset; box-sizing: border-box; min-width: 0; cursor: pointer; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px; border-radius: 6px; }
.episode-open:focus-visible { outline: 2px solid var(--admin-accent); outline-offset: 3px; }
.episode-open .episode-chips { margin-top: 0; gap: 4px 12px; justify-content: flex-end; flex-wrap: nowrap; }
.episode-open .asset-state small { font-size: 10px; font-weight: 800; color: var(--admin-accent); }
.episode-open .asset-state.study { font-variant-numeric: tabular-nums; color: var(--admin-muted); }
.episode-level { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: #eef1f0; color: #4b5753; }
.episode-summary { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--admin-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.episode-summary.ready { color: var(--admin-accent); }
.episode-summary.working { color: #22647c; }
.episode-summary.failed { color: var(--admin-danger); }
.episode-summary.missing { color: var(--admin-warning); }
.episode-actions .admin-command { min-height: 31px; height: 31px; padding: 4px 10px; }
@keyframes ews-spin { to { transform: rotate(360deg); } }
.ews-spin { display: inline-block; animation: ews-spin 1s linear infinite; }

.ews { padding: 0 20px 20px 20px; background: #f3f8f6; border-bottom: 1px solid var(--admin-line); }
.ews-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--admin-line); margin-bottom: 16px; }
.ews-tabs > button[role=tab] { border: 0; background: transparent; padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--admin-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.ews-tabs > button[role=tab]:hover { color: var(--admin-ink); }
.ews-tabs > button[role=tab].active { color: var(--admin-accent-dark); border-bottom-color: var(--admin-accent); }
.ews-tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.ews-tab-badge.running { background: #2b7f9e; }
.ews-tab-badge.failed { background: var(--admin-danger); }
.ews-tab-link { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--admin-accent-dark); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; padding: 8px; }
.ews-tab-link:hover { text-decoration: underline; }
.ews-close { width: 30px; height: 30px; min-height: 30px; flex-basis: 30px; margin-left: 6px; }
.ews-notice { margin: 0 0 14px; }
.ews-intro { color: var(--admin-muted); font-size: 12px; margin: -4px 0 10px; }

.ews-files { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.ews-slot { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ews-slot.picked { border-color: var(--admin-accent); box-shadow: 0 0 0 3px #16725a1a; }
.ews-slot.drag { border-color: var(--admin-accent); background: #f0f8f5; }
.ews-slot-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.ews-slot-head > i { font-size: 17px; color: var(--admin-accent); }
.ews-slot-head .admin-status { margin-left: auto; white-space: nowrap; }
.ews-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; min-height: 108px; padding: 12px; border: 1.5px dashed #b9c4c0; border-radius: 7px; color: var(--admin-muted); font-size: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.ews-drop:hover, .ews-slot.drag .ews-drop { border-color: var(--admin-accent); background: #f6fbf9; color: var(--admin-ink); }
.ews-drop > i { font-size: 22px; color: var(--admin-accent); }
.ews-drop strong { color: var(--admin-accent-dark); }
.ews-drop small { color: #8a9590; font-size: 11px; }
.ews-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ews-picked { display: flex; align-items: center; gap: 10px; min-height: 108px; padding: 12px; border-radius: 7px; background: #eef7f3; }
.ews-picked > i { font-size: 22px; color: var(--admin-accent); }
.ews-picked > span { flex: 1; min-width: 0; }
.ews-picked strong, .ews-picked small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ews-picked strong { font-size: 13px; }
.ews-picked small { color: var(--admin-muted); font-size: 11px; margin-top: 2px; }
.ews-slot-note { color: var(--admin-muted); font-size: 11px; }
.ews-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ews-actions small { margin-right: auto; color: var(--admin-muted); font-size: 12px; }
.ews-progress { margin-top: 14px; background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; padding: 12px 14px; }
.ews-progress-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.ews-progress-head span { margin-right: auto; color: var(--admin-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ews-bar { height: 8px; border-radius: 4px; background: #e5ebe8; overflow: hidden; }
.ews-bar span { display: block; height: 100%; background: var(--admin-accent); border-radius: 4px; transition: width .3s; }

.ews-steps { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; }
.ews-step { display: grid; grid-template-columns: 26px minmax(0,1fr) 160px 120px; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #edf0ef; }
.ews-step:last-child { border-bottom: 0; }
.ews-step-icon { font-size: 18px; color: #b3bcb8; display: flex; }
.ews-step.done .ews-step-icon { color: var(--admin-accent); }
.ews-step.running .ews-step-icon, .ews-step.queued .ews-step-icon { color: #2b7f9e; }
.ews-step.failed .ews-step-icon { color: var(--admin-danger); }
.ews-step.failed { background: #fffafa; }
.ews-step-copy strong, .ews-step-copy small { display: block; }
.ews-step-copy strong { font-size: 13px; }
.ews-step-copy small { color: var(--admin-muted); font-size: 11px; margin-top: 2px; }
.ews-step-state { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ews-step-state small { color: var(--admin-muted); font-size: 11px; }
.ews-step.blocked .ews-step-state small { color: var(--admin-warning); }
.ews-step-action { display: flex; justify-content: flex-end; }
.ews-step-action .admin-command { min-height: 30px; padding: 4px 10px; }
.ews-error { margin-top: 6px; font-size: 12px; color: var(--admin-danger); }
.ews-error summary { cursor: pointer; }
.ews-error pre { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; padding: 8px; background: #fdf1f1; border-radius: 5px; font-size: 11px; max-height: 200px; overflow: auto; }
.ews-details { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; padding: 14px; }

@media (max-width: 1100px) {
    .ews { padding-left: 20px; }
    .ews-files { grid-template-columns: 1fr; }
    .episode-open { grid-template-columns: 1fr; gap: 6px; }
    .episode-open .episode-chips { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 760px) {
    .ews { padding: 0 12px 14px; }
    .ews-tabs { overflow-x: auto; }
    .ews-tab-link { margin-left: 0; white-space: nowrap; }
    .ews-step { grid-template-columns: 22px minmax(0,1fr); }
    .ews-step-state, .ews-step-action { grid-column: 2; justify-content: flex-start; }
    .ews-actions { flex-wrap: wrap; }
    .ews-actions small { flex-basis: 100%; }
}

.lib-class-tag { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0; padding: 1px 7px; border-radius: 999px; background: #e7eefb; color: #24508f; font-size: 11px; font-weight: 700; }
.lib-grants li.class { background: #eef3fc; }
.ews-drop[hidden] { display: none; }

/* ===================== Site settings (st-) ===================== */
.st-last-saved { color: var(--admin-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; padding-top: 22px; white-space: nowrap; }
.st-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 90px; }

/* Section menu */
.st-nav { position: sticky; top: 76px; display: grid; gap: 2px; background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 8px; padding: 6px; }
.st-nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--admin-ink); text-align: left; cursor: pointer; }
.st-nav-item > i { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 7px; background: #eef3f1; color: var(--admin-accent); font-size: 15px; }
.st-nav-text { display: grid; min-width: 0; }
.st-nav-text strong { font-size: 13px; font-weight: 600; }
.st-nav-text small { font-size: 11px; color: var(--admin-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-nav-item:hover { background: #f3f6f5; }
.st-nav-item.active { background: #e6f2ee; box-shadow: inset 3px 0 var(--admin-accent); }
.st-nav-item.active > i { background: var(--admin-accent); color: #fff; }
.st-nav-item:focus-visible { outline: 2px solid var(--admin-accent); outline-offset: 1px; }
.st-dot { position: absolute; right: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #e0a12b; box-shadow: 0 0 0 3px #fff3dc; }

/* Panel */
.st-panel { background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 8px; min-width: 0; }
.st-panel-head { padding: 18px 24px; border-bottom: 1px solid var(--admin-line); }
.st-panel-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 9px; }
.st-panel-head h2 i { color: var(--admin-accent); }
.st-intro { margin: 18px 24px 0; color: var(--admin-muted); font-size: 13px; line-height: 1.5; }
.st-group { padding: 20px 24px; }
.st-group + .st-group { border-top: 1px solid var(--admin-line); }
.st-group > h3 { margin: 0; font-size: 14px; font-weight: 700; }
.st-group > p { margin: 4px 0 10px; color: var(--admin-muted); font-size: 13px; line-height: 1.5; max-width: 760px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; align-items: center; padding: 14px 0; border-top: 1px solid #eef1f0; }
.st-group > h3 + .st-row, .st-group > p + .st-row { border-top: 0; }
.st-label strong { display: block; font-size: 13.5px; font-weight: 600; }
.st-label small { display: block; color: var(--admin-muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.st-control { display: flex; justify-content: flex-end; }
.st-inline { align-items: center; gap: 10px; }
.st-inline > span { color: var(--admin-muted); font-size: 12px; }
.st-value { min-width: 44px; font-weight: 700; color: var(--admin-ink) !important; font-variant-numeric: tabular-nums; }
.st-number, .st-text, .st-field textarea { border: 1px solid #c8d1cd; border-radius: 6px; background: #fff; padding: 8px 10px; font-size: 13px; min-height: 36px; color: var(--admin-ink); }
.st-number { width: 96px; }
.st-number.wide { width: 140px; }
.st-text { width: 100%; }
.st-number:focus, .st-text:focus, .st-field textarea:focus { outline: none; border-color: var(--admin-accent); box-shadow: 0 0 0 3px rgba(22, 114, 90, .15); }
.st-control input[type=range] { width: 180px; accent-color: var(--admin-accent); }
.st-control .clip-limit { justify-items: end; }
.st-field { display: grid; gap: 4px; margin-bottom: 6px; }
.st-field textarea { width: 100%; resize: vertical; line-height: 1.5; unicode-bidi: plaintext; }
.st-counter { color: var(--admin-muted); font-size: 11.5px; text-align: right; }

/* Switch */
.st-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.st-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-switch-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #c9d1ce; transition: background .15s; }
.st-switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.st-switch.on .st-switch-track { background: var(--admin-accent); }
.st-switch.on .st-switch-thumb { transform: translateX(18px); }
.st-switch input:focus-visible + .st-switch-track { outline: 2px solid var(--admin-accent); outline-offset: 2px; }
.st-switch-text { min-width: 64px; font-size: 13px; font-weight: 600; color: var(--admin-muted); }
.st-switch.on .st-switch-text { color: var(--admin-accent-dark); }

/* Segmented buttons (speed) */
.st-segmented { display: inline-flex; border: 1px solid #c8d1cd; border-radius: 7px; overflow: hidden; }
.st-segmented button { border: 0; background: #fff; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--admin-ink); cursor: pointer; }
.st-segmented button + button { border-left: 1px solid #c8d1cd; }
.st-segmented button.active { background: var(--admin-accent); color: #fff; }

/* Overview cards */
.st-glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding: 16px 24px 24px; }
.st-glance-card { display: grid; gap: 8px; align-content: start; text-align: left; padding: 14px; border: 1px solid var(--admin-line); border-radius: 8px; background: #fbfcfc; cursor: pointer; color: var(--admin-ink); }
.st-glance-card:hover { border-color: var(--admin-accent); background: #fff; box-shadow: 0 2px 8px rgba(22, 114, 90, .08); }
.st-glance-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--admin-muted); text-transform: uppercase; letter-spacing: .04em; }
.st-glance-label i { color: var(--admin-accent); font-size: 14px; }
.st-glance-value { font-size: 14px; font-weight: 600; }
.st-pill { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st-pill.ok { background: #e3f2ec; color: #155d48; }
.st-pill.off { background: #f1f1f1; color: #66716d; }
.st-meter { display: block; height: 6px; border-radius: 999px; background: #e8ecea; overflow: hidden; }
.st-meter > span { display: block; height: 100%; background: var(--admin-accent); border-radius: 999px; }
.st-meter.large { height: 10px; }

/* Choice cards (who may watch) */
.st-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 6px; }
.st-choice { position: relative; display: grid; gap: 5px; align-content: start; text-align: left; padding: 16px 14px; border: 1.5px solid var(--admin-line); border-radius: 8px; background: #fff; cursor: pointer; color: var(--admin-ink); }
.st-choice > i { font-size: 20px; color: var(--admin-muted); }
.st-choice strong { font-size: 14px; }
.st-choice small { color: var(--admin-muted); font-size: 12px; line-height: 1.45; }
.st-choice-check { position: absolute; top: 10px; right: 10px; color: var(--admin-accent); font-size: 16px; opacity: 0; }
.st-choice:hover { border-color: #9fb3ac; }
.st-choice.active { border-color: var(--admin-accent); background: #f2f9f6; box-shadow: 0 0 0 3px rgba(22, 114, 90, .12); }
.st-choice.active > i { color: var(--admin-accent); }
.st-choice.active .st-choice-check { opacity: 1; }
.st-choice:focus-visible, .st-glance-card:focus-visible { outline: 2px solid var(--admin-accent); outline-offset: 2px; }

/* Feature cards */
.st-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px 24px 24px; }
.st-feature { padding: 14px 16px; border: 1px solid var(--admin-line); border-radius: 8px; background: #fbfcfc; }
.st-feature.on { border-color: #b5d8cb; background: #f4faf7; }
.st-feature-head { display: flex; align-items: center; gap: 10px; }
.st-feature-head > i { font-size: 18px; color: var(--admin-accent); }
.st-feature-head strong { flex: 1; font-size: 14px; }
.st-feature-head .st-switch-text { display: none; }
.st-feature p { margin: 8px 0 0; color: var(--admin-muted); font-size: 12.5px; line-height: 1.5; }

/* Announcement preview */
.st-preview { margin-top: 10px; display: grid; gap: 6px; }
.st-preview-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--admin-muted); }
.st-preview-empty { padding: 12px; border: 1px dashed #c8d1cd; border-radius: 6px; color: var(--admin-muted); font-size: 13px; }
.st-banner { padding: 10px 14px; border-radius: 6px; background: #fff4c2; border: 1px solid #f0d77a; color: #3b3000; font-size: 14px; unicode-bidi: plaintext; }
.st-banner i { margin-inline-end: 6px; }

/* Media protection */
.st-protect { display: grid; gap: 10px; max-width: 560px; padding: 16px; border: 1px solid var(--admin-line); border-radius: 8px; background: #fbfcfc; }
.st-protect-figure { display: flex; align-items: baseline; gap: 10px; }
.st-protect-figure strong { font-size: 28px; color: var(--admin-accent-dark); }
.st-protect-figure span { color: var(--admin-muted); font-size: 13px; }
.st-protect small { color: var(--admin-muted); font-size: 12px; }
.st-protect-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Save bar: centred over the content (the admin sidebar is 228px wide, hence +114px) */
.st-savebar { position: fixed; left: calc(50% + 114px); bottom: 20px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 24px; padding: 10px 12px 10px 18px; border-radius: 10px; background: var(--admin-sidebar); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: st-rise .18s ease-out; }
.st-savebar > span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.st-savebar > span i { color: #e6b85c; }
.st-savebar > div { display: flex; gap: 8px; }
.st-savebar .admin-command:not(.primary) { background: transparent; color: #dfe7e4; border-color: #4a5a55; }
.st-savebar .admin-command:not(.primary):hover { background: #26332f; color: #fff; }
@keyframes st-rise { from { opacity: 0; margin-bottom: -12px; } to { opacity: 1; margin-bottom: 0; } }

@media (max-width: 1100px) {
    .st-layout { grid-template-columns: 1fr; }
    .st-nav { position: static; display: flex; overflow-x: auto; }
    .st-nav-item { flex: 0 0 auto; width: auto; padding-right: 22px; }
    .st-nav-text small { display: none; }
    .st-dot { right: 6px; }
    .st-savebar { left: 50%; }
}

@media (max-width: 760px) {
    .st-row { grid-template-columns: 1fr; gap: 10px; }
    .st-control { justify-content: flex-start; }
    .st-control .clip-limit { justify-items: start; }
    .st-group, .st-panel-head { padding-left: 16px; padding-right: 16px; }
    .st-glance, .st-feature-grid { padding-left: 16px; padding-right: 16px; }
    .st-savebar { left: 12px; right: 12px; transform: none; justify-content: space-between; gap: 10px; }
    .st-last-saved { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .st-switch-track, .st-switch-thumb { transition: none; }
    .st-savebar { animation: none; }
}

/* ===================== Library (lib-) and the people picker (pp-) ===================== */

/* How a request works */
.lib-flow { list-style: none; margin: 0 0 16px; padding: 12px 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 8px; }
.lib-flow li { position: relative; display: flex; gap: 9px; align-items: flex-start; }
.lib-flow li > span { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e6f2ee; color: var(--admin-accent-dark); font-size: 12px; font-weight: 700; }
.lib-flow strong { display: block; font-size: 12.5px; }
.lib-flow small { display: block; font-size: 11.5px; color: var(--admin-muted); line-height: 1.35; }

/* Tabs */
.lib-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--admin-line); }
.lib-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 10px 14px; margin-bottom: -1px; font-size: 13.5px; font-weight: 600; color: var(--admin-muted); cursor: pointer; }
.lib-tabs button:hover { color: var(--admin-ink); }
.lib-tabs button.active { background: transparent; color: var(--admin-accent-dark); border-bottom-color: var(--admin-accent); }
.lib-tabs .count { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: #eef1f0; color: var(--admin-muted); font-size: 11.5px; }
.lib-tabs .count.alert { background: #e0a12b; color: #fff; }

/* Filters, toolbar */
.lib-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.lib-filters button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cbd3d0; background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--admin-ink); }
.lib-filters button span { color: var(--admin-muted); font-weight: 700; }
.lib-filters button.active { background: var(--admin-ink); border-color: var(--admin-ink); color: #fff; }
.lib-filters button.active span { color: #cfd8d5; }
.lib-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.lib-search { flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #c8d1cd; border-radius: 6px; background: #fff; }
.lib-search i { color: var(--admin-muted); }
.lib-search input { flex: 1; border: 0; outline: none; min-height: 36px; font-size: 13px; background: transparent; }
.lib-hint { margin: 0 0 12px; color: var(--admin-muted); font-size: 12.5px; }

/* Cards */
.lib-cards { display: grid; gap: 12px; }
.lib-card { background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 8px; padding: 14px 16px; }
.lib-card.open { border-color: #9fc7b9; box-shadow: 0 2px 10px rgba(22, 114, 90, .08); }
.lib-card.new { border-style: dashed; border-color: var(--admin-accent); margin-bottom: 12px; }
.lib-card.req.new { border-left: 3px solid #e0a12b; }
.lib-card.req.paid { border-left: 3px solid var(--admin-accent); }
.lib-card-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.lib-card-title { display: flex; gap: 12px; min-width: 0; }
.lib-card-title h3 { margin: 0; font-size: 15px; }
.lib-card-title p { margin: 3px 0 0; color: var(--admin-muted); font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.lib-kind { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #eef3f1; color: var(--admin-accent); font-size: 16px; }
.lib-kind.group { background: #eef0fb; color: #4b55b5; }
.lib-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.lib-card-side.lib-icons { flex-direction: row; align-items: center; gap: 6px; }
.lib-status { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #f1f1f1; color: #66716d; }
.lib-status.new { background: #fff3dc; color: #8a5a0b; }
.lib-status.quoted { background: #eaf1fb; color: #2f5d94; }
.lib-status.paid { background: #e3f2ec; color: #155d48; }
.lib-status.ready { background: #e3f2ec; color: #155d48; }
.lib-price { font-size: 12.5px; font-weight: 700; }
.lib-count { font-size: 12.5px; color: var(--admin-muted); }
.lib-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef1f0; color: var(--admin-ink); font-size: 11.5px; font-weight: 600; }
.lib-tag.warn { background: #fff3dc; color: #8a5a0b; }
.lib-class-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: #eef0fb; color: #4b55b5; font-size: 11.5px; font-weight: 600; }

/* Request progress */
.lib-steps { list-style: none; display: flex; margin: 12px 0 2px; padding: 0; max-width: 520px; }
.lib-steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--admin-muted); }
.lib-steps li span { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #c9d1ce; }
.lib-steps li + li::before { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: #dfe5e2; }
.lib-steps li.done span { background: var(--admin-accent); border-color: var(--admin-accent); }
.lib-steps li.done + li::before, .lib-steps li.done + li.current::before { background: var(--admin-accent); }
.lib-steps li.current { color: var(--admin-ink); font-weight: 700; }
.lib-steps li.current span { border-color: var(--admin-accent); box-shadow: 0 0 0 4px rgba(22, 114, 90, .15); }
.lib-details { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid #dfe5e2; background: #fafbfb; color: #3b4542; font-size: 13px; white-space: pre-wrap; unicode-bidi: plaintext; }
.lib-details i { color: var(--admin-muted); margin-right: 4px; }
.lib-given { margin: 8px 0 0; font-size: 12.5px; }
.lib-given i { color: var(--admin-accent); }

/* Access / members as chips */
.lib-access { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lib-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid #d6dedb; border-radius: 999px; background: #fafbfb; font-size: 12.5px; }
.lib-chip > i { color: var(--admin-accent); }
.lib-chip.group > i { color: #4b55b5; }
.lib-chip.class > i { color: #8a5a0b; }
.lib-chip small { color: var(--admin-muted); }
.lib-chip.ended { opacity: .6; text-decoration: line-through; }
.lib-until { padding-left: 4px; border-left: 1px solid #d6dedb; }
.lib-chip button { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--admin-muted); cursor: pointer; font-size: 15px; }
.lib-chip button:hover { background: #fae7e7; color: var(--admin-danger); }
.lib-chip button.confirm { width: auto; padding: 0 9px; border-radius: 999px; background: var(--admin-danger); color: #fff; font-size: 11.5px; font-weight: 700; }
.lib-titles-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.lib-titles-line > i { color: var(--admin-muted); }

/* Action panel inside a card */
.lib-card-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.lib-action { margin-top: 12px; padding: 14px; border-radius: 8px; background: #f6f9f8; border: 1px solid #e3eae7; display: grid; gap: 10px; }
.lib-action h4 { margin: 0; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.lib-action h4 i { color: var(--admin-accent); }
.lib-action p { margin: 0; font-size: 12.5px; }
.lib-action textarea { width: 100%; border: 1px solid #c8d1cd; border-radius: 6px; padding: 8px 10px; font-size: 13px; resize: vertical; background: #fff; unicode-bidi: plaintext; }
.lib-action-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lib-action-foot:has(> :only-child), .lib-card.new .lib-action-foot { justify-content: flex-end; }
.lib-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lib-money { display: flex; align-items: center; border: 1px solid #c8d1cd; border-radius: 6px; background: #fff; overflow: hidden; }
.lib-money input { width: 160px; border: 0; outline: none; padding: 8px 10px; font-size: 13px; }
.lib-money span { padding: 0 10px; color: var(--admin-muted); font-size: 12px; border-left: 1px solid #e3eae7; }
.lib-select { min-width: 260px; height: 36px; border: 1px solid #c8d1cd; border-radius: 6px; background: #fff; padding: 0 8px; font-size: 13px; }
.lib-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--admin-muted); }
.lib-inline input { height: 34px; border: 1px solid #c8d1cd; border-radius: 6px; padding: 0 8px; font-size: 13px; }
.lib-howto { margin: 0; padding-left: 18px; font-size: 12.5px; display: grid; gap: 3px; }
.lib-seg { display: inline-flex; border: 1px solid #c8d1cd; border-radius: 6px; overflow: hidden; }
.lib-seg button { border: 0; background: #fff; padding: 6px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--admin-ink); }
.lib-seg button + button { border-left: 1px solid #c8d1cd; }
.lib-seg button.active { background: var(--admin-accent); color: #fff; }
.lib-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lib-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--admin-muted); }
.lib-form input { height: 36px; border: 1px solid #c8d1cd; border-radius: 6px; padding: 0 10px; font-size: 13px; color: var(--admin-ink); }
.lib-label { font-size: 12px; font-weight: 600; color: var(--admin-muted); margin-bottom: -4px; }
.admin-command.danger-link { color: var(--admin-danger); }

/* ---------- People picker ---------- */
.pp { position: relative; }
.pp-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 5px 8px; border: 1px solid #c8d1cd; border-radius: 7px; background: #fff; cursor: text; }
.pp.open .pp-box, .pp-box:focus-within { border-color: var(--admin-accent); box-shadow: 0 0 0 3px rgba(22, 114, 90, .15); }
.pp-box input { flex: 1 1 180px; min-width: 120px; border: 0; outline: none; padding: 5px 2px; font-size: 13px; background: transparent; }
.pp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 3px 2px 8px; border-radius: 999px; background: #e6f2ee; color: var(--admin-accent-dark); font-size: 12.5px; font-weight: 600; }
.pp-chip.group { background: #eef0fb; color: #3d4699; }
.pp-chip.class { background: #fff3dc; color: #7a4a0c; }
.pp-chip.email { background: #f1f1f1; color: #3b4542; }
.pp-chip button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 14px; opacity: .7; }
.pp-chip button:hover { opacity: 1; background: rgba(0, 0, 0, .08); }
.pp-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; padding: 4px; background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; box-shadow: 0 12px 28px rgba(0, 0, 0, .14); }
.pp-section { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--admin-muted); }
.pp-option { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; color: var(--admin-ink); }
.pp-option.active { background: #eef6f3; }
.pp-option:disabled { opacity: .55; cursor: default; }
.pp-avatar { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e6f2ee; color: var(--admin-accent); font-size: 13px; }
.pp-avatar.group { background: #eef0fb; color: #4b55b5; }
.pp-avatar.class { background: #fff3dc; color: #8a5a0b; }
.pp-avatar.email { background: #f1f1f1; color: #66716d; }
.pp-option-text { display: grid; min-width: 0; flex: 1; }
.pp-option-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-option-text small { font-size: 11.5px; color: var(--admin-muted); }
.pp-badge { font-size: 11px; color: var(--admin-muted); background: #f1f1f1; border-radius: 999px; padding: 1px 8px; }
.pp-note { padding: 10px; color: var(--admin-muted); font-size: 12.5px; }

@media (max-width: 1100px) {
    .lib-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .lib-flow { grid-template-columns: 1fr 1fr; }
    .lib-card-head { flex-direction: column; }
    .lib-card-side { flex-direction: row; align-items: center; }
    .lib-select { min-width: 0; width: 100%; }
}

/* Library: "Watch whole episodes" row of a private title */
.lib-watch { margin-top: 12px; padding: 10px 12px; border: 1px dashed #c8d1cd; border-radius: 8px; display: grid; gap: 8px; }
.lib-watch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-watch-head > i { color: var(--admin-accent); font-size: 17px; }
.lib-watch-head > div:not(.lib-seg) { flex: 1 1 220px; display: grid; }
.lib-watch-head strong { font-size: 13px; }
.lib-watch-head small { color: var(--admin-muted); font-size: 12px; }
.lib-watch .lib-action { margin-top: 4px; }


/* ---------- Learner report (Pages/UserReport.razor) ---------- */
.rpt-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.rpt-chip { border: 1px solid var(--admin-line); background: var(--admin-surface); color: var(--admin-ink); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.rpt-chip:hover { border-color: #8e9b96; }
.rpt-chip.active { background: var(--admin-ink); border-color: var(--admin-ink); color: #fff; }
.rpt-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--admin-muted); }
.rpt-date input { height: 34px; border: 1px solid #cad2cf; border-radius: 5px; padding: 4px 8px; }
.rpt-period-note { margin-left: auto; color: var(--admin-muted); font-size: 13px; }

.rpt-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.rpt-kpi { background: var(--admin-surface); border: 1px solid var(--admin-line); border-radius: 6px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.rpt-kpi i { grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #e8f3ef; color: var(--admin-accent); font-size: 17px; }
.rpt-kpi strong { font-size: 22px; line-height: 1.1; }
.rpt-kpi span { color: var(--admin-muted); font-size: 12px; }

.rpt-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px; border-bottom: 1px solid var(--admin-line); }
.rpt-search { margin: 0; flex: 1 1 220px; }
.rpt-field { display: grid; gap: 3px; font-size: 12px; color: var(--admin-muted); font-weight: 600; }
.rpt-field select, .rpt-field input { height: 36px; border: 1px solid #cad2cf; border-radius: 5px; background: #fff; padding: 4px 8px; font-size: 13px; color: var(--admin-ink); }
.rpt-range { display: inline-flex; align-items: center; gap: 4px; }
.rpt-range input { width: 70px; }
.rpt-clear { align-self: flex-end; }

.rpt-table { display: grid; }
.rpt-row { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(90px, .8fr) minmax(110px, 1fr) minmax(120px, 1.1fr) minmax(120px, 1.1fr) minmax(130px, 1fr) minmax(100px, .8fr); gap: 12px; align-items: center; padding: 11px 16px; border: 0; border-bottom: 1px solid #edf0ef; background: transparent; text-align: left; font: inherit; color: inherit; width: 100%; cursor: pointer; }
.rpt-row:hover { background: #f7f9f8; }
.rpt-row.selected { background: #eef6f3; }
.rpt-row:focus-visible { outline: 2px solid var(--admin-accent); outline-offset: -2px; }
.rpt-row.head { cursor: default; background: #f7f9f8; font-size: 12px; font-weight: 700; color: var(--admin-muted); text-transform: uppercase; letter-spacing: .03em; padding-top: 9px; padding-bottom: 9px; }
.rpt-sort { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; text-align: left; }
.rpt-sort.active { color: var(--admin-ink); }
.rpt-sort i { font-size: 11px; }
.rpt-learner { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rpt-learner > span:last-child { min-width: 0; display: grid; }
.rpt-learner strong, .rpt-learner small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-learner small, .rpt-sub, .rpt-sub-inline { color: var(--admin-muted); font-size: 12px; }
.rpt-learner .avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e6edea; font-weight: 700; font-size: 12px; }
.rpt-sub { display: block; }
.rpt-plan { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #f2efe4; font-size: 12px; font-weight: 600; }
.rpt-score-line { display: flex; align-items: center; gap: 8px; }
.rpt-badge { display: inline-block; min-width: 46px; text-align: center; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef0ef; }
.rpt-badge.good { background: #d8f0e5; color: #11603f; }
.rpt-badge.ok { background: #fbefd3; color: #8a5a10; }
.rpt-badge.bad { background: #f8dddd; color: #9b2c2c; }
.rpt-meter { display: block; height: 5px; margin-top: 5px; border-radius: 999px; background: #edf0ef; overflow: hidden; }
.rpt-meter span { display: block; height: 100%; }
.rpt-meter .good { background: #2f9e6d; }
.rpt-meter .ok { background: #d99a26; }
.rpt-meter .bad { background: #cf4b4b; }
.rpt-steps { display: flex; gap: 10px; font-size: 13px; }
.rpt-steps i { color: #8fa09a; }
.rpt-table .muted { color: #9aa5a1; }

.rpt-drawer { width: min(640px, 100%); }
.rpt-mini { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 16px 0 6px; }
.rpt-mini.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rpt-mini div { border: 1px solid var(--admin-line); border-radius: 6px; padding: 8px; display: grid; text-align: center; }
.rpt-mini strong { font-size: 18px; }
.rpt-mini span { color: var(--admin-muted); font-size: 11px; }
.rpt-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--admin-line); margin: 12px 0 8px; overflow-x: auto; }
.rpt-tabs button { border: 0; background: transparent; padding: 9px 12px; font-weight: 600; font-size: 13px; color: var(--admin-muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.rpt-tabs button.active { color: var(--admin-ink); border-bottom-color: var(--admin-accent); }
.rpt-count { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #eef0ef; font-size: 11px; }
.rpt-list { list-style: none; margin: 0; padding: 0; }
.rpt-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f1; }
.rpt-grow { flex: 1; min-width: 0; display: grid; }
.rpt-grow small { color: var(--admin-muted); font-size: 12px; overflow-wrap: anywhere; }
.rpt-date-cell { color: var(--admin-muted); font-size: 12px; white-space: nowrap; }
.rpt-none { color: var(--admin-muted); margin: 14px 0; }
.rpt-kind { min-width: 56px; text-align: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e8f0ff; color: #2753b8; }
.rpt-kind.phrase { background: #f1e8ff; color: #6a3bb5; }
.rpt-kind.line { background: #fff1e0; color: #9a5a12; }
.rpt-tags span { margin-right: 6px; color: var(--admin-accent); }
.rpt-search-small { display: flex; gap: 8px; margin: 6px 0; }
.rpt-search-small input, .rpt-search-small select { height: 34px; border: 1px solid #cad2cf; border-radius: 5px; padding: 4px 8px; font-size: 13px; }
.rpt-search-small input { flex: 1; }
.rpt-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--admin-muted); margin: 18px 0 8px; }
.rpt-bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 4px; border: 1px solid var(--admin-line); border-radius: 6px; }
.rpt-bars span { flex: 1; min-height: 2px; background: var(--admin-accent); border-radius: 2px 2px 0 0; }
.rpt-done { display: flex; flex-wrap: wrap; gap: 10px; }
.rpt-done span { color: #b5bdba; }
.rpt-done span.on { color: var(--admin-accent); font-weight: 600; }
.rpt-classes { color: var(--admin-muted); font-size: 13px; margin: 8px 0; }

@media (max-width: 1200px) {
    .rpt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Narrow screens: each learner becomes a card with labelled values. */
@media (max-width: 900px) {
    .rpt-row.head { display: none; }
    .rpt-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; }
    .rpt-learner { grid-column: 1 / -1; }
    .rpt-row > [data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--admin-muted); margin-bottom: 2px; }
    .rpt-period-note { margin-left: 0; width: 100%; }
    .rpt-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .rpt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rpt-field { flex: 1 1 45%; }
}
.reading-editor { width: 100%; min-height: 32rem; line-height: 1.65; resize: vertical; }
.reading-preview { max-width: 52rem; margin: 1rem auto; line-height: 1.8; }
.reading-preview h2 { margin-bottom: 1.25rem; }
.reading-preview-copy { white-space: pre-wrap; overflow-wrap: break-word; }
.reading-preview-copy strong { font-weight: 700; }
.reading-history { max-width: 52rem; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid #e5e5e5; }
.reading-versions { margin: 0; padding: 0; list-style: none; }
.reading-versions li { display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: .7rem 0; border-bottom: 1px solid #eee; }
.reading-versions li > div:first-child { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.reading-versions li .muted { font-size: .85rem; }
@media (max-width: 640px) { .reading-versions li { flex-direction: column; align-items: flex-start; } }

/* ---------- Messages (Contact Us inbox) and the unread badge ---------- */
.admin-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.admin-badge.inline { margin-left: 6px; }
.admin-nav-icon { position: relative; display: inline-flex; }
.admin-nav-icon .admin-badge { position: absolute; top: -8px; right: -12px; box-shadow: 0 0 0 2px var(--admin-sidebar); }
/* Stay visible when narrow screens hide the nav labels (.admin-nav span). */
.admin-nav .admin-nav-icon { display: inline-flex !important; }
.admin-nav .admin-badge { display: inline-flex !important; }
.admin-topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-inbox { position: relative; }
.admin-inbox .admin-badge { position: absolute; top: -7px; right: -7px; box-shadow: 0 0 0 2px #fff; }
.admin-inbox.has-new { color: #b42318; border-color: #f0b9b4; }

.msg-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-list-pane { overflow: hidden; }
.msg-toolbar { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-bottom: 1px solid var(--admin-line); }
.msg-tabs { display: flex; gap: 4px; }
.msg-tabs button { border: 1px solid transparent; background: none; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--admin-muted); cursor: pointer; display: inline-flex; align-items: center; }
.msg-tabs button.active { background: var(--admin-canvas); border-color: var(--admin-line); color: var(--admin-ink); }
.msg-search { display: flex; align-items: center; gap: 8px; border: 1px solid #cbd3d0; border-radius: 6px; padding: 0 10px; background: #fff; }
.msg-search input { flex: 1; min-width: 0; border: 0; outline: 0; min-height: 34px; font-size: 13px; background: transparent; }
.msg-search .bi { color: var(--admin-muted); }
.msg-list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 290px); overflow-y: auto; }
.msg-list li + li { border-top: 1px solid var(--admin-line); }
.msg-row { width: 100%; display: flex; gap: 10px; text-align: left; border: 0; background: #fff; padding: 12px; cursor: pointer; color: var(--admin-ink); }
.msg-row:hover { background: #f7f9f8; }
.msg-row.active { background: #eaf4f0; box-shadow: inset 3px 0 var(--admin-accent); }
.msg-dot { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 50%; }
.msg-row.unread .msg-dot { background: #e5484d; }
.msg-row-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.msg-row-top { display: flex; justify-content: space-between; gap: 8px; }
.msg-row-top strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row.unread .msg-row-top strong { font-weight: 700; }
.msg-row-top time { flex: 0 0 auto; color: var(--admin-muted); font-size: 12px; }
.msg-row-email { color: var(--admin-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row-snippet { color: #3f4a46; font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-row.unread .msg-row-snippet { color: var(--admin-ink); }
.msg-more { margin: 12px; width: calc(100% - 24px); }
.msg-read-pane { padding: 20px 24px; min-height: 320px; }
.msg-read-pane .admin-empty { min-height: 280px; }
.msg-read-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--admin-line); }
.msg-read-head h2 { margin: 0 0 2px; font-size: 20px; }
.msg-read-head a { color: var(--admin-accent); font-size: 14px; }
.msg-read-head time { color: var(--admin-muted); font-size: 13px; white-space: nowrap; }
.msg-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; padding: 2px 8px; border-radius: 999px; background: #eaf4f0; color: var(--admin-accent-dark); font-size: 12px; font-weight: 600; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; margin: 18px 0 22px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-read-pane .delete-confirm { border: 1px solid #f0c4be; border-radius: 6px; }
.msg-back { display: none; margin-bottom: 14px; }

@media (max-width: 900px) {
    .msg-layout { grid-template-columns: 1fr; }
    .msg-layout.reading .msg-list-pane, .msg-layout:not(.reading) .msg-read-pane { display: none; }
    .msg-back { display: inline-flex; }
    .msg-list { max-height: none; }
    .msg-read-pane { padding: 16px; }
    .msg-read-head { flex-direction: column; gap: 6px; }
}
@media (max-width: 760px) {
    .admin-nav-icon .admin-badge { top: -6px; right: -14px; }
}

/* ---------- Search index ---------- */
.si-metrics .admin-metric.warn strong { color: var(--admin-warning); }
.si-metrics .admin-metric strong { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.si-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9aa5a1; flex: 0 0 auto; }
.si-dot.green { background: #2e9e6b; }
.si-dot.yellow { background: #e0a419; }
.si-dot.red { background: #d64545; }
.si-bar { height: 6px; border-radius: 3px; background: #edf0ef; overflow: hidden; margin: 2px 0 6px; }
.si-bar > span { display: block; height: 100%; background: var(--admin-accent); }
.si-bar.amber > span { background: #e0a419; }
.si-bar.red > span { background: #d64545; }
.si-section { margin-bottom: 20px; }
.si-section .settings-card-head { padding: 16px 20px 0; }
.si-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px !important; }
.si-intro { padding: 0 20px; margin: 6px 0 0; font-size: 13px; }
.si-checks { list-style: none; margin: 0; padding: 8px 20px 16px; display: grid; gap: 8px; }
.si-checks li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--admin-line); }
.si-checks li > i { font-size: 18px; flex: 0 0 auto; }
.si-checks li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.si-checks li span { color: var(--admin-muted); font-size: 13px; }
.si-checks li > button { flex: 0 0 auto; }
.si-checks li.bad { background: #fdf0ee; border-color: #f0c4be; } .si-checks li.bad > i { color: #b42318; }
.si-checks li.warn { background: #fff8eb; border-color: #f2d9a6; } .si-checks li.warn > i { color: var(--admin-warning); }
.si-checks li.info > i { color: #3b6fb6; }
.si-checks li.good { background: #eef8f3; border-color: #c4e5d5; } .si-checks li.good > i { color: var(--admin-accent); }
.si-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #edf0ef; color: var(--admin-muted); white-space: nowrap; }
.si-status.good { background: #e3f2ec; color: #155d48; }
.si-status.warn { background: #fff3dc; color: #7a4a0c; }
.si-status.bad { background: #fae7e7; color: #932f2f; }
.si-failed { color: #b42318 !important; }
.si-actions { white-space: nowrap; text-align: right; }
.si-actions > * + * { margin-left: 6px; }
.si-task { margin-bottom: 16px; padding: 14px 16px; border-radius: 6px; border: 1px solid var(--admin-line); background: #fff; }
.si-task.running { border-color: #b9d8cc; background: #f3faf7; }
.si-task.failed { border-color: #f0c4be; background: #fdf0ee; }
.si-task.done { border-color: #c4e5d5; background: #eef8f3; }
.si-task-head { display: flex; justify-content: space-between; gap: 12px; }
.si-task-head strong { display: inline-flex; align-items: center; gap: 8px; }
.si-task-head small { color: var(--admin-muted); }
.si-task p { margin: 6px 0 0; font-size: 13px; }
.si-progress { height: 8px; border-radius: 4px; background: #dfe9e5; margin-top: 10px; overflow: hidden; }
.si-progress > span { display: block; height: 100%; background: var(--admin-accent); transition: width .4s; }
.si-test { display: flex; gap: 8px; padding: 12px 20px 0; }
.si-test input { flex: 1; min-width: 0; min-height: 36px; border: 1px solid #cbd3d0; border-radius: 6px; padding: 0 10px; font-size: 14px; }
.si-test-summary { padding: 12px 20px 0; margin: 0; font-size: 13px; color: var(--admin-muted); }
.si-test-summary strong { color: var(--admin-ink); }
.si-hits { list-style: none; margin: 8px 0 0; padding: 0 0 12px; }
.si-hits li { padding: 10px 20px; border-top: 1px solid #edf0ef; display: grid; gap: 3px; }
.si-hits small { color: var(--admin-muted); font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.si-confirm { margin: 0 20px 16px; border: 1px solid #b9d8cc; border-radius: 6px; background: #f3faf7; color: var(--admin-ink); }
.si-confirm > i { color: var(--admin-accent); }
@media (max-width: 900px) {
    .si-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .si-metrics .admin-metric:nth-child(2) { border-right: 0; }
    .si-checks li { flex-wrap: wrap; }
    .si-checks li > button { margin-left: 30px; }
}

/* ---------- Episode visibility (Draft / Published / Search only) ----------
   Selectors start with .ep-visibility so the form grid's generic label/input rules (caption-sized spans,
   full-width inputs) never reach it. */
.admin-dot.search-only { background: #3b6fb6; }
.admin-form-grid > .ep-visibility, .admin-form-grid > .ep-vis-note { grid-column: 1 / -1; }
.ep-visibility { container-type: inline-size; min-width: 0; border: 1px solid var(--admin-line); border-radius: 8px; margin: 0; padding: 14px; background: #fbfcfc; }
.ep-visibility .ep-vis-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.ep-visibility .ep-vis-title { font-size: 14px; font-weight: 700; color: var(--admin-ink); }
.ep-visibility .ep-vis-now { font-size: 13px; color: var(--admin-muted); }
.ep-visibility .ep-vis-now strong { color: var(--admin-ink); }
.ep-visibility .ep-vis-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ep-visibility .ep-vis-option { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 0; margin: 0; padding: 14px; border: 2px solid var(--admin-line); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.ep-visibility .ep-vis-option:hover { border-color: #aebbb6; }
.ep-visibility .ep-vis-option:focus-within { outline: 3px solid rgba(22, 114, 90, .25); outline-offset: 2px; }
/* The real radio stays for the keyboard and screen readers; the card shows the choice. */
.ep-visibility .ep-vis-option .ep-vis-input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; pointer-events: none; }
.ep-visibility .ep-vis-option .ep-vis-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; margin: 0; border-radius: 50%; background: #eef2f1; color: #5b6863; font-size: 17px; }
.ep-visibility .ep-vis-option .ep-vis-text { display: grid; gap: 3px; flex: 1; min-width: 0; margin: 0; }
.ep-visibility .ep-vis-option .ep-vis-label { display: block; margin: 0; font-size: 15px; font-weight: 700; color: var(--admin-ink); }
.ep-visibility .ep-vis-option .ep-vis-help { display: block; margin: 0; font-size: 12.5px; font-weight: 400; line-height: 1.45; color: var(--admin-muted); }
.ep-visibility .ep-vis-option .ep-vis-check { display: block; margin: 0; flex: 0 0 auto; font-size: 18px; color: #c3ccc9; }
/* Selected: the colour of the choice (grey draft, green published, blue search only). */
.ep-visibility .ep-vis-option.active { border-color: var(--ep-vis-color); background: var(--ep-vis-soft); }
.ep-visibility .ep-vis-option.active .ep-vis-icon { background: var(--ep-vis-color); color: #fff; }
.ep-visibility .ep-vis-option.active .ep-vis-check { color: var(--ep-vis-color); }
.ep-visibility .ep-vis-draft { --ep-vis-color: #8a6a2f; --ep-vis-soft: #fdf7ec; }
.ep-visibility .ep-vis-published { --ep-vis-color: #16725a; --ep-vis-soft: #effaf5; }
.ep-visibility .ep-vis-search { --ep-vis-color: #2f63ad; --ep-vis-soft: #eff4fc; }
.ep-vis-note { margin: 0; padding: 9px 12px; border-radius: 6px; background: #fff3dc; color: #7a4a0c; font-size: 13px; display: flex; gap: 8px; align-items: center; }
/* Side by side when there is room for readable cards; stacked in a narrow panel or on a phone. */
@container (max-width: 720px) { .ep-visibility .ep-vis-options { grid-template-columns: 1fr; } }

/* Search index → Try a search: "as a learner" */
.si-test-modes { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0 0 .6rem; font-size: .92rem; }
.si-test-modes label, .si-check { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.si-learner-facts { list-style: none; margin: .4rem 0 .75rem; padding: .6rem .8rem; border-radius: 8px; background: #f3f6ff; display: grid; gap: .25rem; font-size: .9rem; }
.si-learner-facts i { color: #364fc7; margin-right: .3rem; }
.si-why { display: block; color: #495057; margin-top: .15rem; }
