/* ═══════════════════════════════════════════════════════════════════════════
   tsi-lms.css: the TSI Portal look (EHR Admin, OneDash + tsi.custom.css) on MudBlazor.
   Colours and sizes match TSIPortal/TSI.EHR.Admin; LmsTheme.cs holds the palette and type.
   See docs/UI-DESIGN-STANDARD.md. Keep this file to the shared look; page-specific styles
   belong in the page's .razor.css.
═══════════════════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted Roboto, Apache 2.0) ─────────────────────────────── */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/roboto/roboto-latin-400-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../lib/roboto/roboto-latin-ext-400-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap;
    src: url(../lib/roboto/roboto-latin-500-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap;
    src: url(../lib/roboto/roboto-latin-ext-500-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/roboto/roboto-latin-700-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../lib/roboto/roboto-latin-ext-700-normal.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    --tsi-purple: #665e81;
    --tsi-purple-dark: #4b3b7d;
    --tsi-purple-deep: #2D1967;
    --tsi-teal: #2daab8;
    --tsi-green: #61B564;
    --tsi-red: #E12454;
    --tsi-blue: #3461ff;        /* OneDash sidebar hover / active */
    --tsi-text: #4c5258;
    --tsi-page: #f7f8fa;
    --tsi-line: #e2e3e4;
    --tsi-table-head: #e2e3e5;  /* Bootstrap .table-secondary */
    --tsi-card-border: rgba(0, 0, 0, .175);
}

body {
    color: var(--tsi-text);
    background-color: var(--tsi-page);
    letter-spacing: .5px;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ── Top header (OneDash .top-header .navbar) ───────────────────────────── */
.tsi-topbar.mud-appbar {
    border-bottom: 1px solid var(--tsi-line);
}

.tsi-topbar .mud-toolbar { padding-left: 16px; padding-right: 16px; gap: 8px; }

.tsi-user-button .mud-button-label { gap: 8px; }

.tsi-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--tsi-line);
}

/* ── Sidebar (OneDash .sidebar-wrapper / .metismenu) ───────────────────── */
.tsi-sidebar.mud-drawer {
    border-right: 1px solid var(--tsi-line);
}

.tsi-sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #e4e4e4;
    overflow: hidden;
}

.tsi-sidebar-header a { display: flex; align-items: center; min-width: 0; color: inherit; }
.tsi-brand-full { max-height: 42px; max-width: 220px; object-fit: contain; }
.tsi-brand-mark { max-height: 36px; max-width: 40px; object-fit: contain; display: none; }
.tsi-brand-name { font-size: 1rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tsi-purple-deep); }

/* Collapsed (mini) and not hovered: only the small mark. */
.mud-drawer-mini.mud-drawer--closed:not(:hover) .tsi-sidebar-header { justify-content: center; padding: 0; }
.mud-drawer-mini.mud-drawer--closed:not(:hover) .tsi-brand-full,
.mud-drawer-mini.mud-drawer--closed:not(:hover) .tsi-brand-name { display: none; }
.mud-drawer-mini.mud-drawer--closed:not(:hover) .tsi-brand-mark { display: block; }

.tsi-sidebar .mud-navmenu { padding: 10px 10px 24px; }

.tsi-sidebar .mud-nav-link {
    padding: 10px 15px;
    margin: 1px 0;
    border-radius: 4px;
    font-size: 15px;
    color: #5f5f5f;
    letter-spacing: .5px;
    border-left: 4px solid transparent;
    transition: all .2s ease-out;
    white-space: nowrap;
    font-weight: 400;
}
.tsi-sidebar .mud-nav-group { margin: 0; }
.tsi-sidebar .mud-nav-group .mud-nav-link-text { font-weight: 400; }

.tsi-sidebar .mud-nav-link:hover:not(.mud-nav-link-disabled),
.tsi-sidebar .mud-nav-link.active:not(.mud-nav-link-disabled) {
    color: var(--tsi-blue);
    background-color: #fff;
    border-left: 4px solid var(--tsi-blue);
    box-shadow: 0 .125rem .25rem rgb(0 0 0 / 8%);
}

.tsi-sidebar .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon,
.tsi-sidebar .mud-nav-link:hover:not(.mud-nav-link-disabled) .mud-nav-link-icon { color: var(--tsi-blue); }

.tsi-sidebar .mud-nav-link-icon { font-size: 18px; width: 24px; min-width: 24px; display: inline-flex; justify-content: center; }
.tsi-sidebar .mud-nav-link-text { margin-left: 12px; }

/* Links inside a group: smaller, no bar (metismenu "ul a"), bullet icon. */
.tsi-sidebar .mud-navgroup-collapse .mud-nav-link { padding: 6px 15px 6px 22px; font-size: 14.5px; }
.tsi-sidebar .mud-navgroup-collapse .mud-nav-link .mud-nav-link-icon { font-size: 12px; }

/* Collapsed (mini) and not hovered: icons only, centred, no group contents. */
.mud-drawer-mini.mud-drawer--closed:not(:hover) .mud-nav-link { justify-content: center; padding: 10px 0; border-left-width: 0; }
.mud-drawer-mini.mud-drawer--closed:not(:hover) .mud-nav-link-text,
.mud-drawer-mini.mud-drawer--closed:not(:hover) .mud-nav-link-expand-icon,
.mud-drawer-mini.mud-drawer--closed:not(:hover) .mud-navgroup-collapse { display: none; }

/* Sidebar toggle ribbon (tsi.custom.css .sidebar-ribbon): a tab on the sidebar's right edge. Desktop only. */
.tsi-sidebar-ribbon {
    position: fixed;
    top: 50%;
    left: 259px;
    transform: translateY(-50%);
    z-index: calc(var(--mud-zindex-drawer) + 1);
    width: 14px;
    height: 56px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: #5f5f5f;
    border: 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .18);
    cursor: pointer;
    transition: left .2s, width .2s, background-color .2s;
}
.tsi-sidebar-ribbon:hover, .tsi-sidebar-ribbon:focus-visible { width: 18px; background-color: var(--tsi-blue); }
.tsi-sidebar-ribbon:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.tsi-sidebar-ribbon::after {
    content: "";
    width: .5em;
    height: .5em;
    border-style: solid;
    border-width: 1.5px 0 0 1.5px;
    border-color: currentColor;
    transform: translateX(2px) rotate(-45deg);
    transition: transform .3s ease-out;
}
.tsi-sidebar-ribbon.collapsed { left: 69px; }
.tsi-sidebar-ribbon.collapsed::after { transform: translateX(-2px) rotate(135deg); }
@media (max-width: 959.98px) { .tsi-sidebar-ribbon { display: none; } }

/* ── Page content and footer (OneDash .page-content / .footer) ──────────── */
.tsi-main.mud-main-content { display: flex; flex-direction: column; min-height: 100vh; }
.tsi-content { flex: 1 0 auto; width: 100%; padding: 24px 24px 32px; }
@media (max-width: 599.98px) { .tsi-content { padding: 16px 16px 24px; } }

.tsi-footer {
    flex-shrink: 0;
    padding: .7rem;
    color: #484444;
    background-color: var(--tsi-page);
    border-top: 1px solid var(--tsi-line);
    text-align: center;
    font-size: .8rem;
}
.tsi-footer a { color: var(--tsi-purple-dark); }

/* ── Cards: Bootstrap .card look for elevation-1 papers and tables ─────── */
.mud-paper.mud-elevation-1:not(.mud-popover):not(.mud-appbar) {
    box-shadow: none;
    border: 1px solid var(--tsi-card-border);
}

/* ── Tables: .table-secondary header, .table-hover rows ─────────────────── */
.mud-table-head .mud-table-cell,
.mud-simple-table table thead th {
    background-color: var(--tsi-table-head);
    color: #000;
    font-weight: 500;
}
.mud-table-head .mud-table-sort-label { color: #000; }

/* ── Buttons: TSI purple primary (tsi.custom.css .btn-primary) ──────────── */
.mud-button-filled.mud-button-filled-primary {
    border: 1px solid var(--tsi-purple-dark);
    box-shadow: none;
}
.mud-button-filled.mud-button-filled-primary:hover,
.mud-button-filled.mud-button-filled-primary:focus-visible { background-color: var(--tsi-purple-dark); }
.mud-button-filled { box-shadow: none; }
.mud-button-outlined.mud-button-outlined-default { border-color: #5f676e; color: #5f676e; }
.mud-button-outlined.mud-button-outlined-default:hover { background-color: #5f676e; color: #fff; }

/* ── Badges (tsi.custom.css) ────────────────────────────────────────────── */
.tsi-badge { display: inline-block; padding: .35em .65em; font-size: .75em; font-weight: 700; line-height: 1; border-radius: .375rem; white-space: nowrap; }
.tsi-badge.success { background-color: #198754; color: #fff; } /* EHR --tsi-bg-green-dark: white on #61B564 is only 2.5:1 */
.tsi-badge.light { background-color: #eee; color: #2c323f; }
.tsi-badge.dark { background-color: #212529; color: #fff; }

/* Bootstrap Icons inside Mud icon slots */
.mud-icon-root.bi, i.bi { line-height: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   TSI components (Components/Tsi). Section numbers: docs/UI-DESIGN-STANDARD.md.
═══════════════════════════════════════════════════════════════════════════ */

.tsi-muted { color: #5f676e; }

/* §1 Page card */
.tsi-page {
    background: #fff;
    border: 1px solid var(--tsi-card-border);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}
.tsi-page-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--tsi-card-border);
}
.tsi-page-heading { flex: 1 1 auto; min-width: 0; }
.tsi-page-title { margin: 0; font-size: 1.25rem; font-weight: 500; line-height: 1.3; color: #212529; letter-spacing: .25px; }
.tsi-page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.tsi-page-back { margin-left: -.5rem; }
.tsi-page-body { padding: 1.25rem; }
.tsi-page-description { margin: 0 0 1rem; }
@media (max-width: 599.98px) {
    .tsi-page-header, .tsi-page-body { padding: .875rem 1rem; }
}

/* §2 Section ("card shadow-none bg-light") */
.tsi-section { border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.tsi-section-light { background: #f8f9fa; }
.tsi-section:not(.tsi-section-light) { padding-left: 0; padding-right: 0; }
.tsi-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
.tsi-section-title { margin: 0 0 .15rem; font-size: 1.05rem; font-weight: 500; color: #212529; letter-spacing: .25px; }
.tsi-section-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tsi-rule { border: 0; border-top: 1px solid rgba(0, 0, 0, .15); margin: .875rem 0 1rem; }

/* §2 Tabs: jQuery UI tabs in tsi.custom.css - bordered buttons, active one TSI purple, bold white. */
.tsi-tabs .mud-tabs-tabbar { background: transparent; }
.tsi-tabs .mud-tabs-tabbar-inner { min-height: 0; gap: 6px; padding-bottom: 10px; flex-wrap: wrap; }
.tsi-tabs .mud-tab-slider { display: none; }
/* Tabs wrap onto more lines instead of scrolling sideways (phones). */
.tsi-tabs .mud-tabs-tabbar-content { white-space: normal; overflow: visible; }
.tsi-tabs .mud-tabs-tabbar-wrapper { width: auto; flex-wrap: wrap; gap: 6px; transform: none !important; }
.tsi-tabs .mud-tabs-scroll-button { display: none; }
.tsi-tabs .mud-tab {
    min-height: 0;
    min-width: 0;
    padding: .45rem 1rem;
    border: 1px solid #868e96; /* 3:1 against white (WCAG 1.4.11) */
    border-radius: 6px;
    background: #fff;
    color: var(--tsi-text);
    text-transform: none;
    font-weight: 400;
    letter-spacing: .5px;
    opacity: 1;
}
.tsi-tabs .mud-tab:hover { background: #f1f0f6; }
.tsi-tabs .mud-tab.mud-tab-active { background: var(--tsi-purple-dark); border-color: var(--tsi-purple-dark); color: #fff; font-weight: 700; }
.tsi-tabs-panel { padding-top: .25rem; }

/* §3 Tables */
.tsi-table .mud-toolbar { padding-left: 0; padding-right: 0; min-height: 52px; height: auto; flex-wrap: wrap; gap: .5rem; }
.tsi-table-search { max-width: 280px; flex: 0 1 280px; }
.tsi-table .mud-table-pagination-toolbar { padding-left: 0; padding-right: 0; flex-wrap: wrap; }
.tsi-table .mud-table-cell { padding-top: 8px; padding-bottom: 8px; }
.tsi-table-empty { margin: .25rem 0 1rem; }
.tsi-table-toolbar-only { margin-bottom: 1rem; }

/* §4 Row actions */
.tsi-row-actions { display: flex; justify-content: flex-end; }
.tsi-dots-button { border: 0; background: transparent; padding: 4px 6px; border-radius: 4px; cursor: pointer; line-height: 0; }
.tsi-dots-button img { width: 18px; height: 18px; }
.tsi-dots-button:hover { background: rgba(0, 0, 0, .06); }
.tsi-dots-button:focus-visible { outline: 2px solid var(--tsi-blue); outline-offset: 1px; }
.mud-menu-item.tsi-danger-item, .mud-menu-item.tsi-danger-item .mud-icon-root { color: var(--tsi-red); }
.mud-menu-item .mud-icon-root.bi { font-size: 1rem; }

/* §5 Form dialog (EHR modal: h2.modal-title, Close left, Save right, min-width 10rem) */
.tsi-dialog-title { margin: 0; font-size: 1.3rem; font-weight: 500; color: #212529; }
.tsi-dialog .mud-dialog-title { border-bottom: 1px solid #dee2e6; padding: 14px 20px; }
.tsi-dialog-content { padding-top: 16px !important; }
.tsi-dialog-actions { border-top: 1px solid #dee2e6; padding: 12px 20px !important; }
.tsi-btn-wide { min-width: 10rem; }
@media (max-width: 599.98px) { .tsi-btn-wide { min-width: 0; } }

/* §6 Read-only fields: four columns, label above value */
.tsi-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1rem; }
.tsi-field-wide { grid-column: span 2; }
.tsi-field-label { display: block; font-size: .8rem; color: #5f676e; margin-bottom: .2rem; }
.tsi-field-value { font-weight: 600; color: #212529; overflow-wrap: anywhere; }
@media (max-width: 1279.98px) { .tsi-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599.98px) { .tsi-fields { grid-template-columns: minmax(0, 1fr); } .tsi-field-wide { grid-column: auto; } }

/* §7 Person heading */
.tsi-person-heading { display: inline-flex; align-items: center; gap: .5rem; }
.tsi-title-avatar { width: 1.2em; height: 1.2em; border-radius: 50%; object-fit: cover; }
.tsi-record-link { margin-left: .25rem; }

/* §8 Action bar */
.tsi-action-bar { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; flex-wrap: nowrap; }
.tsi-action-bar-split { justify-content: space-between; }
.tsi-action-bar-start, .tsi-action-bar-end { display: flex; align-items: center; gap: .5rem; flex-wrap: nowrap; }
.tsi-action-bar .mud-button-label { white-space: nowrap; }
@media (max-width: 599.98px) { .tsi-action-bar, .tsi-action-bar-end, .tsi-action-bar-start { flex-wrap: wrap; } }

/* §9 KPI cards (card radius-10 border-0 border-start border-3 + widget-icon) */
.tsi-accent-orange { --tsi-accent: #ff6632; }
.tsi-accent-black  { --tsi-accent: #000000; }
.tsi-accent-success { --tsi-accent: #12bf24; }
.tsi-accent-pink   { --tsi-accent: #e72e7a; }
.tsi-accent-purple { --tsi-accent: #8932ff; }
.tsi-accent-blue   { --tsi-accent: #3361ff; }
.tsi-accent-info   { --tsi-accent: #32bfff; }
.tsi-accent-danger { --tsi-accent: #e72e2e; }
.tsi-accent-tsi    { --tsi-accent: #4b3b7d; }
.tsi-accent-teal   { --tsi-accent: #2daab8; }

.tsi-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1279.98px) { .tsi-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599.98px) { .tsi-kpi-row { grid-template-columns: minmax(0, 1fr); } }

.tsi-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 10px;
    border-left: 3px solid var(--tsi-accent);
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}
.tsi-kpi-text { flex: 1 1 auto; min-width: 0; }
.tsi-kpi-label { margin: 0 0 .25rem; }
.tsi-kpi-value { margin: 0; font-size: 1.5rem; font-weight: 500; line-height: 1.2; color: #3361ff; } /* .text-tiffany */
.tsi-kpi-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: var(--tsi-accent);
}
.tsi-kpi-link { position: absolute; inset: 0; border-radius: 10px; z-index: 1; }
.tsi-kpi-link:focus-visible { outline: 2px solid var(--tsi-blue); outline-offset: 2px; }
.tsi-kpi:has(.tsi-kpi-link):hover { box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12); }

/* Badges: more kinds alongside .success / .light / .dark above */
.tsi-badge.danger { background-color: var(--tsi-red); color: #fff; }
.tsi-badge.warning { background-color: #febe29; color: #2c323f; }
.tsi-badge.info { background-color: #0a6f9a; color: #fff; } /* white on OneDash #32bfff is only 2.1:1 */
.tsi-badge.tsi { background-color: var(--tsi-purple-dark); color: #fff; }

/* Snackbars: Bootstrap toast look */
.mud-snackbar { border-radius: 6px; letter-spacing: .25px; }
.tsi-fields-stack { grid-template-columns: minmax(0, 1fr) !important; }

/* Cards for learner pages and the home page: a responsive grid of bordered cards. */
.tsi-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1rem; }
.tsi-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--tsi-card-border);
    border-radius: 10px;
}
.tsi-card-head { display: flex; align-items: center; gap: .75rem; }
.tsi-card-icon {
    flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; background: var(--tsi-accent, var(--tsi-purple-dark));
}
.tsi-card-title { margin: 0; font-size: 1.05rem; font-weight: 500; color: #212529; letter-spacing: .25px; }
.tsi-card-code { font-size: .75rem; color: #5f676e; letter-spacing: .5px; }
.tsi-card-body { flex: 1 1 auto; font-size: .875rem; }
.tsi-card-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .25rem; }
.tsi-card-link { position: absolute; inset: 0; border-radius: 10px; z-index: 1; }
.tsi-card:has(.tsi-card-link):hover { box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .1); }
.tsi-card-link:focus-visible { outline: 2px solid var(--tsi-blue); outline-offset: 2px; }
.tsi-fields-two { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.tsi-player-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.tsi-reading { font-size: 1rem; line-height: 1.7; color: #212529; max-width: 75ch; }
/* Video player (Bunny Stream iframe), 16:9 and as wide as the content, up to a comfortable size */
.tsi-video { position: relative; width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.tsi-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tsi-mono textarea { font-family: Consolas, "Courier New", monospace; font-size: .85rem; }
.tsi-video-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: #e9ecef; display: block; }
.tsi-facts { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .35rem; }
.tsi-facts i { color: var(--tsi-purple); margin-right: .4rem; }
/* Quiz in progress: sticky progress / timer / submit bar just under the header */
.tsi-quiz-bar { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; padding: .6rem 1rem; margin-bottom: 1rem; background: #fff; border: 1px solid var(--tsi-card-border); border-radius: 6px; box-shadow: 0 .25rem .75rem rgba(0,0,0,.08); }
/* §11 worklist groups: EHR nav-pills with count badges */
.tsi-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.tsi-pill { border: 1px solid #868e96; background: #fff; color: var(--tsi-text); border-radius: 50rem; padding: .3rem .85rem; font: inherit; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.tsi-pill:hover { background: #f1f0f6; }
.tsi-pill.active { background: var(--tsi-purple-dark); border-color: var(--tsi-purple-dark); color: #fff; font-weight: 500; }
.tsi-pill-count { background: rgba(0,0,0,.08); border-radius: 50rem; padding: 0 .45rem; font-size: .75rem; }
.tsi-pill.active .tsi-pill-count { background: rgba(255,255,255,.25); }
.tsi-pill:focus-visible { outline: 2px solid var(--tsi-blue); outline-offset: 1px; }

/* ── Keyboard ───────────────────────────────────────────────────────────── */
.tsi-skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 2000; padding: .5rem 1rem; border-radius: 6px;
    background: var(--tsi-purple-dark); color: #fff; font-weight: 500; transition: top .15s;
}
.tsi-skip-link:focus { top: 8px; }
.tsi-content:focus { outline: none; }
a:focus-visible, button:focus-visible, .mud-button-root:focus-visible, .mud-nav-link:focus-visible, [role=tab]:focus-visible {
    outline: 2px solid var(--tsi-blue);
    outline-offset: 2px;
}
