/* Fallback styles for pages/components that currently rely on Razor CSS isolation.
   Loaded after YoungbroWeb.styles.css to stabilize rendering across environments. */

.auth-layout {
    position: relative;
    /* Allow vertical scrolling instead of clipping: a column flex with
       margin-auto on the shell centers the content when there is room, and
       falls back to top-aligned + scrollable when the content is taller than
       the viewport (fixes the unreachable top / forced-scroll on short laptops).
       overflow-x stays hidden so the decorative orbs never cause sideways scroll. */
    overflow-x: hidden;
    overflow-y: auto;
    isolation: isolate;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.16), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-shell {
    width: 100%;
    max-width: 1160px;
    margin-inline: auto;
    margin-block: auto;
    position: relative;
    z-index: 1;
}

.auth-logo-wrap {
    margin-bottom: 1rem;
}

.auth-logo-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

.auth-logo {
    width: min(168px, 46vw);
    max-width: 100%;
    height: auto;
    display: block;
}

.auth-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.55;
}

.auth-orb-primary {
    width: 340px;
    height: 340px;
    top: -80px;
    right: min(10vw, 120px);
    background: rgba(59, 130, 246, 0.22);
}

.auth-orb-secondary {
    width: 280px;
    height: 280px;
    bottom: -70px;
    left: min(8vw, 96px);
    background: rgba(16, 185, 129, 0.18);
}

.login-page {
    animation: loginFallbackFadeIn 0.45s ease-out;
}

.login-panel {
    display: flex;
    justify-content: center;
}

.login-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 58rem;
    padding: clamp(1.25rem, 2.4vw, 1.75rem);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
}

.login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 55%);
}

.login-card-header {
    margin-bottom: 1.1rem;
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0.6rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-card-title {
    margin: 0;
    font-size: clamp(1.55rem, 2.2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
}

.login-card-copy {
    max-width: 20rem;
    margin: 0.55rem auto 0;
    color: rgba(15, 23, 42, 0.66);
}

.login-form {
    position: relative;
    width: min(100%, 60%);
    margin: 0 auto;
}

.login-field-label {
    font-weight: 700;
    color: #0f172a;
}

.login-card .form-control {
    min-height: 2.85rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding-inline: 1rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-card .form-control:focus {
    border-color: rgba(37, 99, 235, 0.72);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.login-mfa {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.78);
    padding: 0.7rem 0.9rem;
}

.login-mfa-body {
    margin-top: 0.55rem;
}

.login-submit {
    width: auto;
    min-width: 11rem;
    min-height: 3rem;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #00ff8f, #00a1ff);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-shadow: 0 18px 34px rgba(0, 161, 255, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-submit:hover,
.login-submit:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(0, 161, 255, 0.26);
}

.login-submit:disabled {
    cursor: wait;
    opacity: 1;
    transform: none;
    filter: saturate(0.92);
}

.login-submit-row {
    display: flex;
    justify-content: flex-end;
}

.login-submit-spinner,
.login-submit-loading-label,
.login-processing-indicator {
    display: none;
}

.login-form.is-submitting .login-submit-label {
    display: none;
}

.login-form.is-submitting .login-submit-spinner,
.login-form.is-submitting .login-submit-loading-label {
    display: inline-flex;
}

.login-form.is-submitting .login-processing-indicator {
    display: flex;
}

/* ---------------------------------------------------------------------------
   The in-progress indicator, shared by every auth form that posts through
   login-form.js (/login, /login/mfa, password reset).

   This used to live only in Login.razor's page-local <style>, so the #114 fix
   for it — `:not([hidden]) { display: flex }`, which stops the three dots
   sitting ~3px above the label baseline — applied on /login and nowhere else.
   The OTP page rendered the same markup with none of these rules and so kept
   the original defect. It lives here now: one rule, every auth surface.
   --------------------------------------------------------------------------- */
.login-processing-indicator {
    margin-top: 1rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.22);
    font-weight: 600;
    color: #334155;
}

/* The indicator is shown/hidden via the `hidden` attribute (login-form.js).
   Give it flex layout only when visible so `align-items: center` actually
   vertically centres the pulse, label text and the three dots on one line —
   :not([hidden]) keeps the UA `[hidden]{display:none}` hide working. (#114) */
.login-processing-indicator:not([hidden]) {
    display: flex;
}

.login-processing-indicator__pulse {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.14);
    animation: loginPulse 1.25s ease-in-out infinite;
}

.login-processing-indicator__dots {
    display: inline-flex;
    gap: 0.22rem;
}

.login-processing-indicator__dots > span {
    width: 0.33rem;
    height: 0.33rem;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.35;
    animation: loginDots 1s ease-in-out infinite;
}

.login-processing-indicator__dots > span:nth-child(2) {
    animation-delay: 0.18s;
}

.login-processing-indicator__dots > span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes loginPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.2);
    }

    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 0.45rem rgba(37, 99, 235, 0);
    }
}

@keyframes loginDots {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-1px); }
}

html[data-theme="dark"] .login-processing-indicator,
.dark-mode .login-processing-indicator {
    color: #e2e8f0;
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}

html[data-theme="dark"] .login-processing-indicator__pulse,
.dark-mode .login-processing-indicator__pulse {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.3);
}

/* Short laptop viewports (≈13–16"): compact the auth chrome further so the form
   fits without scrolling. Height-gated, so large monitors are never affected. */
@media (max-height: 820px) {
    .auth-logo {
        width: min(132px, 34vw);
    }

    .auth-logo-wrap {
        margin-bottom: 0.55rem;
    }

    .login-card {
        padding: clamp(1rem, 2vw, 1.4rem);
    }

    .login-card-header,
    .password-update-header {
        margin-bottom: 0.75rem;
    }

    .login-card-title,
    .password-update-title {
        font-size: 1.5rem;
    }

    .login-eyebrow,
    .password-update-eyebrow {
        margin-bottom: 0.45rem;
    }

    .login-card-copy,
    .password-update-copy {
        font-size: 0.9rem;
    }

    .login-card .form-control,
    .password-update-form .form-control {
        min-height: 2.6rem;
    }

    .login-submit {
        min-height: 2.7rem;
    }

    .login-mfa {
        padding: 0.55rem 0.8rem;
    }

    .password-update-card {
        padding: 1.25rem !important;
    }

    .password-update-shield {
        width: 2.3rem !important;
        height: 2.3rem !important;
        margin-bottom: 0.4rem !important;
    }
}

.yb-security-context-panel {
    border: 1px solid rgba(13, 110, 253, 0.14);
    border-radius: 0.8rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(25, 135, 84, 0.05));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    padding: 0.7rem 0.85rem;
    transition: all 0.3s ease;
}

.yb-security-context-panel--collapsed {
    padding: 0.75rem 1rem;
}

.yb-security-context-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}

.yb-security-context-panel--collapsed .yb-security-context-panel__header {
    margin-bottom: 0;
}

.yb-security-context-panel__toggle {
    color: #64748b;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
}

.yb-security-context-panel__toggle:hover {
    color: #0d6efd;
}

.yb-security-context-panel__eyebrow,
.yb-security-context-panel__label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.yb-security-context-panel__title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    margin: 0.2rem 0 0;
}

.yb-security-context-panel__session,
.yb-security-context-panel__chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.36rem 0.62rem;
}

.yb-security-context-panel__session--ready,
.yb-security-context-panel__chip--success {
    background: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.22);
    color: #166534;
}

.yb-security-context-panel__session--pending,
.yb-security-context-panel__chip--muted {
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.24);
    color: #475467;
}

.yb-security-context-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.5rem;
}

.yb-security-context-panel__item {
    display: grid;
    gap: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.55rem 0.65rem;
    min-width: 0;
}

.yb-security-context-panel__item--wide {
    grid-column: span 2;
}

.yb-security-context-panel__item strong {
    color: #0f172a;
    word-break: break-word;
}

.yb-security-context-panel__hint {
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
}

.yb-security-context-panel__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.yb-security-context-panel__chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(13, 110, 253, 0.18);
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.36rem 0.62rem;
}

.page-title-heading {
    font-size: 24px;
    font-weight: bold !important;
    color: #495057;
    margin: 5px;
}

.page-subtitle {
    color: #6c757d;
    font-size: 1.1em;
    font-weight: 500;
    line-height: 1.4;
}

html[data-theme="dark"] .auth-layout {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.16), transparent 30%),
        linear-gradient(180deg, #020617 0%, #111827 100%);
}

html[data-theme="dark"] .login-card {
    background: rgba(15, 23, 42, 0.88);
}

html[data-theme="dark"] .login-card-title,
.dark-mode .login-card-title {
    color: #f8fafc;
}

html[data-theme="dark"] .yb-security-context-panel,
.dark-mode .yb-security-context-panel {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(34, 197, 94, 0.12));
    border-color: rgba(96, 165, 250, 0.2);
    box-shadow: none;
}

html[data-theme="dark"] .yb-security-context-panel__title,
html[data-theme="dark"] .yb-security-context-panel__item strong,
.dark-mode .yb-security-context-panel__title,
.dark-mode .yb-security-context-panel__item strong {
    color: #f8fafc;
}

html[data-theme="dark"] .yb-security-context-panel__eyebrow,
html[data-theme="dark"] .yb-security-context-panel__label,
html[data-theme="dark"] .yb-security-context-panel__hint,
.dark-mode .yb-security-context-panel__eyebrow,
.dark-mode .yb-security-context-panel__label,
.dark-mode .yb-security-context-panel__hint {
    color: #cbd5e1;
}

html[data-theme="dark"] .yb-security-context-panel__item,
.dark-mode .yb-security-context-panel__item {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .yb-security-context-panel__chip,
.dark-mode .yb-security-context-panel__chip {
    background: rgba(96, 165, 250, 0.16);
    border-color: rgba(96, 165, 250, 0.28);
    color: #bfdbfe;
}

html[data-theme="dark"] .yb-security-context-panel__session--ready,
html[data-theme="dark"] .yb-security-context-panel__chip--success,
.dark-mode .yb-security-context-panel__session--ready,
.dark-mode .yb-security-context-panel__chip--success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.32);
    color: #bbf7d0;
}

html[data-theme="dark"] .yb-security-context-panel__session--pending,
html[data-theme="dark"] .yb-security-context-panel__chip--muted,
.dark-mode .yb-security-context-panel__session--pending,
.dark-mode .yb-security-context-panel__chip--muted {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
}

html[data-theme="dark"] .yb-security-context-panel__toggle,
.dark-mode .yb-security-context-panel__toggle {
    color: #cbd5e1;
}

html[data-theme="dark"] .yb-security-context-panel__toggle:hover,
.dark-mode .yb-security-context-panel__toggle:hover {
    color: #60a5fa;
}

@media (max-width: 767.98px) {
    .yb-security-context-panel__item--wide {
        grid-column: span 1;
    }
}

@media (max-width: 575.98px) {
    .login-form {
        width: 100%;
    }

    .login-card {
        border-radius: 24px;
        padding: 1.35rem;
    }
}

@keyframes loginFallbackFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Migrated from MainLayout.razor.css, NavMenu.razor.css, AccessDenied.razor.css, AnalyticsKpiDashboard.razor.css */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

.layout-shell {
    position: relative;
    overflow-x: clip;
}

main {
    flex: 1;
}

.main-column {
    min-width: 0;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

/* ── Authoritative dark-mode sidebar ──────────────────────────────────────
   site.css carries several .dark-mode .sidebar duplicates plus a !important
   [data-theme="dark"] .bg-light background colour, which otherwise flatten the
   sidebar to grey. This rule is loaded last and uses !important so the brand
   gradient renders in dark mode too — matching the light-mode look. */
/* Dark mode: paint ONE muted grey+purple gradient on the whole sidebar column so
   the logo header and the nav share a single continuous surface (no reset at the
   header/menu boundary). */
.dark-mode .sidebar-column,
[data-theme="dark"] .sidebar-column {
    background-image: linear-gradient(180deg, #1c1c1c 0%, #000000 100%) !important;
}

/* Logo header + sidebar are transparent so the column gradient shows through both. */
.dark-mode .logo-header,
[data-theme="dark"] .logo-header,
.dark-mode .sidebar,
[data-theme="dark"] .sidebar {
    background-color: transparent !important;
    background-image: none !important;
}

.dark-mode .sidebar,
[data-theme="dark"] .sidebar {
    color: #ffffff !important;
}

/* Keep the menu containers transparent too, so nothing fills the menu area. */
.dark-mode .sidebar .nav-scrollable,
.dark-mode .sidebar nav,
[data-theme="dark"] .sidebar .nav-scrollable,
[data-theme="dark"] .sidebar nav {
    background: transparent !important;
}

/* ── EXPERIMENTAL (easy to revert): extend the sidebar gradient to the top
   banner and footer so all the chrome shares one uniform dark-mode surface.
   Remove this block to go back to the plain page-coloured banner/footer. */
.dark-mode .top-row,
[data-theme="dark"] .top-row,
.dark-mode footer,
[data-theme="dark"] footer {
    background-color: transparent !important;
    background-image: linear-gradient(180deg, #1c1c1c 0%, #000000 100%) !important;
}

.sidebar-column {
    width: 250px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}

.sidebar-column .logo-header,
.sidebar-column .sidebar {
    width: 100%;
    min-width: 0;
}

.sidebar-column .sidebar {
    flex: 1;
    overflow-y: auto;
}

.logo-img {
    width: 200px;
    max-width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-shrink: 0;
}

.mobile-menu-backdrop {
    display: none;
}

.top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.top-row a,
.top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.top-row a:hover,
.top-row .btn-link:hover {
    text-decoration: underline;
}

.top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-row-user-greeting {
    color: var(--bs-emphasis-color);
}

.top-row-user-link {
    color: inherit;
}

.top-row-user-link:hover,
.top-row-user-link:focus-visible {
    color: var(--bs-primary);
}

/* #293: the display name took as much room as it liked and everything else in the bar paid for it.
   Measured at a 768px viewport: the greeting alone was 298px of a 518px bar, which put the Logout
   button past the right edge and left the breadcrumb nothing to occupy. Nothing let it yield: no
   cap, no ellipsis, and site.css holds its whole cluster at flex-shrink: 0.

   Capped, not re-plumbed. Letting the cluster shrink instead was tried first and is the tidier idea
   on paper, but in this bar it does not hold: Bootstrap's flex-shrink-0 utility carries !important,
   and with it removed the cluster shrank past its own contents and spilled the buttons out of its
   right-hand side. Two sizing systems arguing over one row is not worth a greeting.

   The cap sits on the NAME, not on the whole greeting. Capping the phrase looked equivalent and was
   not: at 992px it rendered "Welcome, ..." — the ellipsis ate the entire name and the bar greeted
   nobody. "Welcome," is fixed furniture and always fits; the name is the variable-length part, so
   the name is the part that gets a budget.

   The steps come from the bar's budget rather than from the breakpoint list: the controls take a
   fixed ~250px at every width, the trail wants ~300px to show a full three-crumb path, and the name
   gets what is left. Below 992px the greeting is not shown at all (d-lg-inline) — there is nothing
   left to give it, and a name trimmed to two characters is noise rather than an identity.

   Truncating is safe here because nothing is lost: the anchor carries a title with the full name,
   and it links to the profile that spells it out. */
.top-row-user-name {
    display: inline-block;
    max-width: 18rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

@media (max-width: 1399.98px) {
    .top-row-user-name {
        max-width: 15rem;
    }
}

@media (max-width: 1199.98px) {
    .top-row-user-name {
        max-width: 7rem;
    }
}

/* ── Breadcrumb (#290) ───────────────────────────────────────────────────────────────────────────
   The trail is a path with a destination, not a row of equal links: the steps behind you are muted
   and quiet, and the page you are on is the one thing carrying weight — the same way the sidebar
   marks its active item. The current crumb is never a link (it has nowhere to go), so it must earn
   its distinction from colour and surface rather than from an underline.

   Truncation runs the other way round from the rule this replaced. `.breadcrumb-container` clipped
   the container's tail, which meant the current page — the crumb that tells you where you are — was
   the first thing to disappear on a narrow screen, and "Home >" was the last thing kept. Here the
   steps shrink and ellipsize individually while the destination is held at its natural width, and
   below the tablet breakpoint everything but the last two steps drops out entirely. */

/* site.css says .top-row .d-flex { flex-shrink: 0 } — "ensure the buttons don't get compressed".
   Both halves of the bar match that selector, so the half holding the trail could not yield either,
   and at 390px the bar overflowed and carried Logout off the screen. The account controls keep the
   rule; the trail's side is the half that should give way, and says so by name. */
.top-row .yb-crumbs-host {
    flex-shrink: 1;
    min-width: 0;
}

.yb-crumbs {
    display: flex;
    align-items: center;
    min-width: 0;
}

.yb-crumbs__list {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Shrink order, not shrink permission. The destination has to be the last thing to give up room —
   but it must still give it up. An earlier version said flex-shrink: 0 on the current crumb, which
   protected it by making the whole trail incompressible: at 390px the bar then overflowed by 158px
   and pushed Logout clean off the screen (measured, not guessed). A high shrink factor on the steps
   and a low one on the destination gets the priority without the deadlock. */
.yb-crumbs__item {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    min-width: 0;
    flex-shrink: 4;
}

.yb-crumbs__item--current {
    flex-shrink: 1;
    min-width: 4.5rem;
}

.yb-crumbs__crumb {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.2rem 0.45rem;
    border-radius: var(--yb-radius-sm);
    font-family: var(--yb-font-body);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.yb-crumbs__text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.yb-crumbs__crumb--link,
.yb-crumbs__crumb--step {
    color: var(--yb-text-muted);
    font-weight: 500;
}

.yb-crumbs__crumb--link {
    text-decoration: none;
    transition: color var(--yb-dur) var(--yb-ease), background-color var(--yb-dur) var(--yb-ease);
}

/* Hover is a NEUTRAL block, not a brand-tinted one (owner choice, reviewed against four
   alternatives in the browser in both themes). Two things had to be true at once: the crumb needs a
   shape to react to — colour alone on a 13px word barely registers — and whatever shape it gets
   must not be mistakable for the accent-tinted current crumb sitting inches away. A blue wash
   failed the second test badly in dark mode, where it rendered as very nearly the same block.

   The greys are the ink the token file already mixes its borders from — rgba(16, 31, 64, …) in
   light and rgba(148, 170, 205, …) in dark — so the wash sits in the palette without needing a
   token of its own. Text goes to --yb-text rather than into the brand ramp for the same reason the
   current crumb does not: blue text in this app means "clickable", and the hover already says that
   by existing. The weight is owner-picked from four rendered side by side in both themes — a wash
   light enough to be tasteful in a screenshot turned out to be too quiet to notice under a moving
   cursor, which is not a judgement any amount of staring at the values would have produced.

   Selectors are written .yb-crumbs .yb-crumbs__crumb--link rather than on the crumb alone, and the
   redundant-looking ancestor is load-bearing: site.css carries a bare a:hover in light and a
   [data-theme="dark"] a:hover in dark (#291, the app-wide coral/orange). The dark one weighs
   (0,2,1), so a single-class hover rule loses to it and every hovered crumb turned orange — visible
   only in dark, which is why this was screenshotted in both themes. Two classes settle it. */
.yb-crumbs .yb-crumbs__crumb--link:hover,
.yb-crumbs .yb-crumbs__crumb--link:focus-visible {
    color: var(--yb-text);
    background-color: rgba(16, 31, 64, 0.19);
}

[data-theme="dark"] .yb-crumbs .yb-crumbs__crumb--link:hover,
[data-theme="dark"] .yb-crumbs .yb-crumbs__crumb--link:focus-visible {
    background-color: rgba(148, 170, 205, 0.34);
}

/* .top-row a carries margin-left: 1.5rem and a hover underline for the auth links on the other side
   of the bar; both land on every crumb as well, which is where the trail's lopsided 24px-after /
   4px-before spacing came from. Undone here for the trail rather than by narrowing that rule, which
   other things in the bar rely on. */
.top-row .yb-crumbs__crumb--link {
    margin-left: 0;
}

.top-row .yb-crumbs__crumb--link:hover,
.top-row .yb-crumbs__crumb--link:focus-visible {
    text-decoration: none;
}

.yb-crumbs__crumb--link:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

/* The destination. A tinted block rather than a bordered one: the top bar already holds three
   bordered controls, and a fourth would read as a button the user cannot press. The tint is the
   accent at a tenth, which is the same move the sidebar makes to mark its active item — the page
   you are on is marked the same way in both places. The text stays --yb-text rather than going
   brand-coloured, because blue text in this app means "you can click this", and this crumb is
   exactly the one you cannot. */
.yb-crumbs__crumb--current {
    color: var(--yb-text);
    font-weight: 600;
    background-color: rgba(var(--yb-accent-rgb), 0.10);
}

[data-theme="dark"] .yb-crumbs__crumb--current {
    background-color: rgba(var(--yb-accent-rgb), 0.24);
}

.yb-crumbs__icon {
    flex-shrink: 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

.yb-crumbs__sep {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: var(--yb-text-soft);
}

/* Two steps down, because the bar is competing for the same pixels as the menu button and the
   account controls, and those are things the user acts on. Tablet width keeps the parent for
   context; phone width keeps only the destination, which is the crumb worth having.

   The tablet step starts at 992 rather than 768 (#293): between those two the greeting is at its
   tightest cap and the controls still take their fixed 250px, which left a three-crumb trail trying
   to render itself in 60px. Two crumbs with room to be read beat three that cannot be. */
@media (max-width: 991.98px) {
    .yb-crumbs__item:not(:nth-last-child(-n + 2)) {
        display: none;
    }
}

@media (max-width: 479.98px) {
    .yb-crumbs__item:not(:last-child) {
        display: none;
    }
}

/* One step earlier than the two above, and it drops the root rather than the middle. Just under
   1200px the greeting is at its tightest cap and the trail is left around 186px for three crumbs,
   which rendered the middle one as "G…" — a crumb narrow enough to be unreadable is worse than one
   that is not there. The root is the step that can go: it is a single fixed destination, it is the
   first entry in the sidebar, and it carries the least about where you are. */
@media (max-width: 1199.98px) {
    .yb-crumbs__item:first-child {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .top-row .yb-crumbs__crumb--link {
        transition: none;
    }
}

/* The workspace gate's .auth-context-gate* rules are gone: the loading half is now .yb-skel-page
   and the "secure access not ready" half is a YbStateBlock. These carried bootstrap-blue
   (#0d6efd / #8ab4ff) rather than the app's tokens, and dark mode via the legacy .dark-mode
   selector rather than [data-theme="dark"]. (#208 review) */

.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: white;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}

.navbar-toggler:checked {
    background-color: rgba(255, 255, 255, 0.5);
}

.navbar-brand {
    font-size: 1.1rem;
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.1rem;
}

.nav-item:last-of-type {
    padding-bottom: 0.4rem;
}

.nav-item .nav-link {
    color: #d7d7d7;
    background: none;
    border: none;
    border-radius: 4px;
    padding: 5px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    width: 100%;
    white-space: nowrap;
}

.nav-item a.active {
    background-color: rgba(255, 255, 255, 0.37);
    color: white;
}

.nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-scrollable {
    display: block;
}

.access-denied-card {
    border: 1px solid var(--bs-border-color-translucent);
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.06), rgba(220, 53, 69, 0.02));
}

.access-denied-icon {
    color: #c62828;
}

.access-denied-title {
    color: var(--bs-emphasis-color);
}

.access-denied-copy {
    color: var(--bs-secondary-color);
}

.access-denied-action {
    min-width: 10.5rem;
}

.access-denied-action:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.45);
    outline-offset: 2px;
}

.dark-mode .access-denied-card,
[data-theme="dark"] .access-denied-card {
    border-color: rgba(173, 181, 189, 0.38);
    background: linear-gradient(180deg, rgba(198, 40, 40, 0.2), rgba(198, 40, 40, 0.08));
}

.dark-mode .access-denied-icon,
[data-theme="dark"] .access-denied-icon {
    color: #ff8a80;
}

.analytics-kpi-dashboard .analytics-group {
    border-left: 4px solid rgba(13, 110, 253, 0.25);
    padding-left: 0.9rem;
}

.analytics-kpi-dashboard .kpi-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-kpi-dashboard .progress {
    height: 10px;
}

.analytics-kpi-dashboard .table td,
.analytics-kpi-dashboard .table th {
    white-space: nowrap;
}

@media (max-width: 1399.98px) {
    .analytics-kpi-dashboard .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .analytics-kpi-dashboard .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-kpi-dashboard .analytics-group {
        border-left: none;
        padding-left: 0;
    }
}

@media (max-width: 767.98px) {
    .sidebar-column {
        position: fixed;
        top: 0;
        left: 0;
        width: min(85vw, 250px);
        min-width: min(85vw, 250px);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 1040;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .sidebar-column.open {
        transform: translateX(0);
    }

    .mobile-menu-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(0, 0, 0, 0.35);
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1020;
        justify-content: space-between;
    }

    .top-row a,
    .top-row .btn-link {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .analytics-kpi-dashboard .kpi-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }

    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: block;
        height: auto;
        overflow-y: visible;
    }

    .sidebar-column {
        transform: none !important;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row,
    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* The default Blazor #blazor-error-ui styling was removed: the global error UI is
   now fully styled in css/error-ui.css. Leaving the old rule here caused a cascade
   conflict — its `left: 0` combined with the new rule's `translateX(-50%)` shifted
   the banner half a viewport to the left, hiding the message off-screen. */

/* ==========================================================================
   ManualEntryKeyField — MFA authenticator secret shown in full (not a
   truncating one-line input) with a Copy affordance. Token-driven so light
   and dark are covered automatically. (#86)
   ========================================================================== */
.yb-keyfield__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.yb-keyfield__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--yb-brand-600);
}

.yb-keyfield__copy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    color: var(--yb-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.yb-keyfield__copy:hover:not(:disabled),
.yb-keyfield__copy:focus-visible:not(:disabled) {
    color: var(--yb-brand-600);
    border-color: var(--yb-brand-400);
}

.yb-keyfield__copy:disabled {
    opacity: 0.5;
    cursor: default;
}

.yb-keyfield__copy.is-copied {
    color: var(--yb-success);
    border-color: rgba(var(--yb-success-rgb), 0.55);
    background: rgba(var(--yb-success-rgb), 0.10);
}

/* The whole key, grouped in 4s, wrapped — never clipped inside a scrolling box. */
.yb-keyfield__value {
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    word-spacing: 0.2em;
    line-height: 1.55;
    color: var(--yb-text);
    background: var(--yb-surface-sunken);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    padding: 0.7rem 0.8rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-user-select: all;
    user-select: all;
}

.yb-keyfield__value:focus-visible {
    outline: 2px solid var(--yb-brand-400);
    outline-offset: 2px;
}

.yb-keyfield__help {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--yb-text-soft);
}

/* ==========================================================================
   BreakGlassConfirmDialog — emergency confirmation for a break-glass
   privileged-role grant. High-stakes + audited, so the design stays quiet
   and precise with a single amber "break-glass" accent. Token-driven. (#86)
   ========================================================================== */
.yb-bgd-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 15, 34, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: yb-bgd-fade 0.16s ease-out;
}

.yb-bgd {
    position: relative;
    width: min(100%, 30rem);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-lg);
    box-shadow: var(--yb-shadow-lg);
    animation: yb-bgd-rise 0.18s ease-out;
}

/* The "break-glass" cue: a thin amber alert bar across the top edge. */
.yb-bgd::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: var(--yb-radius-lg) var(--yb-radius-lg) 0 0;
    background: linear-gradient(90deg, var(--yb-warning), #f6c453);
}

.yb-bgd__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.15rem 1.25rem 0.75rem;
}

.yb-bgd__badge {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--yb-radius);
    background: rgba(var(--yb-warning-rgb), 0.14);
    color: var(--yb-warning);
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(var(--yb-warning-rgb), 0.28);
}

.yb-bgd__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.yb-bgd__eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    /* Darker amber for AA contrast as small text on the light surface; the brighter
       token amber is restored on the dark surface below. */
    color: #8a5d00;
}

[data-theme="dark"] .yb-bgd__eyebrow {
    color: var(--yb-warning);
}

.yb-bgd__title {
    margin: 0;
    font-family: var(--yb-font-display);
    font-size: 1.22rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--yb-text);
}

.yb-bgd__close {
    flex: none;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--yb-radius-sm);
    background: transparent;
    color: var(--yb-text-soft);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.yb-bgd__close:hover:not(:disabled) {
    background: var(--yb-surface-2);
    color: var(--yb-text);
}

.yb-bgd__close:disabled {
    opacity: 0.4;
    cursor: default;
}

.yb-bgd__body {
    padding: 0 1.25rem 0.5rem;
}

.yb-bgd__note {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--yb-text-muted);
    background: rgba(var(--yb-warning-rgb), 0.09);
    border: 1px solid rgba(var(--yb-warning-rgb), 0.22);
    border-radius: var(--yb-radius);
}

.yb-bgd__note i {
    color: var(--yb-warning);
    margin-top: 0.1rem;
}

.yb-bgd__note strong {
    color: var(--yb-text);
    font-weight: 700;
}

.yb-bgd__facts {
    margin: 0;
}

.yb-bgd__fact {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0;
    border-top: 1px solid var(--yb-border);
}

.yb-bgd__fact:first-child {
    border-top: none;
}

.yb-bgd__key {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--yb-text-soft);
}

.yb-bgd__val {
    margin: 0;
    font-size: 0.92rem;
    color: var(--yb-text);
    overflow-wrap: anywhere;
}

.yb-bgd__val--reason {
    font-style: italic;
    color: var(--yb-text-muted);
}

.yb-bgd__role {
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--yb-brand-600);
    background: rgba(var(--yb-accent-rgb), 0.10);
    border: 1px solid rgba(var(--yb-accent-rgb), 0.20);
    border-radius: var(--yb-radius-sm);
    padding: 0.1rem 0.4rem;
}

/* --yb-brand-600 (#1453c4) has no dark override; as small label/chip text it drops
   below AA on dark surfaces. Use the lighter brand ramp step in dark, matching how
   other blue text is handled app-wide. */
[data-theme="dark"] .yb-keyfield__label,
[data-theme="dark"] .yb-bgd__role {
    color: var(--yb-brand-400);
}

.yb-bgd__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem 1.15rem;
}

.yb-bgd__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--yb-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.yb-bgd__btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.yb-bgd__btn--ghost {
    background: var(--yb-surface);
    border-color: var(--yb-border-strong);
    color: var(--yb-text-muted);
}

.yb-bgd__btn--ghost:hover:not(:disabled) {
    background: var(--yb-surface-2);
    color: var(--yb-text);
}

.yb-bgd__btn--break {
    background: var(--yb-warning);
    color: #3b2600;
    box-shadow: 0 6px 16px rgba(var(--yb-warning-rgb), 0.32);
}

.yb-bgd__btn--break:hover:not(:disabled) {
    background: #cf9405;
}

@keyframes yb-bgd-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes yb-bgd-rise {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .yb-bgd-overlay,
    .yb-bgd {
        animation: none;
    }
}

/* Inline confirmation strip for destructive admin on-behalf actions (temporary
   password reset, MFA re-enrollment). Warning-toned, rounded-rectangle to match
   the design language; dark mode is handled by the token overrides. */
.admin-inline-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(var(--yb-warning-rgb), 0.28);
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-warning-rgb), 0.10);
    color: var(--yb-text);
}

.admin-inline-confirm__body {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 16rem;
    font-size: 0.9rem;
    line-height: 1.35;
}

.admin-inline-confirm__icon {
    color: var(--yb-warning);
    font-size: 1.05rem;
    line-height: 1.2;
    flex: 0 0 auto;
}

.admin-inline-confirm__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

/* ===================================================================
   Shared confirm / delete dialog (YbConfirmDialog control)
   One on-brand danger confirmation for every result grid's row delete,
   replacing the per-page inline SfDialog copies. SfDialog-based, so the
   Syncfusion header wrapper (a stray cream #fff3cd) is overridden onto
   the design surface; header mirrors the break-glass badge/eyebrow/title.
   =================================================================== */
.yb-confirm-dialog.e-dialog {
    border-radius: var(--yb-radius-lg);
    border: 1px solid var(--yb-border);
    box-shadow: var(--yb-shadow-lg);
    overflow: hidden;
}

/* Same two-wrapper treatment as .yb-dialog below (#213): Syncfusion pads and
   borders BOTH nested header wrappers — pad and divide on the outer only. */
.yb-confirm-dialog .e-dlg-header,
.yb-confirm-dialog .e-dlg-header-content {
    background: var(--yb-surface) !important;
    border-bottom: 0 !important;
}

.yb-confirm-dialog .e-dlg-header-content {
    padding: 1rem 1.15rem 0.75rem !important;
    border-bottom: 1px solid var(--yb-border) !important;
}

.yb-confirm-dialog .e-dlg-header {
    padding: 0 !important;
}

.yb-confirm-dialog .e-dlg-content {
    background: var(--yb-surface);
    color: var(--yb-text);
    padding: 0 1.15rem 1.1rem !important;
}

.yb-confirm-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.yb-confirm-badge {
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--yb-radius);
    background: rgba(214, 45, 32, 0.12);
    color: #d62d20;
    font-size: 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(214, 45, 32, 0.28);
}

.yb-confirm-heading {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.yb-confirm-eyebrow {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b42318;
}

[data-theme="dark"] .yb-confirm-eyebrow {
    color: #ff9c8f;
}

.yb-confirm-title {
    margin: 0;
    font-family: var(--yb-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--yb-text);
}

.yb-confirm-body {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--yb-text-muted);
    /* Air below the header divider, mirroring the dialog-body convention (#213). */
    padding-top: 10px;
    margin-bottom: 1rem;
}

.yb-confirm-body strong {
    color: var(--yb-text);
    font-weight: 600;
}

.yb-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--yb-border);
}

.yb-confirm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.46rem 1.05rem;
    border-radius: var(--yb-radius-sm);
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--yb-dur) var(--yb-ease),
                border-color var(--yb-dur) var(--yb-ease),
                color var(--yb-dur) var(--yb-ease),
                box-shadow var(--yb-dur) var(--yb-ease),
                transform var(--yb-dur) var(--yb-ease);
}

.yb-confirm-btn:hover { transform: translateY(-1px); }
.yb-confirm-btn:active { transform: translateY(0); }
.yb-confirm-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.yb-confirm-btn--ghost {
    background: var(--yb-surface);
    border-color: var(--yb-border-strong);
    color: var(--yb-text-muted);
}

.yb-confirm-btn--ghost:hover:not(:disabled) {
    background: var(--yb-surface-2);
    color: var(--yb-text);
}

.yb-confirm-btn--danger {
    background: #d62d20;
    border-color: #d62d20;
    color: #fff;
    box-shadow: 0 4px 12px rgba(214, 45, 32, 0.28);
}

.yb-confirm-btn--danger:hover:not(:disabled) {
    background: #b42318;
    border-color: #b42318;
}

/* ===================================================================
   Unified dialog primitives (#142)
   Shared, brand-toned chrome/header/footer for SfDialog-based dialogs so
   they match the design language — the neutral counterpart to the
   danger-specific YbConfirmDialog above. Add `yb-dialog` to an SfDialog's
   CssClass to get the tokenized surface (kills the stray Syncfusion cream
   header), the badge + eyebrow + title header, and the ghost/primary footer.
   Consumers: OrgPinDialog, Admin Security/Activity Log detail dialog.
   =================================================================== */
.yb-dialog.e-dialog {
    border-radius: var(--yb-radius-lg);
    border: 1px solid var(--yb-border);
    box-shadow: var(--yb-shadow-lg);
    overflow: hidden;
}

/* The header is TWO nested wrappers (.e-dlg-header-content > .e-dlg-header) and
   Syncfusion styles both: doubled padding below the title and a bottom border on
   each (the inner one in the same stray cream this block suppresses). Pad and
   divide on the OUTER wrapper only; the inner contributes nothing of its own. */
.yb-dialog .e-dlg-header,
.yb-dialog .e-dlg-header-content {
    background: var(--yb-surface) !important;
    border-bottom: 0 !important;
}

.yb-dialog .e-dlg-header-content {
    padding: 1rem 1.15rem 0.75rem !important;
    border-bottom: 1px solid var(--yb-border) !important;
}

.yb-dialog .e-dlg-header {
    padding: 0 !important;
}

.yb-dialog .e-dlg-content {
    background: var(--yb-surface);
    color: var(--yb-text);
    padding: 0 1.15rem 1.1rem !important;
}

/* Pin the Syncfusion close (×) button to the header's top-right corner. Without
   this it renders in normal flow and pushes the title down by a full row (~20px),
   which read as "too much gap at the top" vs the YbConfirmDialog reference (#142). */
.yb-dialog .e-dlg-header-content {
    position: relative;
}

.yb-dialog .e-dlg-header-content > .e-dlg-closeicon-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.9rem;
    z-index: 1;
    color: var(--yb-text-muted);
}

.yb-dialog-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.yb-dialog-badge {
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--yb-radius);
    background: rgba(var(--yb-accent-rgb), 0.12);
    color: var(--yb-accent-text);
    font-size: 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(var(--yb-accent-rgb), 0.28);
}

.yb-dialog-heading {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.yb-dialog-eyebrow {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--yb-accent-text);
}

.yb-dialog-title {
    margin: 0;
    font-family: var(--yb-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--yb-text);
}

.yb-dialog-subtitle {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--yb-text-muted);
}

.yb-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--yb-border);
}

/* Syncfusion's FooterTemplate wrapper draws its OWN hairline, so a .yb-dialog-footer placed
   inside one produced two lines 30px apart (measured: a grey #dee2e6 on .e-footer-content and
   our tokenized one below it). Same doubled-divider trap as the header in #213: draw ONE line,
   on the outer wrapper, tokenized — and let our footer just lay the buttons out.

   Dialogs that render .yb-dialog-footer inside Content (OrgPin, CustomSetting, temp-wearables)
   are untouched: they have no .e-footer-content to sit in, so they keep drawing their own. */
.yb-dialog .e-footer-content {
    background: var(--yb-surface);
    border-top: 1px solid var(--yb-border);
    padding: 0.75rem 1.15rem 0.85rem;
}

.yb-dialog .e-footer-content .yb-dialog-footer {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Left-anchor a secondary action (e.g. Unpin) while the primary group stays right. */
.yb-dialog-footer--split {
    justify-content: space-between;
}

.yb-dialog-footer__group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.yb-dialog-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.46rem 1.05rem;
    border-radius: var(--yb-radius-sm);
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--yb-dur) var(--yb-ease),
                border-color var(--yb-dur) var(--yb-ease),
                color var(--yb-dur) var(--yb-ease),
                box-shadow var(--yb-dur) var(--yb-ease),
                transform var(--yb-dur) var(--yb-ease);
}

.yb-dialog-btn:hover:not(:disabled) { transform: translateY(-1px); }
.yb-dialog-btn:active { transform: translateY(0); }
.yb-dialog-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.yb-dialog-btn--ghost {
    background: var(--yb-surface);
    border-color: var(--yb-border-strong);
    color: var(--yb-text-muted);
}

.yb-dialog-btn--ghost:hover:not(:disabled) {
    background: var(--yb-surface-2);
    color: var(--yb-text);
}

.yb-dialog-btn--primary {
    background: var(--yb-accent);
    border-color: var(--yb-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--yb-accent-rgb), 0.28);
}

.yb-dialog-btn--primary:hover:not(:disabled) {
    background: var(--yb-brand-600);
    border-color: var(--yb-brand-600);
}

.yb-dialog-btn--danger {
    background: transparent;
    border-color: transparent;
    color: var(--yb-danger-text);
}

.yb-dialog-btn--danger:hover:not(:disabled) {
    background: rgba(var(--yb-danger-rgb), 0.10);
    color: var(--yb-danger-text);
}

/* Dark-mode parity for native controls inside a unified dialog (#158).
   Syncfusion editors theme themselves, so a dialog built from them looked right in dark mode and
   nobody noticed that plain Bootstrap .form-control / .form-select / <textarea> do not: they kept a
   white fill on the dark surface. CustomSettingDialog is mostly native controls, so enabling it
   surfaced this. Fixed here rather than in that one dialog so every yb-dialog inherits the parity.
   Light mode is left to Bootstrap — only the dark side is wrong. */
[data-theme="dark"] .yb-dialog .form-control,
[data-theme="dark"] .yb-dialog .form-select,
[data-theme="dark"] .yb-dialog textarea.form-control {
    background-color: var(--yb-surface-2);
    color: var(--yb-text);
    border-color: var(--yb-border-strong);
}

[data-theme="dark"] .yb-dialog .form-control::placeholder {
    color: var(--yb-text-soft);
    opacity: 1;
}

[data-theme="dark"] .yb-dialog .form-control:focus,
[data-theme="dark"] .yb-dialog .form-select:focus {
    background-color: var(--yb-surface-2);
    color: var(--yb-text);
}

[data-theme="dark"] .yb-dialog .form-control:disabled,
[data-theme="dark"] .yb-dialog .form-select:disabled {
    background-color: var(--yb-surface-sunken);
    color: var(--yb-text-soft);
}

/* Bootstrap paints the <select> chevron as a dark SVG data-URI, which disappears against the dark
   fill above. Repaint it in the muted text colour. */
[data-theme="dark"] .yb-dialog .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a3b0c7' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Effective analytics window (#160) — the period the results on screen actually cover, read off the
   API response. Previously nothing showed the window at all (and for "Last 3 Months" it lived only
   in a hover tooltip), so a user could not tell what period they were looking at. */
.yb-analytics-window {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
    font-size: 0.82rem;
}

.yb-analytics-window strong {
    color: var(--yb-text);
    font-weight: 600;
}

.yb-analytics-window > i {
    color: var(--yb-accent-text);
}

/* The deep link's period had to change to be shown (#425): said beside the window line, in words,
   so "Showing …" never describes a different search from the one asked for without explanation. */
.yb-analytics-window-note {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    width: fit-content;
    max-width: min(60rem, 100%);
    margin: -0.35rem auto 0.85rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(var(--yb-warning-rgb), 0.4);
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-warning-rgb), 0.08);
    color: var(--yb-text);
    font-size: 0.82rem;
}

.yb-analytics-window-note > i {
    flex: none;
    margin-top: 0.1rem;
    color: var(--yb-warning);
}

/* ── Counseling dialogs on the analytics pages (#142/#214 unification) ────────────────────────
   These were the last hand-rolled Bootstrap .modal blocks in the app. They now ride .yb-dialog
   like every other dialog; only their bodies need anything of their own. */
.yb-counsel-dialog__body {
    display: grid;
    gap: 0.85rem;
    padding-top: 10px;   /* the shared air below the header divider (#213) */
    max-height: min(60vh, 30rem);
    overflow-y: auto;
}

.yb-counsel-field {
    display: grid;
    gap: 0.3rem;
}

/* .yb-counsel-dialog__loading removed — the counselor dialogs use YbStateBlock (#233). */

/* ── Parent intimation, inside the counselling dialogs (#324) ─────────────────────────────────
   "Was the parent told, and when" is captured in two places — a tick box on New session, and an
   amend dialog opened from the history grid — so the two share this vocabulary rather than each
   inventing one. The row badge's colours are stated once more beside .cstate-incounsel at the
   foot of this file, where the summary-row chips live; the two must not drift.

   The tick box is laid out as a flex row rather than left to Bootstrap's .form-check, which
   floats the input and reserves 1.5em of padding for it: inside the dialog body's grid that
   padding pushes the box off the column every other control sits in, and leaves the box and its
   text on different baselines (the same trap .yb-ops-search__check documents). */
.yb-counsel-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    min-height: 1.75rem;
    padding-left: 0;
}

.yb-counsel-check .form-check-input {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    border-color: var(--yb-border-strong);
    cursor: pointer;
}

.yb-counsel-check .form-check-input:checked {
    background-color: var(--yb-brand-600);
    border-color: var(--yb-brand-600);
}

.yb-counsel-check .form-check-input:focus {
    box-shadow: var(--yb-ring);
}

.yb-counsel-check .form-check-label {
    margin: 0;
    color: var(--yb-text);
    font-size: 0.9rem;
    cursor: pointer;
}

/* The date and mode revealed by the tick. They are not two more fields of the form — they exist
   only while the tick is on, and they say nothing without it — so they are indented behind a
   rule rather than left to sit as peers of Counselor and Date Counseled. The left margin lands
   the rule under the checkbox, and the padding carries the fields to where its label starts. */
.yb-counsel-subfield {
    display: grid;
    gap: 0.85rem;   /* the dialog body's own rhythm, so the block reads as part of it */
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--yb-border-strong);
}

/* The session being amended, in the Record-intimation dialog: counsellor and date are frozen
   server-side, so they are shown as a read-only line and never as disabled inputs — a greyed
   control invites a click that can never succeed. Sunken surface for the same reason. */
.yb-counsel-frozen {
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-sunken);
    color: var(--yb-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.yb-counsel-frozen i {
    color: var(--yb-text-soft);
}

/* The mandatory amendment reason (10–2000 characters). The counter is an aid, not a label: muted,
   right-aligned under the box it counts, and tabular so the digits do not jitter while typing. */
.yb-counsel-reason .form-control {
    min-height: 4.5rem;
    resize: vertical;
}

.yb-counsel-reason__count {
    justify-self: end;   /* .yb-counsel-field is a grid */
    color: var(--yb-text-soft);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

/* The invalid state. The marker class is on the WRAPPER here, not the control — the wrapper has
   no border of its own, so without this the only thing that reddens is the message underneath.

   Qualified with .yb-dialog and the element, and NOT because it reads better: the dark theme
   already paints every dialog control through
   `[data-theme="dark"] .yb-dialog textarea.form-control`, which outranks a bare
   `.yb-counsel-reason.is-invalid .form-control` — so in dark mode the reason field announced
   itself invalid to a screen reader and to the character counter while keeping a perfectly
   normal border. Verified in the browser, both themes. */
.yb-dialog .yb-counsel-reason.is-invalid textarea.form-control,
.yb-dialog .yb-counsel-reason.is-invalid .form-control {
    border-color: var(--yb-required);
}

.yb-dialog .yb-counsel-reason.is-invalid textarea.form-control:focus,
.yb-dialog .yb-counsel-reason.is-invalid .form-control:focus {
    border-color: var(--yb-required);
    box-shadow: 0 0 0 0.2rem rgba(var(--yb-danger-rgb), 0.18);
}

.yb-counsel-reason.is-invalid .yb-counsel-reason__count {
    color: var(--yb-required);
}

/* ── The intimation status pill, in a history-grid cell ───────────────────────────────────────
   Three-valued, and the third value is the point. RECORDED is settled, so it is the quiet one: an
   outline, like the .cstate-* chips. PENDING is an outstanding action, so it is filled in warning
   amber — the same treatment .cstate-incounsel wears on the summary row, because it is the same
   fact in a second place. NONE means the record predates the feature: nobody was ever asked, and
   there is nothing to chase. It is muted and DASHED — this file's established mark for a
   data-quality condition rather than a severity (see .cstate-nobase) — so that at a glance it can
   never be read as a pending step somebody skipped.

   Nowrap and a shrink-proof icon: this sits in a Syncfusion cell, where a wrap doubles the row
   height and a stretched pill reads as a fill. */
.yb-intimation {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: transparent;
    color: var(--yb-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.yb-intimation > i {
    flex: none;
    font-size: 0.85rem;
}

.yb-intimation--recorded {
    border-color: rgba(var(--yb-success-rgb), 0.45);
    color: var(--yb-success);
}

.yb-intimation--pending {
    background: rgba(var(--yb-warning-rgb), 0.14);
    border-color: rgba(var(--yb-warning-rgb), 0.5);
    color: var(--yb-warning);
}

.yb-intimation--none {
    border-style: dashed;
    color: var(--yb-text-soft);
    font-weight: 600;
}

/* The two link buttons in the cell beside it. Kept on one row with real space between them —
   "Correct date" and "Retract" abutting is how a destructive action gets clicked by accident. */
.yb-intimation-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
}

.yb-intimation-actions .btn-link {
    font-size: 0.78rem;
    text-decoration: none;
}

/* A session's record in the History grid (TrilokAPI #355): the outcome as a quiet badge, then
   the follow-up day and whether notes exist. The same badge geometry as .yb-intimation beside it.
   An outcome that CLOSED the case is the one worth seeing across a column, so it alone carries
   an accent; the others are the counsellor's judgement and stay neutral — never a severity colour
   (an outcome is not a stress verdict). Text in text tokens; the accent only tints. */
.yb-counsel-record {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.yb-counsel-outcome {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    color: var(--yb-text);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.yb-counsel-outcome.is-closing {
    background: rgba(var(--yb-accent-rgb), 0.1);
    border-color: rgba(var(--yb-accent-rgb), 0.4);
}

.yb-counsel-outcome.is-empty {
    border-style: dashed;
    color: var(--yb-text-muted);
    font-weight: 600;
}

.yb-counsel-record__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--yb-text-muted);
    white-space: nowrap;
}

/* Said the moment a case-closing outcome is chosen: the student leaves the review queue. */
.yb-counsel-closenote {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.45rem 0 0;
    padding: 0.45rem 0.6rem;
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-accent-rgb), 0.08);
    color: var(--yb-text);
    font-size: 0.8rem;
    line-height: 1.45;
}

.yb-counsel-closenote i {
    flex: none;
    margin-top: 0.1rem;
    color: var(--yb-accent-text);
}

.yb-counsel-notes {
    resize: vertical;
    min-height: 6rem;
}

/* The same record on a counselling-journey session card. Notes keep their line breaks — they
   are the counsellor's own words — and a withheld note reads as a quiet statement, not text. */
.cj-record {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin-top: 0.55rem;
}

.cj-record-notes {
    flex: 1 1 100%;
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--yb-text);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.cj-record-notes.is-withheld {
    font-style: italic;
    color: var(--yb-text-muted);
}

.yb-intimation-actions .btn-link:hover {
    text-decoration: underline;
}

/* ── Person header on the analytics detail view ───────────────────────────────────────────────
   One identity line — who this is, which cohort — then the actions, then the way back. The
   previous header centred the name on its own row above a 1fr/auto/1fr grid whose first column
   was narrower than its own label, so "Student Alert Details" wrapped into three stacked words
   and "Details" sat alone looking like an empty section. */
.yb-person-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.yb-person-head__id {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.yb-person-head__role {
    font-size: 0.78rem;
    color: var(--yb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.yb-person-head__name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--yb-text);
}

/* A hairline rule rather than a pipe character: it reads as a divider at any weight and never
   competes with the name for attention. */
.yb-person-head__sep {
    align-self: center;
    width: 1px;
    height: 1.05rem;
    background: var(--yb-border-strong);
}

.yb-person-head__cohort {
    font-weight: 600;
    color: var(--yb-accent-text);
}

.yb-person-head__actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

.yb-person-head__back { margin-left: 0.25rem; }

@media (max-width: 720px) {
    .yb-person-head__actions { margin-left: 0; }
}

/* ── Sensing lane (#204) ──────────────────────────────────────────────────────────────────────
   On this page, absence of signal renders identically to absence of stress: a child whose
   wearable was flat for three days shows a calm, unremarkable chart. The lane sits ABOVE the
   events so a flat stretch that is really a gap reads as a gap before anything else is read.

   Three states carry three different visual grammars — never colour alone:
     sensed   solid fill              we were measuring
     partial  solid fill, half height we were measuring some of the day
     gap      diagonal hatch          we were NOT, and the reason is listed below
     quiet    dotted outline, hollow  nothing was running at all (not a school day, an outage)

   The hatch and the dotted outline survive greyscale and both themes, which a red/green pair
   does not. Same reasoning as the staff-day blind-spot marks. */
.yb-sense {
    margin-bottom: 0.9rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    /* The detail page centres its header block; these are full sentences about what we could
       and could not measure, and centred prose is measurably harder to read. */
    text-align: left;
}

/* Header, lane and legend are ALWAYS visible: a legend the reader has to open a panel to
   reach cannot help them read the strip beside it. Only the reading-in-depth half folds. */
.yb-sense__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

/* The one finding the reader would never meet anywhere else, so it survives the fold. */
.yb-sense__flag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.45rem;
    border: 1px solid rgba(var(--yb-danger-rgb, 220, 53, 69), 0.4);
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-danger-rgb, 220, 53, 69), 0.09);
    color: var(--yb-danger-text);
    font-size: 0.74rem;
    font-weight: 600;
}

/* The way in to the reading-in-depth half. It sits on the TITLE's line, pushed right — it
   belongs to the heading, not below the chart it explains. */
.yb-sense__why {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    padding: 0.15rem 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--yb-radius-sm);
    background: transparent;
    color: var(--yb-text-muted);
    font-size: 0.78rem;
    cursor: pointer;
}

.yb-sense__why:hover {
    border-color: var(--yb-border);
    background: var(--yb-surface-2);
    color: var(--yb-text);
}

.yb-sense__why:focus-visible {
    outline: 2px solid var(--yb-ring, var(--yb-accent));
    outline-offset: 2px;
}

.yb-sense__why i {
    transition: transform var(--yb-dur, 0.15s) var(--yb-ease, ease);
}

.yb-sense__why.is-open i { transform: rotate(180deg); }

.yb-sense__why-panel {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--yb-border);
}

@media (prefers-reduced-motion: reduce) {
    .yb-sense__why i { transition: none; }
}

.yb-sense__head > i { color: var(--yb-accent-text); }
.yb-sense--calm .yb-sense__head > i { color: var(--yb-success); }
.yb-sense--unknown .yb-sense__head > i { color: var(--yb-text-muted); }

.yb-sense__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--yb-text);
}

.yb-sense__summary {
    font-size: 0.82rem;
    color: var(--yb-text-muted);
}

/* Two stacked channels sharing one x-axis: the measurement row over the calendar rail. Both
   are the same flex geometry so day N sits above day N's mark, exactly. */
.yb-sense__chart {
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-sunken);
    padding: 2px;
}

/* The measurement row: one cell per calendar day, chronological, so it reads as the period the
   chart below was drawn over. */
.yb-sense__lane {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 22px;
    overflow: hidden;
}

/* The calendar rail: what KIND of day it was. Marks appear only where something is true, so
   an ordinary school day carries no ink at all and the exceptions are what the eye finds. */
.yb-sense__rail {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 10px;
    margin-top: 2px;
}

.yb-sense__slot {
    flex: 1 1 0;
    min-width: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shapes, not colours: a filled dot and a triangle stay distinguishable in greyscale and to a
   reader who cannot separate the two hues. */
.yb-sense__mark {
    display: inline-block;
    width: 6px;
    height: 6px;
}

.yb-sense__mark--sunday {
    border-radius: 50%;
    background: var(--yb-text-muted);
}

.yb-sense__mark--exam {
    width: 0;
    height: 0;
    background: none;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 7px solid var(--yb-accent);
}

/* EVERY cell carries the same border box, transparent unless it means something.
   With flex-basis 0 a border sits OUTSIDE the space flex distributes, so a cell that borders
   and one that does not end up different widths (11.25 vs 9.64 measured) — and the calendar
   rail beneath, whose slots are all identical, drifts progressively out of step with them. */
.yb-sense__cell {
    flex: 1 1 0;
    min-width: 3px;
    border-radius: 1px;
    border: 1px dotted transparent;
}

.yb-sense__cell--sensed { background: var(--yb-success); }

/* Partly sensed sits low in the cell, so "some of the day" is legible as a quantity. */
.yb-sense__cell--partial {
    background: linear-gradient(to top,
        var(--yb-success) 0 55%, rgba(var(--yb-success-rgb, 45, 200, 130), 0.18) 55% 100%);
}

.yb-sense__cell--gap {
    background: repeating-linear-gradient(45deg,
        rgba(var(--yb-danger-rgb, 220, 53, 69), 0.85) 0 3px,
        rgba(var(--yb-danger-rgb, 220, 53, 69), 0.25) 3px 6px);
}

.yb-sense__cell--quiet {
    background: transparent;
    border-color: var(--yb-border-strong);
    opacity: 0.7;
}

/* Two questions, two legend groups — the measurement and the calendar are not the same axis
   and a single run of six swatches would imply they were. */
.yb-sense__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin-top: 0.5rem;
    font-size: 0.76rem;
    color: var(--yb-text-muted);
}

.yb-sense__group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.yb-sense__group + .yb-sense__group {
    padding-left: 1.1rem;
    border-left: 1px solid var(--yb-border);
}

.yb-sense__group-label {
    font-weight: 600;
    color: var(--yb-text);
    letter-spacing: 0.02em;
}

.yb-sense__key {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.yb-sense__swatch {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.yb-sense__swatch--sensed { background: var(--yb-success); }
.yb-sense__swatch--partial {
    background: linear-gradient(to top,
        var(--yb-success) 0 55%, rgba(var(--yb-success-rgb, 45, 200, 130), 0.18) 55% 100%);
}
.yb-sense__swatch--gap {
    background: repeating-linear-gradient(45deg,
        rgba(var(--yb-danger-rgb, 220, 53, 69), 0.85) 0 3px,
        rgba(var(--yb-danger-rgb, 220, 53, 69), 0.25) 3px 6px);
}
.yb-sense__swatch--quiet {
    background: transparent;
    border: 1px dotted var(--yb-border-strong);
    box-sizing: border-box;
}

/* The honesty sentence. Dashed border is the house signal for "this is a statement about our
   instruments, not about the child". */
.yb-sense__note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0.6rem 0 0;
    padding: 0.45rem 0.6rem;
    border: 1px dashed var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-info-rgb, 13, 110, 253), 0.06);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--yb-text);
}

.yb-sense__note > i { color: var(--yb-info-text); margin-top: 0.1rem; }

.yb-sense__note--calm {
    background: rgba(var(--yb-success-rgb, 45, 200, 130), 0.07);
    border-style: solid;
}

.yb-sense__note--calm > i { color: var(--yb-success); }

.yb-sense__gaps {
    margin: 0.55rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
}

.yb-sense__gap {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.35rem 0.5rem;
    border-left: 3px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    font-size: 0.8rem;
}

/* The contradiction worth shouting about: a temp wearable was issued to close a gap and
   produced nothing. Every other screen calls that loan healthy. */
.yb-sense__gap--unsensed {
    border-left-color: var(--yb-danger);
    background: rgba(var(--yb-danger-rgb, 220, 53, 69), 0.07);
}

.yb-sense__gap--unsensed > i { color: var(--yb-danger-text); }
.yb-sense__gap--loan > i { color: var(--yb-warning); }
.yb-sense__gap--primary > i,
.yb-sense__gap--none > i { color: var(--yb-text-muted); }

.yb-sense__gap-when {
    font-weight: 600;
    color: var(--yb-text);
    white-space: nowrap;
}

.yb-sense__gap-detail { color: var(--yb-text-muted); }

.yb-sense__overflow {
    margin: 0.4rem 0 0;
    font-size: 0.76rem;
    color: var(--yb-text-muted);
}

.yb-sense__limits {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: var(--yb-text-muted);
}

.yb-sense__limits > summary {
    cursor: pointer;
    color: var(--yb-text-muted);
}

.yb-sense__limits ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.25rem;
    line-height: 1.45;
}

[data-theme="dark"] .yb-sense__note {
    background: rgba(var(--yb-info-rgb, 108, 168, 255), 0.1);
}

[data-theme="dark"] .yb-sense__note--calm {
    background: rgba(var(--yb-success-rgb, 45, 200, 130), 0.12);
}

[data-theme="dark"] .yb-sense__gap--unsensed {
    background: rgba(var(--yb-danger-rgb, 255, 120, 130), 0.12);
}

@media (max-width: 640px) {
    .yb-sense__gap { grid-template-columns: auto minmax(0, 1fr); }
    .yb-sense__gap-detail { grid-column: 1 / -1; }
}

/* Neighbours dialogs (#160) — both were hand-rolled Bootstrap .modal blocks before being moved onto
   the yb-dialog primitives. Cap the body so a long neighbour list scrolls inside the dialog rather
   than growing it past the viewport; yb-dialog-scroll supplies the slim tokenized scrollbar. */
.neighbours-dialog__body {
    max-height: min(60vh, 30rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Rollup opened from a summary card (#162): the person's detail is still on the wire, so the dialog
   states that rather than showing an empty box. Same footprint as a short rollup, so the dialog
   doesn't visibly jump in size when the data lands.
   .nbr-loading / .nbr-error removed — the neighbours dialog uses YbStateBlock, which reserves that
   footprint itself via --yb-state-min-h. (#233) */

/* Per-event Neighbours list (the grid's "…" dialog), #160.
   Deliberately the SAME grammar as the "Who's been around" rollup (.nb-* in NeighboursTimeline):
   coloured group rail, group icon spaced off a bold name, muted class/section, explicit chips. The
   old markup was a wrap of pill badges reading "<icon>Eswar P · 100%  P" — the icon collided with
   the name, and the trailing "P" silently meant "primary". Both are now spelled out. */
.nbx {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nbx-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nbx-group-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--yb-text-soft);
}

.nbx-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.nbx-swatch--same { background: var(--yb-success); }
.nbx-swatch--other { background: var(--yb-accent); }
.nbx-swatch--staff { background: var(--yb-warning); }

.nbx-group-count {
    min-width: 1.25rem;
    padding: 0 0.35rem;
    border-radius: var(--yb-radius-pill);
    background: var(--yb-surface-2);
    border: 1px solid var(--yb-border);
    color: var(--yb-text-muted);
    text-align: center;
    line-height: 1.25rem;
}

.nbx-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nbx-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    background: var(--yb-card);
    border: 1px solid var(--yb-border);
    border-left-width: 3px;
    border-radius: var(--yb-radius-sm);
}

.nbx-row--same { border-left-color: var(--yb-success); }
.nbx-row--other { border-left-color: var(--yb-accent); }
.nbx-row--staff { border-left-color: var(--yb-warning); }

/* Colour only the leading icon; the name stays in the primary text colour so it remains the
   focal point of the row (matching .nb-pill in the rollup). */
.nbx-icon {
    font-size: 1.05rem;
    line-height: 1;
    flex: none;
}

.nbx-row--same .nbx-icon { color: var(--yb-success); }
.nbx-row--other .nbx-icon { color: var(--yb-accent-text); }
.nbx-row--staff .nbx-icon { color: var(--yb-warning); }

.nbx-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--yb-text);
}

.nbx-detail {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--yb-text-soft);
}

.nbx-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 4px 8px;
    border-radius: var(--yb-radius-sm);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
}

.nbx-flag--primary {
    color: var(--yb-accent-text);
    background: rgba(var(--yb-accent-rgb), 0.12);
}

/* Co-presence sits at the far right of the row, so the eye can compare it down the column. */
.nbx-copresence {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--yb-text-soft);
    white-space: nowrap;
}

.nbx-pct strong { color: var(--yb-text); }

.nbx-bar {
    width: 68px;
    height: 6px;
    border-radius: var(--yb-radius-pill);
    background: var(--yb-surface-2);
    border: 1px solid var(--yb-border);
    overflow: hidden;
    flex: none;
}

.nbx-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--yb-accent);
}

@media (max-width: 520px) {
    .nbx-copresence { margin-left: 0; }
}

/* Slim, tokenized scrollbar for scroll regions inside unified dialogs (#142).
   Reusable: add `yb-dialog-scroll` to any capped-height body that overflows. A
   6px pill thumb on a transparent track reads as part of the surface rather than
   the OS's chunky default. */
.yb-dialog-scroll {
    scrollbar-width: thin;                                   /* Firefox */
    scrollbar-color: var(--yb-border-strong) transparent;
}

.yb-dialog-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.yb-dialog-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.yb-dialog-scroll::-webkit-scrollbar-thumb {
    background: var(--yb-border-strong);
    border-radius: var(--yb-radius-pill);
}

.yb-dialog-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--yb-text-soft);
}

/* ===================================================================
   Record audit-metadata block (#144)
   Compact, read-only provenance (created/updated by + at) rendered by YbAuditInfo on
   master add/edit pages (inline) and inside the result-grid audit dialog. Gated to
   privileged roles at the call site; this is styling only.
   =================================================================== */
.yb-audit-info {
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.yb-audit-info__row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.85rem;
    align-items: baseline;
}

.yb-audit-info__row dt {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--yb-text-muted);
}

.yb-audit-info__row dt i {
    color: var(--yb-accent-text);
    font-size: 0.9rem;
}

.yb-audit-info__row dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.4rem;
    align-items: baseline;
    font-size: 0.86rem;
    color: var(--yb-text);
}

.yb-audit-info__who {
    color: var(--yb-text-muted);
    font-size: 0.8rem;
}

/* Inline usage on add/edit pages: a subtle framed panel that sets the read-only
   provenance apart from the editable form fields above it. */
.yb-form-page .yb-audit-info {
    margin-top: 0.4rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    background: var(--yb-surface-2);
}

.yb-audit-dialog-body {
    padding-top: 0.35rem;
}

/* Syncfusion SfDataForm checkbox labels sit to the right of the box (`.e-label-right`)
   and the dark theme leaves them the light-theme black — unreadable on the dark surface,
   unlike the top-positioned field labels. Give them the same readable label colour so
   e.g. "Access to Other Branches" is legible in dark mode (#139 QA). */
[data-theme="dark"] .e-form-item.e-label-right .e-form-label {
    color: rgb(163, 176, 199);
}

/* ── Mandatory-field marker (#147) ──────────────────────────────────────────
   Every required field's label is a YbFieldLabel, so the asterisk is a real <span> in the markup
   (aria-hidden, paired with visually-hidden "(required)" text) rather than CSS generated content —
   which a screen reader would not reliably announce. Inside an SfDataForm that means required
   fields are declared with a <Template> so the label is ours: a FormItem's own LabelText renders a
   <label class="e-form-label"> we cannot put a child into. Bootstrap's .form-label (ours) and
   Syncfusion's .e-form-label compute identically here, so converted fields sit flush with the
   optional ones left on LabelText. */
.yb-required-marker {
    color: var(--yb-required);
    margin-left: 0.15rem;
    font-weight: 700;
}

/* ── Inline field validation (#158) ─────────────────────────────────────────
   The other half of the required marker: the asterisk says a field is mandatory, this says it
   was left empty. Rendered by YbFieldError directly under the control it belongs to, so a
   missing value is reported where the user has to fix it rather than only in a footer alert.
   Deliberately not Bootstrap's .invalid-feedback / .is-invalid pair — that only surfaces via a
   sibling selector on native inputs, and these forms mix native controls with Syncfusion ones. */
.yb-field-error {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--yb-required);
}

.yb-field-error > i {
    font-size: 0.82rem;
    flex: none;
}

/* Applied to the control itself. .e-input-group covers Syncfusion editors, whose visible border
   lives on the wrapper rather than the <input>.

   ⚠ THE DARK-MODE SELECTORS ARE NOT REDUNDANT, and `!important` alone does not save this rule.
   site.css carries

       [data-theme="dark"] input,
       [data-theme="dark"] .e-input,
       [data-theme="dark"] .e-input-group { border-color: rgba(148,170,205,.55) !important; }

   which is ALSO `!important`, so specificity decides. `[data-theme="dark"] input` is (0,1,1) and
   plain `.yb-field-invalid` is (0,1,0) — so on a bare <input> the error border lost, in dark
   only, everywhere in the app. Measured before this fix: an invalid <input> read
   rgba(148,170,205,.55), the ordinary border, while the same markup in light read #d8443c.

   The Syncfusion cases never had the fault: `.yb-field-invalid.e-input-group` is (0,2,0) and beat
   `[data-theme="dark"] .e-input-group` (0,1,1) on class count. Nor did <textarea>, which
   `[data-theme="dark"] input` does not match at all. That is exactly why this survived — the
   fault is invisible unless the control is a plain <input> AND the theme is dark, and the QA
   gallery's own invalid field is the one place both were true. */
.yb-field-invalid,
.yb-field-invalid.e-input-group:not(.e-disabled),
.yb-field-invalid.e-input-group:not(.e-disabled):hover,
[data-theme="dark"] input.yb-field-invalid,
[data-theme="dark"] textarea.yb-field-invalid,
[data-theme="dark"] select.yb-field-invalid {
    border-color: var(--yb-required) !important;
}

.yb-field-invalid:focus,
.yb-field-invalid.e-input-group.e-input-focus,
[data-theme="dark"] input.yb-field-invalid:focus,
[data-theme="dark"] textarea.yb-field-invalid:focus,
[data-theme="dark"] select.yb-field-invalid:focus {
    border-color: var(--yb-required) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--yb-danger-rgb), 0.18) !important;
}

/* ── Staff picker (#181) ─────────────────────────────────────────────────────
   Stands in for the dropdown when there is nothing to pick from: no scope chosen yet, an empty
   roster, or a roster we couldn't read. Same height and border as the control it replaces, so the
   form doesn't jump when the branch is selected. */
.yb-staff-picker__stub {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.35rem;
    padding: 0.4rem 0.7rem;
    border: 1px dashed var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.yb-staff-picker__stub > i {
    flex: none;
    color: var(--yb-text-subtle, var(--yb-text-muted));
}

.yb-staff-picker__stub.is-error {
    border-style: solid;
    border-color: var(--yb-required);
    color: var(--yb-required);
}

.yb-staff-picker__stub.is-error > i {
    color: var(--yb-required);
}

/* ── YbErrorBoundary — the app-wide net under @Body ───────────────────────────────────────────
   The block itself is a plain .yb-state error card; all this adds is breathing room, because the
   boundary replaces a whole page body and would otherwise sit flush against the shell's top edge
   where every real page has its own header spacing. */
.yb-errb {
    padding-block: var(--yb-space-4, 1rem);
}

/* ── Operations boards (TrilokIoTEdge#187 W4.1) ───────────────────────────────────────────────
   Page wrapper only. Same 1080px centred column as the other single-column screens
   (.yb-svc, .yb-group-lookups, both in ui-refinement.css) — the boards are read surfaces, and a
   queue that runs the full width of an ultrawide monitor is unreadable at the left margin.

   The pieces below (W4.2) are shared by both boards on purpose — a wearable queue and an infra
   queue that drift apart visually would read as two products. Everything is built from the
   ui-refinement.css tokens; no ops-specific colour is invented here. */
.yb-ops {
    /* ⚠ Reset, not a preference. MainLayout wraps page content in a Bootstrap `col-12 text-center`,
       so EVERYTHING inside a page inherits centre alignment unless it says otherwise. Left
       unreset, the board's prose ragged itself around the centre — a two-line hint under an empty
       state put its second line in the middle of the card, and every tile label and table cell
       centred with it. Browser QA found this; bUnit cannot, because it renders the component
       without the layout that carries the rule. */
    text-align: left;

    /* No max-width. W4.1 borrowed the 1080px column from .yb-svc / .yb-group-lookups, which are
       narrow reading surfaces; these are work surfaces that sit beside every other search-and-
       results screen in the app, and a queue that stops two-thirds of the way across the monitor
       reads as broken next to them. Width comes from .full-width-content on the host page, exactly
       as it does for Safety Alerts and the rest. */
}

/* ── Overview: period selector and per-board sections ────────────────────────────────────────
   The period governs the ALERT tiles only. State tiles say "right now" in their own foot, so the
   control cannot be read as applying to them. */
.yb-ops-period {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 1rem 0 0.25rem;
}

.yb-ops-period__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--yb-text-muted);
    margin-right: 0.3rem;
}

.yb-ops-period__btn {
    background: var(--yb-surface-2);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    padding: 0.25rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--yb-text-muted);
    cursor: pointer;
    transition: color var(--yb-dur) var(--yb-ease), border-color var(--yb-dur) var(--yb-ease),
        background var(--yb-dur) var(--yb-ease);
}

.yb-ops-period__btn:hover:not(:disabled) {
    color: var(--yb-text);
    border-color: var(--yb-border-strong);
}

.yb-ops-period__btn.is-active {
    background: rgba(var(--yb-accent-rgb), 0.12);
    border-color: var(--yb-brand-600);
    color: var(--yb-brand-600);
}

.yb-ops-period__btn:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

.yb-ops-section {
    margin-top: 1.4rem;
}

.yb-ops-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--yb-border);
}

.yb-ops-section__title {
    margin: 0;
    font-family: var(--yb-font-display);
    font-size: 1.15rem;
    color: var(--yb-text);
}

.yb-ops-section__link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--yb-brand-600);
    text-decoration: none;
    white-space: nowrap;
}

.yb-ops-section__link:hover {
    text-decoration: underline;
}

/* A tile that navigates. It has to look pressable and behave like the link it is — hence an
   anchor, a hover lift, and a focus ring. */
.yb-ops-tile--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color var(--yb-dur) var(--yb-ease), box-shadow var(--yb-dur) var(--yb-ease),
        transform var(--yb-dur) var(--yb-ease);
}

.yb-ops-tile--link:hover {
    border-color: var(--yb-brand-600);
    box-shadow: var(--yb-shadow-sm);
    transform: translateY(-1px);
    color: inherit;
}

.yb-ops-tile--link:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

/* A count that is not zero on a tile that matters. The spine, not a red number: the figure stays
   readable and the card carries the alarm. */
.yb-ops-tile.is-emphasis {
    border-left: 3px solid var(--yb-danger);
}

/* ── Summary strip ────────────────────────────────────────────────────────────────────────────
   auto-fit rather than a fixed four columns: the strip must not shed a tile on a narrow window,
   and a board may grow a fifth number. */
.yb-ops-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
    margin-block: 1rem;
}

.yb-ops-tile {
    background: var(--yb-card);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    box-shadow: var(--yb-shadow-xs);
    padding: 0.9rem 1rem;
}

.yb-ops-tile__label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--yb-text-muted);
}

.yb-ops-tile__value {
    margin: 0.15rem 0 0;
    font-family: var(--yb-font-display);
    font-size: 1.9rem;
    line-height: 1.15;
    color: var(--yb-text);
}

.yb-ops-tile__breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.yb-ops-tile__foot {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--yb-text-muted);
}

/* ── Severity chip ────────────────────────────────────────────────────────────────────────────
   A rounded rect, not a pill — the house rule (#37). Colour carries the level, and the word is
   always present beside it: severity is the one thing on this board nobody should have to read
   from a hue, least of all at 2am on a laptop in a corridor. */
.yb-ops-sev {
    display: inline-block;
    padding: 0.14rem 0.45rem;
    border-radius: var(--yb-radius-sm);
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.yb-ops-sev.is-zero {
    opacity: 0.55;
}

.yb-ops-sev--critical {
    background: rgba(var(--yb-danger-rgb), 0.13);
    border-color: rgba(var(--yb-danger-rgb), 0.32);
    color: var(--yb-danger-text);
}

.yb-ops-sev--major {
    background: rgba(var(--yb-warning-rgb), 0.15);
    border-color: rgba(var(--yb-warning-rgb), 0.35);
    color: var(--yb-warning);
}

.yb-ops-sev--warning {
    background: rgba(var(--yb-info-rgb), 0.13);
    border-color: rgba(var(--yb-info-rgb), 0.3);
    color: var(--yb-info-text);
}

.yb-ops-sev--info,
.yb-ops-sev--unknown {
    background: var(--yb-surface-2);
    border-color: var(--yb-border-strong);
    color: var(--yb-text-muted);
}

/* ── Tabs ─────────────────────────────────────────────────────────────────────────────────────
   Same shape as the email-delivery tabs so the app has one tab, not three. */
.yb-ops-tabs {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid var(--yb-border);
    margin-top: 1.1rem;
}

.yb-ops-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--yb-text-muted);
    cursor: pointer;
    transition: color var(--yb-dur) var(--yb-ease), border-color var(--yb-dur) var(--yb-ease);
}

.yb-ops-tab:hover {
    color: var(--yb-text);
}

.yb-ops-tab.is-active {
    color: var(--yb-brand-600);
    border-bottom-color: var(--yb-brand-600);
}

.yb-ops-tab:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
    border-radius: var(--yb-radius-sm) var(--yb-radius-sm) 0 0;
}

.yb-ops-panel {
    padding-top: 0.9rem;
}

.yb-ops-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
    min-height: 2rem;
}

.yb-ops-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--yb-text-muted);
    cursor: pointer;
    margin: 0;
}

/* The facts that used to be the strip's first tile, now carried beside the queue they describe:
   how many are open, how bad they are, and how many nobody has taken. Left of the toolbar so the
   eye meets "how many" before "what can I do about it". */
.yb-ops-toolbar__facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.yb-ops-toolbar__count {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--yb-text-muted);
}

.yb-ops-toolbar__count:not(:empty) {
    margin-right: 0.2rem;
}

.yb-ops-toolbar__unacked {
    font-size: 0.82rem;
    color: var(--yb-text-muted);
    margin-left: 0.2rem;
}

/* The search panel's one checkbox.
   Laid out as a flex row rather than with Bootstrap's `.form-check`, which reserves 1.5em of
   padding for a FLOATED input — inside the panel's own label/input grid that padding pushed the
   box off the column the inputs sit in, and left the box and its text on different baselines.
   The min-height matches the Syncfusion editors beside it so the row does not sit shallower than
   its neighbours. */
.yb-ops-search__check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
    min-height: 2.25rem;
}

.yb-ops-search__check .form-check-input {
    margin: 0;
    flex: 0 0 auto;
}

.yb-ops-search__check .form-check-label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--yb-text);
    cursor: pointer;
}

/* The explanation behind the grouped-alerts checkbox. "Rollup" is the pipeline's word and it did
   not survive contact with a reader; the label now says the thing, and this carries the rest. */
.yb-ops-search__hint {
    color: var(--yb-text-soft);
    cursor: help;
}

/* ── The board table ──────────────────────────────────────────────────────────────────────────
   Rows are tall enough to carry two lines (a device id and the person holding it) without the
   second line reading as a separate row. */
.yb-ops-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--yb-card);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    overflow: hidden;
    font-size: 0.9rem;
}

.yb-ops-table thead th {
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--yb-border);
}

.yb-ops-table tbody td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--yb-border);
    vertical-align: top;
    color: var(--yb-text);
}

.yb-ops-table tbody tr:last-child td {
    border-bottom: 0;
}

.yb-ops-table tbody tr:hover td {
    background: var(--yb-surface-2);
}

.yb-ops-table__pick,
.yb-ops-table__act {
    width: 1%;
    white-space: nowrap;
}

.yb-ops-row__title {
    display: block;
    font-weight: 600;
}

.yb-ops-row__children,
.yb-ops-row__person,
.yb-ops-row__acker {
    display: block;
    font-size: 0.8rem;
    color: var(--yb-text-muted);
}

.yb-ops-row__person--none {
    font-style: italic;
    color: var(--yb-text-soft);
}

.yb-ops-row__device {
    display: block;
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.84rem;
}

/* The board a merged row came from, and a way into it. Reads as a link because it is one — on a
   combined queue the next question after "what is this" is usually "show me the rest of them". */
.yb-ops-row__board {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--yb-brand-600);
    text-decoration: none;
    white-space: nowrap;
}

.yb-ops-row__board:hover {
    text-decoration: underline;
}

.yb-ops-row__site {
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.8rem;
    color: var(--yb-text-muted);
}

.yb-ops-state {
    font-weight: 600;
}

.yb-ops-batt {
    font-weight: 600;
}

.yb-ops-batt.is-low {
    color: var(--yb-danger-text);
}

/* An age note. `.is-approx` is the staleness allowance, not the age — a value that MAY be behind
   reality, which is a different and more important fact than how old it is. */
.yb-ops-age {
    display: block;
    font-size: 0.78rem;
    color: var(--yb-text-muted);
}

.yb-ops-age.is-approx {
    color: var(--yb-warning);
}

.yb-ops-cell__none {
    color: var(--yb-text-soft);
    font-style: italic;
}

.yb-ops-more {
    margin: 0.6rem 0 0;
    font-size: 0.82rem;
    color: var(--yb-text-muted);
}

/* ── Infrastructure board (W4.3) ──────────────────────────────────────────────────────────────
   The site board is cards rather than rows: a site is a thing with a state, not a record in a
   list, and the facts on it are read together ("locators 3 of 30, last upload 4 h ago") rather
   than scanned down a column. */
.yb-ops-sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.85rem;
}

.yb-ops-site {
    background: var(--yb-card);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    box-shadow: var(--yb-shadow-xs);
    padding: 0.9rem 1rem;
}

/* A degraded site takes a left spine rather than a tinted card: the facts inside it stay legible,
   and the spine is the same device .yb-state uses to carry a state in colour. */
.yb-ops-site.is-degraded {
    border-left: 3px solid var(--yb-warning);
}

.yb-ops-site__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.yb-ops-site__id {
    margin: 0;
    font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--yb-text);
    word-break: break-all;
}

.yb-ops-edge {
    display: inline-block;
    padding: 0.14rem 0.45rem;
    border-radius: var(--yb-radius-sm);
    border: 1px solid transparent;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.yb-ops-edge--reporting {
    background: rgba(var(--yb-success-rgb), 0.13);
    border-color: rgba(var(--yb-success-rgb), 0.32);
    color: var(--yb-success);
}

.yb-ops-edge--silent {
    background: rgba(var(--yb-danger-rgb), 0.13);
    border-color: rgba(var(--yb-danger-rgb), 0.32);
    color: var(--yb-danger-text);
}

.yb-ops-edge--unknown {
    background: var(--yb-surface-2);
    border-color: var(--yb-border-strong);
    color: var(--yb-text-muted);
}

/* The verdict naming its own basis. Muted, because it is a caveat on good news rather than an
   alarm — but present on every card, because "Reporting" means less than it looks like it does
   while device-twin staleness is unwired. */
.yb-ops-site__basis {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--yb-text-muted);
}

.yb-ops-site__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.55rem 0.8rem;
    margin: 0.75rem 0 0;
}

.yb-ops-site__facts dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--yb-text-muted);
}

.yb-ops-site__facts dd {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    color: var(--yb-text);
}

.yb-ops-site__facts dd.is-degraded {
    color: var(--yb-danger-text);
    font-weight: 600;
}

.yb-ops-site__crit {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--yb-danger-text);
}

/* ── Rollup expander ──────────────────────────────────────────────────────────────────────────
   The whole point of the rollup contract is visible here: the parent says how many alerts it is
   speaking for, and they stay folded until asked for. */
.yb-ops-expand {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.25rem;
    padding: 0.1rem 0.35rem 0.1rem 0.2rem;
    background: none;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--yb-text-muted);
    cursor: pointer;
    transition: color var(--yb-dur) var(--yb-ease), border-color var(--yb-dur) var(--yb-ease);
}

.yb-ops-expand:hover,
.yb-ops-expand.is-open {
    color: var(--yb-brand-600);
    border-color: var(--yb-brand-600);
}

.yb-ops-expand:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

/* A child row is visibly subordinate — indented by a sunken background and a spine, so an expanded
   group never reads as more top-level rows. */
.yb-ops-table tbody tr.yb-ops-child td {
    background: var(--yb-surface-sunken);
    box-shadow: inset 3px 0 0 var(--yb-border-strong);
    font-size: 0.86rem;
}

.yb-ops-child__title {
    display: block;
    color: var(--yb-text-muted);
}

.yb-ops-child__loading {
    font-size: 0.82rem;
    color: var(--yb-text-muted);
}

/* ── Triage ───────────────────────────────────────────────────────────────────────────────────
   A queue someone empties, not a counter — so the tab carries its depth. */
.yb-ops-tab__count {
    display: inline-block;
    min-width: 1.35rem;
    margin-left: 0.35rem;
    padding: 0 0.3rem;
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-warning-rgb), 0.16);
    color: var(--yb-warning);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.yb-ops-triage__intro {
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
    color: var(--yb-text-muted);
    max-width: 62ch;
}

/* The archive counts, stated as prose rather than as a number in a box — a tile would invite
   reading them as more incidents, which is exactly the confusion the wording exists to prevent. */
.yb-ops-triage__archive {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.7rem;
    border-left: 3px solid var(--yb-border-strong);
    background: var(--yb-surface-2);
    border-radius: var(--yb-radius-sm);
    font-size: 0.84rem;
    color: var(--yb-text-muted);
    max-width: 72ch;
}

.yb-ops-triage__reason {
    max-width: 34ch;
    color: var(--yb-text-muted);
}

/* Two sections on the Triage tab — parsed-but-unplaceable, and never-parsed (#264). Headed rather
   than run together: they are stuck for different reasons and fixed by different people, and an
   unlabelled second table reads as a continuation of the first. */
.yb-ops-triage__heading {
    margin: 1.6rem 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--yb-text);
}

.yb-ops-triage__heading:first-of-type {
    margin-top: 0;
}

/* The causes, largest first. Chips rather than tiles: they are a way IN to the queue, not a
   measurement of the estate — a tile would invite reading them as more alerts. */
.yb-ops-triage__causes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--yb-text-muted);
}

.yb-ops-cause {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
}

.yb-ops-cause__count {
    font-weight: 700;
    color: var(--yb-text);
}

/* ── The sweep's freshness (#265) ─────────────────────────────────────────────────────────────
   Says that the numbers on the board are not being maintained. Deliberately NOT a tile: a number
   reads as a measurement of the estate, and this is a statement about whether the estate is being
   measured at all. It renders only when something is wrong — see YbOpsSweepNotice for why silence
   on a healthy sweep is the whole point. */
.yb-ops-sweep {
    --yb-ops-sweep-spine: var(--yb-border-strong);

    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;

    /* ⚠ The TOP margin is the load-bearing one. This block is the first child of `.yb-ops`, which
       has no padding of its own, so without it the notice sits flush against the bottom edge of the
       search panel above — touching it, with nothing between the two. 1.1rem is not a new number:
       it is what `.yb-ops-tabs` already uses, so whatever comes first under the panel keeps the
       same gap whether it is this notice or the tabs. */
    margin: 1.1rem 0 1rem;

    /* YbStateBlock's padding, not a smaller set of its own. The left value clears the spine below;
       the right matches the search panel's horizontal rhythm, so the notice reads as part of the
       same stack rather than a tighter box wedged into it. Vertically compact because this is a
       banner above the content, not a full-height empty state. */
    padding: 1rem 1.35rem 1rem 1.6rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius);
    background: var(--yb-surface-2);
}

/* The spine, floating clear of the corners like YbStateBlock's rather than being a border on the
   box. A border-left squares off the rounded corners it meets; an inset bar keeps the radius. */
.yb-ops-sweep::before {
    content: "";
    position: absolute;
    inset: 0.5rem auto 0.5rem 0.4rem;
    width: 4px;
    border-radius: 2px;
    background: var(--yb-ops-sweep-spine);
}

/* Both stopped states share a spine colour: in never-run and overdue alike, nothing is running. */
.yb-ops-sweep--stopped {
    --yb-ops-sweep-spine: var(--yb-danger);
    background: rgba(var(--yb-danger-rgb), 0.07);
}

.yb-ops-sweep--failing {
    --yb-ops-sweep-spine: var(--yb-warning);
    background: rgba(var(--yb-warning-rgb), 0.09);
}

/* Inline with the title and baseline-aligned to it, so the prose beneath starts at the block's own
   content edge instead of being indented past it by a gutter. */
.yb-ops-sweep__head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.yb-ops-sweep__icon {
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
    color: var(--yb-ops-sweep-spine);
}

.yb-ops-sweep__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--yb-text);
}

.yb-ops-sweep__detail {
    margin: 0;
    font-size: 0.84rem;
    color: var(--yb-text-muted);
    max-width: 78ch;
}

.yb-ops-sweep__meta {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: var(--yb-text-soft);
}

/* The edge's opinion. Deliberately not styled like a severity or a domain chip on the boards: it
   is context for a triager, never a routing answer. */
.yb-ops-hint {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border: 1px dashed var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    font-size: 0.78rem;
    color: var(--yb-text-muted);
}

/* ── Viewer timezone notice (#99) ───────────────────────────────────────────
   The product is India-only and IST is implicit, so this is shown ONLY when the
   viewer's own clock is not UTC+05:30 — see ViewerTimeZone. It is a statement
   about what is on screen, not a warning and not a control, so it is muted:
   surface-2 fill, no accent colour, no border-left spine (that geometry belongs
   to .yb-state). A rounded-rect, not a pill, per the badge rule. Both colours
   are tokens, so dark mode follows the [data-theme="dark"] overrides in
   ui-refinement.css with no rules of its own. */
.yb-tz-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
    font-family: var(--yb-font-body);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: default;
}

.yb-tz-notice__icon {
    font-size: 0.8125rem;
    line-height: 1;
}

/* Below the lg breakpoint the top bar is already competing for width with the
   breadcrumb and the greeting, so the label drops and the icon carries it —
   the full sentence is still on the title/aria-label. */
@media (max-width: 991.98px) {
    .yb-tz-notice__text {
        display: none;
    }

    .yb-tz-notice {
        padding: 0.25rem 0.375rem;
    }
}

/* ---------------------------------------------------------------------------
   QA component gallery (/qa/gallery) - Development only.

   Layout ONLY. Deliberately no text-align or line-height reset on the cells: the
   components have to render under exactly the conditions MainLayout gives them
   ('col-12 text-center', and Syncfusion's .e-card fixed 36px leading), or the gallery
   becomes a nicer place than the app and stops showing the defects it exists to catch.
   Only the gallery’s own captions opt out, since they are chrome, not samples.
   --------------------------------------------------------------------------- */
.yb-qa {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0 3rem;
}

.yb-qa__section {
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    background: var(--yb-surface);
    padding: 1.25rem;
}

/* A caption, not a sample - left-aligned so the section it names is readable. */
.yb-qa__label {
    text-align: left;
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--yb-text);
}

.yb-qa__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
}

.yb-qa__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.yb-qa__cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}

/* The dialog fixture's host. SfDialog is given Target="#qa-dialog-host" so it renders INSIDE the
   gallery flow rather than floating over it — the point of the fixture is the .yb-dialog ancestor
   chain, and a modal overlay would make the section unreadable for a human browsing the gallery.
   position: relative is what Target needs to anchor against. */
.yb-qa__dialog-host {
    position: relative;
    min-height: 20rem;
    /* The gallery section centres its text; a form does not. */
    text-align: left;
}

.yb-qa__swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}

.yb-qa__swatch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-align: left;
}

/* Bootstrap gives <code> a pink that fails contrast on the panel surface. */
.yb-qa__swatch code {
    color: var(--yb-text);
}

.yb-qa__chip {
    width: 2rem;
    height: 1.25rem;
    flex: 0 0 auto;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
}

/* ---------------------------------------------------------------------------
   Primary buttons, on the brand ramp.

   Set Bootstrap 5.3’s OWN custom properties rather than background-color. Bootstrap resolves
   every state through `.btn { background: var(--bs-btn-bg) }` and `.btn:hover` / `.btn:disabled`,
   which are more specific than `.btn-primary` — so a plain `background-color` override styles
   the REST state and nothing else, and every other state silently falls back to stock #0d6efd.
   That is what put two different blues in one row and made the DISABLED button more saturated
   than the live one next to it.
   --------------------------------------------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--yb-brand-600);
    --bs-btn-border-color: var(--yb-brand-600);
    --bs-btn-hover-bg: var(--yb-brand-700);
    --bs-btn-hover-border-color: var(--yb-brand-700);
    --bs-btn-active-bg: var(--yb-brand-900);
    --bs-btn-active-border-color: var(--yb-brand-900);
    --bs-btn-focus-shadow-rgb: 20, 83, 196;
}

.btn-outline-primary {
    --bs-btn-color: var(--yb-brand-600);
    --bs-btn-border-color: var(--yb-brand-600);
    --bs-btn-hover-bg: var(--yb-brand-600);
    --bs-btn-hover-border-color: var(--yb-brand-600);
    --bs-btn-active-bg: var(--yb-brand-700);
    --bs-btn-active-border-color: var(--yb-brand-700);
    --bs-btn-focus-shadow-rgb: 20, 83, 196;
}

/* On a dark ground a hover should LIGHTEN, not darken — brand-700 on near-black reads as the
   button switching off. The outline variant also needs the lighter step to stay legible. */
[data-theme="dark"] .btn-primary {
    --bs-btn-hover-bg: var(--yb-brand-500);
    --bs-btn-hover-border-color: var(--yb-brand-500);
    --bs-btn-active-bg: var(--yb-brand-400);
    --bs-btn-active-border-color: var(--yb-brand-400);
}

/* The dark REST colour is deliberately not set here: site.css already lifts it to #6ea8fe,
   with the contrast measured (7.57:1 against the dark top bar, vs 4.02:1 for stock #0d6efd).
   Two sources of truth for one colour is how they drift apart. Only the filled states below
   belong to the ramp. */
[data-theme="dark"] .btn-outline-primary {
    --bs-btn-hover-bg: var(--yb-brand-500);
    --bs-btn-hover-border-color: var(--yb-brand-500);
    --bs-btn-active-bg: var(--yb-brand-400);
    --bs-btn-active-border-color: var(--yb-brand-400);
}

/* site.css sets a PLAIN color property for the dark rest state, which outranks Bootstrap's own
   .btn:hover rule on source order — so without this the text stays blue on the blue fill once
   hovered. Blue on blue: measured 1.6:1 before this rule. */
[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-primary:active,
[data-theme="dark"] .btn-outline-primary:focus-visible {
    color: #fff;
}

/* Disabled must read as UNAVAILABLE, not as a tinted call to action. Scoped to the filled
   variant on purpose: the outline variants keep Bootstrap’s transparent disabled background, so
   they do not gain a filled block they never had. */
.btn-primary:disabled,
.btn-primary.disabled {
    --bs-btn-disabled-bg: var(--yb-surface-sunken);
    --bs-btn-disabled-color: var(--yb-text-muted);
    --bs-btn-disabled-border-color: var(--yb-border-strong);
    --bs-btn-disabled-opacity: 1;
}

/* ...but a button that is busy is not a button that is unavailable. YbLoadingButton disables
   itself while working, which without this would make "Assigning…" and "Disabled" identical.
   Keep the brand colour, soften it, and let the spinner carry the rest. */
.btn.yb-btn-loading:disabled,
.btn.yb-btn-loading.disabled {
    --bs-btn-disabled-bg: var(--yb-brand-600);
    --bs-btn-disabled-border-color: var(--yb-brand-600);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-opacity: 0.75;
    cursor: progress;
}

/* Replaces the stock template ring (a hard white inner ring, which reads as a hole punched in a
   dark surface). focus-visible so a mouse click does not leave a ring behind. */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(var(--yb-accent-rgb), 0.35);
}

/* ── Counselling state chips on an analytics summary row (#321) ───────────────────────────────
   The row says which of the five states the API put this student in. Tinted by token so light and
   dark follow the rest of the shell, and shaped as a quiet outline chip rather than a solid badge:
   these sit beside the alert badges, which carry real counts and must stay the louder thing.

   NO-BASE (cstate-nobase) is deliberately styled as a DATA-QUALITY condition, not a severity: a
   dashed border and the aerial icon, so it cannot be misread as "mild". Its title carries the
   actionable sentence — baseline data has not been built for this student yet. */
.cstate-badge {
    align-items: center;
    background: transparent;
    border: 1px solid var(--yb-border-strong, #cbd5e1);
    border-radius: 999px;
    color: var(--yb-text-muted);
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.25rem 0.55rem;
}

.cstate-need {
    border-color: rgba(var(--yb-danger-rgb), 0.45);
    color: var(--yb-danger-text);
}

.cstate-watch {
    border-color: rgba(var(--yb-warning-rgb), 0.5);
    color: var(--yb-warning);
}

/* Intimated (#420): counselled, parent told — settled, so an outline in the success colour. */
.cstate-intimated {
    border-color: rgba(var(--yb-success-rgb), 0.45);
    color: var(--yb-success);
}

.cstate-nobase {
    border-color: rgba(var(--yb-warning-rgb), 0.5);
    border-style: dashed;
    color: var(--yb-warning);
}

.cstate-clear {
    border-style: dashed;
}

/* In Counselling (#420): counselled, parent NOT yet told. Filled where the other chips are
   outlined, because one step is still owed — an outstanding ACTION, not a classification. */
.cstate-incounsel {
    background: rgba(var(--yb-warning-rgb), 0.14);
    border-color: rgba(var(--yb-warning-rgb), 0.5);
    color: var(--yb-warning);
}

/* ── The parent-intimation sub-filter (#324) ──────────────────────────────────────────────────
   A narrowing WITHIN Already Counselled, never a sixth state: it is not on the triage switch, it
   is not one of the five counts, and it appears only while that segment is the one being read. So
   it must not borrow the switch's shapes — no track, no thumb, no segment height, none of which
   would say "one level down". It says it the way .yb-counsel-subfield does instead: indented
   behind a left rule on a quiet surface, in the smaller type the rest of the panel uses for
   secondary controls.

   The count is a counter, not a badge — neutral, so it cannot compete with the state chips beside
   it, which carry the real figures. A rounded rect on the small radius, not a pill. */
.counselor-subfilter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    padding: 0.3rem 0.7rem;
    border-left: 2px solid var(--yb-border-strong);
    border-radius: 0 var(--yb-radius-sm) var(--yb-radius-sm) 0;
    background: var(--yb-surface-2);
}

/* On, the rule picks up the warning colour the pending pills carry, so the grid below is never
   silently filtered by a control that looks idle. */
.counselor-subfilter:has(.form-check-input:checked) {
    border-left-color: var(--yb-warning);
    background: rgba(var(--yb-warning-rgb), 0.08);
}

.counselor-subfilter .form-check-input {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    border-color: var(--yb-border-strong);
    cursor: pointer;
}

.counselor-subfilter .form-check-input:checked {
    background-color: var(--yb-brand-600);
    border-color: var(--yb-brand-600);
}

.counselor-subfilter .form-check-input:focus {
    box-shadow: var(--yb-ring);
}

.counselor-subfilter .form-check-label {
    margin: 0;
    color: var(--yb-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

.counselor-subfilter .form-check-label > i {
    color: var(--yb-warning);
}

.counselor-subfilter-count {
    display: inline-block;
    min-width: 1.35rem;
    margin-left: 0.35rem;
    padding: 0 0.3rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-sunken);
    color: var(--yb-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

/* Narrow: the label wraps to a second line, so the box aligns to the first line rather than to
   the centre of a two-line block, and the row fills the width instead of sitting in a stub. */
@media (max-width: 479.98px) {
    .counselor-subfilter {
        display: flex;
        align-items: flex-start;
        padding: 0.4rem 0.6rem;
    }

    .counselor-subfilter .form-check-input {
        margin-top: 0.1rem;
    }

    .counselor-subfilter .form-check-label {
        font-size: 0.78rem;
    }
}

/* The four dense filter captions on the audit log and user tables (#audit-23). They carried
   `style="font-size: 0.7rem"` inline; YbFieldLabel takes classes, not styles, and an inline
   style is what #audit-25 exists to remove. */
.yb-label-xs {
    font-size: 0.7rem;
}

/* ══════════════════════════════════════════════════════════════════
   Rules reclaimed from component <style> blocks — #audit-26

   Each selector below was declared TWICE: once here and once inline in the component.
   An inline <style> renders in the body, after every <link> in the head, so the inline
   copy won every time and editing this file — the file the styling policy names — did
   nothing. Twenty-seven selectors across five components were in that state.

   They are moved here verbatim and kept at the END of the file on purpose: that is the
   only position that still beats the earlier copies of the same selectors above (this
   file has internal duplicates of its own), so what renders is unchanged. Verified by
   diffing the computed styles of every element on /login (light + dark), /login/mfa and the
   app shell (light + dark), before and after: zero elements changed.

   /password-update could not be swept - it needs an account carrying the pending-password
   gate, and the QA admin does not. Its seven rules rest on the same argument as the rest:
   no other linked stylesheet declares any of these selectors, so last-in-this-file is the
   same winner as last-in-the-document was.

   ⚠ Do not "tidy" these into the sections above without re-checking: several of them
   deliberately override a rule earlier in this file, and moving them up reverses that.
   ══════════════════════════════════════════════════════════════════ */

/* from Components/Pages/Login.razor */
.login-field-label {
    font-weight: 700;
    color: #0f172a;
}
.login-card-title {
    color: #0f172a;
}
.login-card-copy,
.login-supporting-copy {
    color: #334155;
}
.login-mfa {
    background: rgba(248, 250, 252, 0.86);
    border-color: rgba(148, 163, 184, 0.32);
}
html[data-theme="dark"] .login-card-title {
    color: #f8fafc;
}
html[data-theme="dark"] .login-card-copy,
html[data-theme="dark"] .login-supporting-copy,
html[data-theme="dark"] .login-processing-indicator {
    color: #e2e8f0;
}
html[data-theme="dark"] .login-processing-indicator {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}
html[data-theme="dark"] .login-processing-indicator__pulse {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.3);
}
.dark-mode .login-card-title {
    color: #f8fafc;
}
.dark-mode .login-card-copy,
.dark-mode .login-supporting-copy,
.dark-mode .login-processing-indicator {
    color: #e2e8f0;
}
.dark-mode .login-processing-indicator {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}
.dark-mode .login-processing-indicator__pulse {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.3);
}
/* from Components/Pages/PasswordUpdate.razor */
.password-update-card {
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 32px 60px rgba(15, 23, 42, 0.14);
    padding: clamp(1.25rem, 2.4vw, 1.6rem);
    backdrop-filter: blur(18px);
}
.password-update-header {
    margin-bottom: 1rem;
}
.password-update-shield {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 1.1rem;
}
.password-update-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f766e;
    margin-bottom: 0.5rem;
}
.password-update-title {
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.15;
    color: #0f172a;
    margin-bottom: 0.4rem;
}
.password-update-copy {
    color: #475569;
    margin-bottom: 0;
}
.password-update-form .form-control {
    min-height: 2.85rem;
    border-radius: 0.9rem;
    border-color: rgba(148, 163, 184, 0.45);
}

/* from Components/Layout/MainLayout.razor */
/* ───────────────────────── Top banner ───────────────────────── */
.top-row {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 247, 252, 0.88));
    -webkit-backdrop-filter: saturate(150%) blur(10px);
    backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid rgba(5, 38, 102, 0.10);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 20px -16px rgba(5, 38, 102, 0.55);
}
.dark-mode .top-row {
    background: linear-gradient(180deg, rgba(20, 22, 30, 0.92), rgba(15, 17, 24, 0.86)) !important;
    border-bottom-color: rgba(96, 165, 250, 0.16);
    box-shadow: 0 8px 22px -16px rgba(0, 0, 0, 0.85);
}
/* Animated underline on the user greeting link. */
.top-row-user-greeting {
    color: #334155;
}
.top-row-user-link {
    position: relative;
    color: #0a66d6;
    transition: color 0.2s ease;
}
/* ───────────────────────── Navbar refinements ───────────────────────── */
/* 1) Dark mode: drop the hard white right-edge divider (the logo header's
      white border-right and the sidebar's Bootstrap .border-end) which read
      as an odd bright line, and replace it with a soft, low-contrast edge so
      the navbar still separates gently from the page content. */
.dark-mode .logo-header {
    border-right-color: transparent !important;
}
.dark-mode .sidebar {
    border-right-color: transparent !important;
}
.dark-mode .sidebar-column {
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.05), 8px 0 22px -16px rgba(0, 0, 0, 0.85);
}
/* 2) Slim, themed scrollbar so an expanded menu no longer shows a clunky
      default scrollbar. The scroll behaviour is unchanged; it just blends in.
      scrollbar-gutter keeps the menu from shifting when the bar appears. */
.sidebar,
.nav-scrollable {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
    scrollbar-gutter: stable;
}

/* from Components/Layout/NavMenu.razor */
/* Brand-accent active indicator: a gradient wash plus a left accent bar
   drawn with an inset shadow (no border, so no layout shift). */
.nav-item a.active {
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.34), rgba(255, 255, 255, 0.08));
    box-shadow: inset 3px 0 0 0 #5aa9ff, 0 4px 14px -10px rgba(0, 122, 255, 0.85);
    color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════
   The admin & access controls — #audit-25, slice 2

   490 more lines out of four component <style> blocks: the access picker and the role-rights
   view on /admin/users, the step-up MFA dialog the shell raises, and the access notice ten
   pages show. Same reason as the reclaimed rules above — a <style> in the body outranks every
   linked sheet, so the file the policy names could not reach them.

   Checked before moving: the four share NO selector with each other and NONE with any
   stylesheet that loads after this file, so position cannot change what renders.

   ⚠ 85 distinct colour literals here and NOT ONE matches a --yb-* value — the same palette
   drift the auth surface has (#audit-25 slice 1). Tokenising is a decision, not a
   substitution; until it is made these keep their own colours and their own dark rules.
   ══════════════════════════════════════════════════════════════════ */

/* ── from AdminAccessPicker.razor ────────────────────────────────────────── */
.admin-access-picker {
        display: grid;
        gap: 0.75rem;
    }

    .admin-access-picker__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .admin-access-picker__count {
        border-radius: 999px;
        background: rgba(13, 110, 253, 0.1);
        color: #0d6efd;
        font-size: 0.78rem;
        font-weight: 700;
        padding: 0.25rem 0.6rem;
    }

    .admin-access-picker__grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
        gap: 0.65rem;
    }

    .admin-access-picker__group-label {
        color: #334155;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        margin-top: 0.25rem;
        text-transform: uppercase;
    }

    .admin-access-picker__option {
        display: flex;
        align-items: flex-start;
        gap: 0.65rem;
        min-height: 3rem;
        min-width: 0;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 0.75rem;
        background: rgba(255, 255, 255, 0.92);
        padding: 0.75rem;
        cursor: pointer;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    }

    .admin-access-picker__option:hover,
    .admin-access-picker__option:focus-within {
        border-color: rgba(13, 110, 253, 0.35);
        box-shadow: 0 10px 22px rgba(13, 110, 253, 0.1);
    }

    .admin-access-picker__option--selected {
        border-color: rgba(13, 110, 253, 0.55);
        background: rgba(13, 110, 253, 0.08);
        box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.18), 0 0 0 0.22rem rgba(13, 110, 253, 0.12);
    }

    .admin-access-picker__option--current-role {
        border-color: rgba(34, 197, 94, 0.6);
        box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.38), 0 0 0 0.26rem rgba(34, 197, 94, 0.2);
    }

    .admin-access-picker__option--role {
        align-items: flex-start;
    }

    .admin-access-picker__checkbox {
        width: 1.1rem;
        height: 1.1rem;
        margin-top: 0.15rem;
        flex: 0 0 auto;
        border-radius: 0.3rem;
        border: 1px solid rgba(100, 116, 139, 0.45);
        accent-color: #16a34a;
        cursor: pointer;
    }

    .admin-access-picker__option--role .admin-access-picker__checkbox {
        margin-top: 0.1rem;
    }

    .admin-access-picker__option--role .admin-access-picker__option-title {
        align-items: baseline;
    }

    .admin-access-picker__checkbox:focus-visible {
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(22, 163, 74, 0.2);
    }

    .admin-access-picker__option-copy {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
    }

    .admin-access-picker__option-title {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: wrap;
    }

    .admin-access-picker__option-label {
        color: #0f172a;
        font-weight: 700;
        word-break: break-word;
    }

    .admin-access-picker__status {
        border-radius: 999px;
        border: 1px solid transparent;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.03em;
        line-height: 1;
        padding: 0.24rem 0.45rem;
        text-transform: uppercase;
    }

    .admin-access-picker__status--success {
        background: rgba(25, 135, 84, 0.12);
        border-color: rgba(25, 135, 84, 0.22);
        color: #166534;
    }

    .admin-access-picker__status--warning {
        background: rgba(255, 193, 7, 0.2);
        border-color: rgba(255, 193, 7, 0.34);
        color: #8a6116;
    }

    .admin-access-picker__status--neutral {
        background: rgba(100, 116, 139, 0.14);
        border-color: rgba(100, 116, 139, 0.24);
        color: #475467;
    }

    .admin-access-picker__option-description,
    .admin-access-picker__option-entitlements {
        color: #64748b;
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .admin-access-picker__option-entitlements {
        border-left: 2px solid rgba(13, 110, 253, 0.25);
        margin-top: 0.15rem;
        padding-left: 0.55rem;
    }

    .dark-mode .admin-access-picker__count {
        background: rgba(96, 165, 250, 0.16);
        color: #bfdbfe;
    }

    .dark-mode .admin-access-picker__option {
        background: rgba(17, 24, 39, 0.92);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .dark-mode .admin-access-picker__option--selected {
        background: rgba(96, 165, 250, 0.16);
        border-color: rgba(96, 165, 250, 0.4);
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.34), 0 0 0 0.24rem rgba(96, 165, 250, 0.16);
    }

    .dark-mode .admin-access-picker__option--current-role {
        border-color: rgba(74, 222, 128, 0.6);
        box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35), 0 0 0 0.28rem rgba(74, 222, 128, 0.18);
    }

    .dark-mode .admin-access-picker__checkbox {
        border-color: rgba(148, 163, 184, 0.5);
        background-color: rgba(15, 23, 42, 0.9);
    }

    .dark-mode .admin-access-picker__option-label {
        color: #f8fafc;
    }

    .dark-mode .admin-access-picker__group-label {
        color: #cbd5e1;
    }

    .dark-mode .admin-access-picker__status--success {
        background: rgba(34, 197, 94, 0.2);
        border-color: rgba(34, 197, 94, 0.32);
        color: #bbf7d0;
    }

    .dark-mode .admin-access-picker__status--warning {
        background: rgba(250, 204, 21, 0.22);
        border-color: rgba(250, 204, 21, 0.34);
        color: #fde68a;
    }

    .dark-mode .admin-access-picker__status--neutral {
        background: rgba(148, 163, 184, 0.16);
        border-color: rgba(148, 163, 184, 0.28);
        color: #e2e8f0;
    }

    .dark-mode .admin-access-picker__option-description,
    .dark-mode .admin-access-picker__option-entitlements {
        color: #cbd5e1;
    }

    .dark-mode .admin-access-picker__option-entitlements {
        border-left-color: rgba(96, 165, 250, 0.35);
    }

    .admin-access-picker__option--disabled {
        opacity: 0.6;
        background: rgba(226, 232, 240, 0.5);
        border-color: rgba(15, 23, 42, 0.08);
        cursor: not-allowed;
    }

    .admin-access-picker__option--disabled:hover,
    .admin-access-picker__option--disabled:focus-within {
        border-color: rgba(15, 23, 42, 0.08);
        box-shadow: none;
    }

    .admin-access-picker__option-disabled-reason {
        color: #dc2626;
        font-size: 0.78rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

    .admin-access-picker__option-disabled-reason::before {
        content: "ℹ";
        font-size: 0.9rem;
    }

    .dark-mode .admin-access-picker__option--disabled {
        opacity: 0.5;
        background: rgba(30, 41, 59, 0.6);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .dark-mode .admin-access-picker__option-disabled-reason {
        color: #f87171;
    }

/* ── from RoleAccessRightsView.razor ────────────────────────────────────────── */
.role-access-rights {
        display: grid;
        gap: 0.6rem;
    }

    .role-access-rights__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .role-access-rights__count {
        border-radius: 999px;
        background: rgba(22, 163, 74, 0.12);
        color: #166534;
        font-size: 0.78rem;
        font-weight: 700;
        padding: 0.25rem 0.6rem;
    }

    .role-access-rights__hint {
        color: #64748b;
        font-size: 0.82rem;
        margin: 0;
    }

    .role-access-rights__grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
        gap: 0.6rem;
    }

    .role-access-rights__module {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        min-width: 0;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 0.65rem;
        background: rgba(248, 250, 252, 0.9);
        padding: 0.6rem 0.75rem;
    }

    .role-access-rights__module-name {
        color: #0f172a;
        font-weight: 700;
        word-break: break-word;
    }

    .role-access-rights__levels {
        display: flex;
        gap: 0.35rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .role-access-rights__level {
        border-radius: 999px;
        border: 1px solid rgba(100, 116, 139, 0.28);
        background: rgba(100, 116, 139, 0.12);
        color: #475467;
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.03em;
        line-height: 1;
        padding: 0.26rem 0.5rem;
        text-transform: uppercase;
    }

    .role-access-rights__level--read {
        background: rgba(13, 110, 253, 0.12);
        border-color: rgba(13, 110, 253, 0.24);
        color: #0d6efd;
    }

    .role-access-rights__level--create,
    .role-access-rights__level--update {
        background: rgba(25, 135, 84, 0.12);
        border-color: rgba(25, 135, 84, 0.24);
        color: #166534;
    }

    .role-access-rights__level--approve {
        background: rgba(255, 193, 7, 0.2);
        border-color: rgba(255, 193, 7, 0.34);
        color: #8a6116;
    }

    .role-access-rights__level--admin {
        background: rgba(220, 38, 38, 0.12);
        border-color: rgba(220, 38, 38, 0.26);
        color: #b91c1c;
    }

    .dark-mode .role-access-rights__count {
        background: rgba(34, 197, 94, 0.2);
        color: #bbf7d0;
    }

    .dark-mode .role-access-rights__hint {
        color: #cbd5e1;
    }

    .dark-mode .role-access-rights__module {
        background: rgba(17, 24, 39, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .dark-mode .role-access-rights__module-name {
        color: #f8fafc;
    }

    .dark-mode .role-access-rights__level {
        background: rgba(148, 163, 184, 0.16);
        border-color: rgba(148, 163, 184, 0.28);
        color: #e2e8f0;
    }

/* ── from StepUpMfaDialog.razor ────────────────────────────────────────── */
.stepup-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1080;
        background: rgba(15, 23, 42, 0.55);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    .stepup-dialog {
        width: 100%;
        max-width: 26rem;
        background: #ffffff;
        color: #0f172a;
        border-radius: 1rem;
        box-shadow: 0 20px 45px rgba(2, 6, 23, 0.35);
        padding: 1.75rem;
        text-align: center;
    }

    .stepup-shield {
        width: 3rem;
        height: 3rem;
        margin: 0 auto 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: rgba(37, 99, 235, 0.12);
        color: #2563eb;
        font-size: 1.35rem;
    }

    .stepup-title {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 0.35rem;
    }

    .stepup-copy {
        color: #475569;
        font-size: 0.925rem;
        margin-bottom: 1rem;
    }

    .stepup-dialog .form-label {
        display: block;
        text-align: left;
    }

    .stepup-input {
        text-align: center;
        letter-spacing: 0.35em;
        font-size: 1.1rem;
    }

    .stepup-error {
        background: rgba(220, 38, 38, 0.1);
        color: #b91c1c;
        border-radius: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .stepup-actions {
        display: flex;
        gap: 0.75rem;
        margin-top: 1.1rem;
    }

    .stepup-actions .btn {
        flex: 1;
    }

    html[data-theme="dark"] .stepup-dialog,
    .dark-mode .stepup-dialog {
        background: #1e293b;
        color: #e2e8f0;
    }

    html[data-theme="dark"] .stepup-copy,
    .dark-mode .stepup-copy {
        color: #94a3b8;
    }

/* ── from YbAccessNotice.razor ────────────────────────────────────────── */
.yb-access-notice {
        border: 1px solid rgba(255, 193, 7, 0.5);
        background: linear-gradient(180deg, rgba(255, 243, 205, 0.95), rgba(255, 243, 205, 0.85));
        color: #5c4700;
    }

    .yb-access-notice__icon {
        color: #9f6800;
    }

    .dark-mode .yb-access-notice,
    [data-theme="dark"] .yb-access-notice {
        border-color: rgba(255, 193, 7, 0.55);
        background: linear-gradient(180deg, rgba(102, 72, 16, 0.92), rgba(74, 52, 12, 0.88));
        color: #ffe8ad;
    }

    .dark-mode .yb-access-notice__icon,
    [data-theme="dark"] .yb-access-notice__icon {
        color: #ffd76d;
    }

/* ══════════════════════════════════════════════════════════════════
   The last five component <style> blocks — #audit-25, slice 5

   The neighbours timeline, the stress trend detail, the stress badge, and the setting
   inheritance panel. 460 lines, and with them every inline <style> outside the shell is gone.

   Checked before moving: the five share no selector with each other, and only ONE selector here
   already exists in a stylesheet - `.progress`, and that one needed a decision rather than a move.

   ⚠ The lesson this section was written around, kept because it applies to the next move as much
   as it did to this one: an inline <style> is scoped by the COMPONENT BEING ON THE PAGE, and a
   stylesheet has no such scoping. StressLevelBar declared a bare `.progress` — a Bootstrap class
   the whole app uses — which inline never applied at all, because that component was rendered
   nowhere. Moved verbatim it would have painted every progress bar in the app #e9ecef: a
   light-grey bar on a dark card. It was scoped to `.stress-level-bar-container .progress`
   instead, and the component has since been deleted as dead code, so the rule is gone with it.
   ══════════════════════════════════════════════════════════════════ */

/* ── from NeighboursTimeline.razor ────────────────────────────────────────── */
.nb-timeline {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        color: var(--yb-text);
    }

    .nb-head {
        display: flex;
        flex-direction: column;
        gap: .35rem;
    }

    .nb-sub {
        margin: 0;
        font-size: .85rem;
        color: var(--yb-text-soft);
    }

    .nb-metrics {
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
        margin-top: .4rem;
    }

    .nb-metric {
        flex: 1 1 90px;
        min-width: 84px;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: .6rem .5rem;
        background: var(--yb-surface);
        border: 1px solid var(--yb-border);
        border-radius: var(--yb-radius-sm);
    }

    .nb-metric-num {
        font-size: 1.5rem;
        font-weight: 700;
        line-height: 1;
    }

    .nb-metric-cap {
        margin-top: .25rem;
        font-size: .68rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--yb-text-soft);
        text-align: center;
    }

    .nb-num--recurring { color: var(--yb-success); }
    .nb-num--oneoff    { color: var(--yb-text-soft); }
    .nb-num--elevated  { color: var(--yb-danger-text); }

    .nb-legend {
        display: flex;
        flex-wrap: wrap;
        gap: .75rem;
        font-size: .76rem;
        color: var(--yb-text-soft);
    }

    .nb-legend-item {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
    }

    .nb-swatch {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        display: inline-block;
    }

    .nb-swatch--same  { background: var(--yb-success); }
    .nb-swatch--other { background: var(--yb-accent); }
    .nb-swatch--staff { background: var(--yb-warning); }

    .nb-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    .nb-row {
        display: flex;
        flex-direction: column;
        gap: .35rem;
        padding: .6rem .75rem;
        background: var(--yb-card);
        border: 1px solid var(--yb-border);
        border-left-width: 3px;
        border-radius: var(--yb-radius-sm);
    }

    .nb-row--same  { border-left-color: var(--yb-success); }
    .nb-row--other { border-left-color: var(--yb-accent); }
    .nb-row--staff { border-left-color: var(--yb-warning); }

    .nb-row-top {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: .4rem;
    }

    .nb-pill {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
    }

    /* Colour only the leading group icon; keep the name itself in the primary
       text colour so it stays the clear focal point of the row. */
    .nb-pill i { font-size: 1.05rem; line-height: 1; }
    .nb-pill--same  i { color: var(--yb-success); }
    .nb-pill--other i { color: var(--yb-accent-text); }
    .nb-pill--staff i { color: var(--yb-warning); }

    .nb-name {
        color: var(--yb-text);
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: -.01em;
    }

    .nb-classsec {
        font-size: .78rem;
        color: var(--yb-text-soft);
        font-weight: 500;
    }

    .nb-persist {
        font-size: .68rem;
        font-weight: 700;
        line-height: 1;
        text-transform: uppercase;
        letter-spacing: .04em;
        padding: 4px 8px;
        border-radius: var(--yb-radius-sm);
        border: 1px solid transparent;
    }

    .nb-persist--recurring {
        color: var(--yb-success);
        background: rgba(var(--yb-success-rgb), .12);
    }

    .nb-persist--occasional {
        color: var(--yb-text-soft);
        border-color: var(--yb-border);
    }

    .nb-persist--oneoff {
        color: var(--yb-text-soft);
        background: var(--yb-surface);
    }

    .nb-flag {
        font-size: .68rem;
        font-weight: 600;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        padding: 4px 8px;
        border-radius: var(--yb-radius-sm);
    }

    .nb-flag--primary {
        color: var(--yb-accent-text);
        background: rgba(var(--yb-accent-rgb), .12);
    }

    .nb-flag--elevated {
        color: var(--yb-danger-text);
        background: rgba(var(--yb-danger-rgb, 220, 53, 69), .12);
    }

    .nb-row-meta {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: .5rem;
        font-size: .78rem;
        color: var(--yb-text-soft);
    }

    .nb-presence strong { color: var(--yb-text); }
    .nb-sep { opacity: .6; }

    /* Continuous presence bar (one segment per event, left = earliest). Gaps are
       removed so segments read as a bar even at high event counts; high-stress
       segments keep a fixed visible width so the red reads on BOTH light and dark
       backgrounds (at 1px they washed out on the light surface). */
    .nb-strip {
        display: flex;
        align-items: stretch;
        gap: 0;
        margin-left: auto;
        width: 150px;
        height: 14px;
        padding: 2px;
        background: var(--yb-surface);
        border: 1px solid var(--yb-border);
        border-radius: var(--yb-radius-sm);
        overflow: hidden;
    }

    .nb-tick {
        flex: 1 1 0;
        min-width: 0;
        background: transparent;
    }

    .nb-tick.is-present { background: var(--yb-accent); }

    .nb-tick.is-elevated {
        flex: 0 0 3px;
        background: var(--yb-danger);
    }

    /* Tier-2 proximity line (safety-alert-derived) */
    .nb-prox {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .3rem .8rem;
        margin-top: .1rem;
        padding-top: .4rem;
        border-top: 1px dashed var(--yb-border);
        font-size: .78rem;
        color: var(--yb-text-soft);
    }

    .nb-prox-item {
        display: inline-flex;
        align-items: center;
        gap: .3rem;
    }

    .nb-prox-item strong { color: var(--yb-text); }
    .nb-prox-item i { color: var(--yb-accent-text); }
    .nb-prox-muted i { color: var(--yb-text-soft); }

    .nb-prox-dir {
        font-weight: 700;
        color: var(--yb-accent-text);
        background: rgba(var(--yb-accent-rgb), .12);
        border-radius: var(--yb-radius-sm);
        padding: 0 5px;
        margin-left: .1rem;
    }

    .nb-empty {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: 1.25rem;
        color: var(--yb-text-soft);
        background: var(--yb-surface);
        border: 1px dashed var(--yb-border);
        border-radius: var(--yb-radius-sm);
        justify-content: center;
    }

/* ── from SfStressDetailsContent.razor ────────────────────────────────────────── */
/* The band scale (D1–D4 + Base) down the LEFT edge. Each label is anchored at the
           axis minimum and pulled a full width left of the axis line into the reserved
           chart margin, so the chips line up as a fixed vertical scale beside the axis —
           right-aligned to a common edge, aligned in Y to each threshold's band. Rendered
           as opaque chips (card surface + a faint border tinted in the band's own colour)
           so each reads as belonging to its threshold. (#205; chip style from #59) */
        /* Fixed-width right-aligned rail. The width is centred on the anchor by
           Syncfusion; translateX(calc(-50% - 8px)) then lands the wrapper's right
           edge a constant 8px left of the axis for EVERY chip — so all chips share
           one right edge and the varying label lengths grow leftward, not raggedly. */
        .trend-band-label {
            width: 32px;
            text-align: right;
            white-space: nowrap;
            /* Right edge lands 24px left of the axis — clear to the LEFT of the
               vertical axis title, which is pinned right against the axis line. */
            transform: translateX(calc(-50% - 24px));
        }

        /* Rotated Y-axis title, matched to the native Syncfusion axis-title style
           (Segoe UI / 12px / 600) so it reads as a sibling of the X-axis "Timeline"
           label. Anchored at the axis mid-point, translated to the far-left gutter
           clear of the chips, and rotated -90deg so it reads bottom-to-top. */
        .trend-axis-title {
            display: inline-block;
            line-height: 1;
            white-space: nowrap;
            font-family: "Segoe UI", Roboto, system-ui, sans-serif;
            font-size: 12px;
            font-weight: 600;
            color: var(--yb-text, #242424);
            pointer-events: none;
            /* Pinned hard against the axis line — the title's right edge sits a few
               px left of the axis, with the compact band rail just to its left. */
            transform: translateX(-11px) rotate(-90deg);
        }

        .chartAnnotationBox {
            background: var(--yb-card);
            border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
            border-radius: var(--yb-radius-sm);
            padding: 1px 6px;
            font-size: 13px;
            display: inline-block;
            box-shadow: var(--yb-shadow-sm);
            pointer-events: none;
            font-weight: 700;
            white-space: nowrap;
        }

        /* Counseling-session marker — an accent node (journal-plus, matching the
           summary care nodes) hung from the top of the plot at the session time,
           with a short tether dropping into the chart. */
        .counseling-annotation {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #007aff;
            color: #fff;
            font-size: 0.7rem;
            box-shadow: 0 1px 3px rgba(16, 24, 40, 0.3);
            transform: translate(-50%, 0);
            cursor: help;
            pointer-events: auto;
        }

        .counseling-annotation::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            width: 2px;
            height: 12px;
            background: #007aff;
            opacity: 0.45;
            transform: translateX(-50%);
        }

        .x-axis-edge-labels {
            display: flex;
            justify-content: space-between;
            width: 100%;
            margin-top: 4px;
            font-size: 12px;
            line-height: 1.2;
            /* --yb-text adapts to dark mode; --bs-body-color did not, so this footer
               (timestamps + duration) was dark-on-dark and unreadable in dark mode. */
            color: var(--yb-text, #212529);
            padding: 0 8px;
            gap: 8px;
        }

        .x-axis-left,
        .x-axis-center,
        .x-axis-right {
            flex: 1 1 0;
            min-width: 0;
        }

        .x-axis-left {
            text-align: left;
        }

        .x-axis-center {
            text-align: center;
            font-weight: 600;
        }

        .x-axis-right {
            text-align: right;
        }

        .trend-chart-root {
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .trend-chart-main {
            flex: 1 1 auto;
            min-height: 0;
            width: 100%;
        }

/* ── from StressLevelBadge.razor ────────────────────────────────────────── */
.stress-level-badge-wrapper {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .stress-level-tooltip {
        position: fixed;
        pointer-events: none;
        z-index: 99999;
        min-width: max-content;
        max-width: 260px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 12px;
        line-height: 1.35;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
        white-space: normal;
        opacity: 0;
        visibility: hidden;
        transition: opacity 120ms ease, visibility 120ms ease;
    }

    .stress-level-tooltip::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 100%;
        transform: translateX(-50%);
        border-width: 6px;
        border-style: solid;
        border-color: var(--stress-tooltip-accent, #0d6efd) transparent transparent transparent;
    }

    .stress-level-badge-wrapper:hover .stress-level-tooltip,
    .stress-level-badge-wrapper:focus-within .stress-level-tooltip {
        opacity: 1;
        visibility: visible;
    }

/* ── from SettingInheritancePanel.razor ────────────────────────────────────────── */
/* Layout-only: visual styling lives in ui-refinement.css §10 */
    .inheritance-cascade {
        margin-top: 0.25rem;
    }

/* ══════════════════════════════════════════════════════════════════
   The shell — NavMenu and MainLayout — #audit-25, slice 6, and the last of it

   656 lines, and with them the app has NO inline <style> left anywhere.

   This slice is the safest of the six on the one axis that bit slice 5, and the most exposed on
   every other. Safest because the shell renders on every page, so its inline block was already
   global in practice — moving it removes no scoping. Most exposed because a mistake here shows on
   every screen at once, and because these two files carry 18 !important declarations (14 in the
   nav, 4 in the layout) that other rules have been written around.

   Checked before moving: 89 selectors; NavMenu and MainLayout share none with each other, and not
   one of the 89 is declared by ANY existing stylesheet — including the rules #audit-26 reclaimed
   from these same two files, which are different selectors (`.top-row` there, `.top-row::after`
   here). So position cannot change what renders, and the !important layer keeps working: an
   !important declaration outranks a normal one wherever either sits.
   ══════════════════════════════════════════════════════════════════ */

/* ── from NavMenu.razor ────────────────────────────────────────── */
/* #audit-26 — 1 rules that used to live here were ALSO declared in
       isolated-fallback.css, and this copy won on document order, so editing the file
       the styling policy names did nothing. They live there now, in the section at the
       end. Everything below is declared HERE only — do not re-add a global copy. */

    /* consistent icon column so submenu aligns with main labels */
    .nav-scrollable .nav-link {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 5px;
        color: var(--bs-white);
        border-radius: 6px;
        text-decoration: none;
    }

    /* reserved icon space so every row lines up */
    .icon-wrap {
        width: 34px; /* fixed column for icons */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        opacity: 0.95;
    }

    /* text label takes remaining space */
    .label {
        flex: 1 1 auto;
        font-size: 1rem;
    }

    /* caret container aligns right without changing the main layout */
    .caret-wrap {
        width: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* caret SVG rotates smoothly */
    .caret-svg {
        transition: transform .18s ease;
        color: rgba(255,255,255,0.65);
    }

        .caret-svg.open {
            transform: rotate(180deg);
        }

    .analytics-caret-wrap {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 999px;
        background: rgba(255,255,255,0.2);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        overflow: visible;
        position: relative;
        flex-shrink: 0; /* prevent the circle from being squeezed when siblings are present */
    }

    .analytics-caret {
        position: absolute;
        top: 50%;
        left: 50%;
        margin-right: 0;
        width: 1.1rem;
        height: 1.1rem;
        display: block;
        color: rgba(255,255,255,1);
        transform: translate(-50%, -50%);
        transform-origin: center;
        transition: transform .18s ease;
    }

        .analytics-caret.open {
            transform: translate(-50%, -50%) rotate(90deg);
        }

    .analytics-root {
        width: 100%;
        margin: 0;
    }

        .analytics-root .analytics-toggle {
            color: #d7d7d7;
            background: none;
            border: none;
            border-radius: 6px; /* match the regular nav-link radius so toggles aren't squarer */
            height: 3rem;
            display: flex;
            align-items: center;
            line-height: 3rem;
            width: 100%;
            white-space: nowrap;
            text-align: left;
        }

        /* When open, round the top and flatten the bottom so the toggle visually
           merges with the submenu beneath it into one cohesive rounded card. */
        .analytics-root.analytics-open .analytics-toggle {
            margin-bottom: 0;
            padding-bottom: 0;
            border-bottom: none;
            border-radius: 6px 6px 0 0;
        }

    /* submenu items align label text with main items (icons use same icon-wrap column) */
    .nav-scrollable .collapse .nav-link {
        padding-left: 0.6rem; /* keep same horizontal inset but icons stay in icon-wrap */
    }

    .analytics-submenu {
        margin: 0;
        width: 100%;
        border: 0;
        /* Flat top, rounded bottom: connects under the open toggle as one card. */
        border-radius: 0 0 6px 6px;
        padding: 0.2rem 0.15rem 0.15rem;
        background: rgba(255,255,255,0.06);
        border-left: 2px solid rgba(255,255,255,0.18);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
        display: grid;
        gap: 0.08rem;
        position: relative;
    }

    .nav-scrollable .analytics-submenu .analytics-submenu-link {
        color: #d7d7d7;
        min-height: 3rem;
        height: 3rem;
        line-height: 3rem;
        font-size: 0.9rem;
        font-weight: 400;
        border-radius: 4px;
        padding: 5px;
        gap: 0.6rem;
        margin-left: 0;
        width: 100%;
        white-space: nowrap;
    }

    /* The sidebar is a dark navy gradient even in light mode, so — like dark mode —
       lift the open group with a WHITE overlay into a distinctly lighter, clearly
       nested card (a black overlay barely registered, making sub-items look like
       top-level ones). A stronger left guide reinforces the nesting. No inset top
       highlight, so there's no HR-style divider line. */
    .light-mode .analytics-submenu {
        background: rgba(255,255,255,0.065);
        border-left-color: rgba(255,255,255,0.24);
        box-shadow: none;
    }

    /* Open toggle shares the submenu's tint so the merged card reads as one
       continuous surface (dark/default tint is set in the enrichment block). */
    .light-mode .analytics-root.analytics-open > .analytics-toggle {
        background-color: rgba(255,255,255,0.065);
    }

    /* Keep a hover response on the open toggle (its resting tint is subtle, so
       brighten it a touch more on hover). */
    .light-mode .analytics-root.analytics-open > .analytics-toggle:hover {
        background-color: rgba(255,255,255,0.12);
    }

    .nav-scrollable .analytics-submenu a.active,
    .nav-scrollable .analytics-submenu a[aria-current="page"] {
        background-color: rgba(255,255,255,0.37) !important;
        color: white !important;
    }

    .nav-scrollable .analytics-submenu .analytics-submenu-link:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }

    .nav-scrollable .analytics-submenu .icon-wrap {
        width: 1.25rem;
        opacity: 0.95;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .nav-scrollable .analytics-submenu .icon-wrap svg {
            width: 18px;
            height: 18px;
        }

        .nav-scrollable .analytics-submenu .icon-wrap svg.bi {
            width: 0.75rem !important;
            height: 0.75rem !important;
            min-width: 0.75rem;
            min-height: 0.75rem;
        }

    .nav-scrollable .analytics-submenu .icon-wrap .bi {
        margin-right: 0;
        top: 0;
    }

    .analytics-root .analytics-toggle:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }

    /* Ensure nested submenu frame is visible in all themes */
    .dark-mode .analytics-root {
        border-color: transparent !important;
        background: transparent !important;
    }

        .dark-mode .analytics-root.analytics-open .analytics-toggle {
            border-bottom-color: transparent !important;
        }

    .light-mode .analytics-root {
        border-color: transparent !important;
        background: transparent !important;
    }

        .light-mode .analytics-root.analytics-open .analytics-toggle {
            border-bottom-color: transparent !important;
        }

    /* make submenu icon a bit smaller */
    .nav-scrollable .collapse .icon-wrap svg {
        width: 18px;
        height: 18px;
    }

    /* Active and hover colors use NavMenu.razor.css defaults */

    /* focus for accessibility */
    .btn-toggle:focus {
        outline: 2px dashed rgba(255,255,255,0.12);
        outline-offset: 2px;
    }

    /* ── Pin icon button ─────────────────────────────────────────── */
    .org-nav-row {
        height: 3rem;
    }

    .pin-icon-btn {
        background: none;
        border: none;
        color: rgba(255,255,255,0.55);
        padding: 0.25rem 0.35rem;
        border-radius: 4px;
        cursor: pointer;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: color 0.15s, background-color 0.15s;
    }

    .pin-icon-btn:hover,
    .pin-icon-btn:focus {
        color: white;
        background-color: rgba(255,255,255,0.15);
        outline: none;
    }

    /* Active (pinned) state – colored pin */
    .pin-icon-btn--active {
        color: #ffc107; /* amber/yellow to signal active pin */
    }

    .pin-icon-btn--active:hover,
    .pin-icon-btn--active:focus {
        color: #ffe082;
        background-color: rgba(255,193,7,0.15);
    }

    /* Org name label in pinned submenu toggle: fill the row (so the pin +
       caret align flush-right like the other menus) and truncate gracefully. It stacks the
       organisation over the active branch; each line truncates on its own. */
    .org-pinned-label {
        display: flex;
        flex-direction: column;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }

    /* "All Organizations" link subtle separator */
    .org-submenu-all {
        border-top: 1px solid rgba(255,255,255,0.12);
        margin-top: 0.1rem !important;
        padding-top: 0.4rem !important;
        font-style: italic;
        opacity: 0.85;
    }

    /* ════════════════════════════════════════════════════════════════
       Polish & enrichment — visual only (colour / depth / motion).
       Deliberately changes NO sizing, spacing, or positioning: accents
       use inset shadows (not borders) and motion uses transforms, so
       nothing reflows. Honours prefers-reduced-motion.
       ════════════════════════════════════════════════════════════════ */

    /* Smooth state changes for every interactive row. */
    .nav-scrollable .nav-link,
    .analytics-root .analytics-toggle,
    .nav-scrollable .analytics-submenu .analytics-submenu-link {
        transition: background-color .18s ease, color .18s ease,
                    box-shadow .18s ease, transform .18s ease;
    }

    .icon-wrap,
    .analytics-caret-wrap {
        transition: transform .18s ease, opacity .18s ease, background-color .18s ease;
    }

    /* Icon lifts subtly on hover. */
    .nav-scrollable .nav-link:hover .icon-wrap,
    .analytics-root .analytics-toggle:hover .icon-wrap {
        transform: scale(1.12);
        opacity: 1;
    }

    .nav-scrollable .analytics-submenu a.active,
    .nav-scrollable .analytics-submenu a[aria-current="page"] {
        background: linear-gradient(90deg, rgba(0, 122, 255, 0.30), rgba(255, 255, 255, 0.06)) !important;
        box-shadow: inset 3px 0 0 0 #5aa9ff;
        color: #ffffff !important;
    }

    /* Submenu links nudge in on hover with a faint guide bar. */
    .nav-scrollable .analytics-submenu .analytics-submenu-link:hover {
        transform: translateX(2px);
        box-shadow: inset 2px 0 0 0 rgba(255, 255, 255, 0.35);
    }

    /* Open group: highlight the parent toggle and tint its caret pill. */
    .analytics-root.analytics-open > .analytics-toggle {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.06);
    }

    .analytics-root.analytics-open .analytics-caret-wrap {
        background: rgba(0, 122, 255, 0.38);
    }

    /* Springier caret rotation. */
    .analytics-caret {
        transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* Submenu fades + slides into its existing space; items stagger in. */
    .analytics-submenu {
        animation: navSubmenuReveal .22s ease both;
    }

    .analytics-submenu .analytics-submenu-link {
        animation: navSubmenuItem .26s ease both;
    }

    .analytics-submenu .analytics-submenu-link:nth-child(1) { animation-delay: .02s; }
    .analytics-submenu .analytics-submenu-link:nth-child(2) { animation-delay: .05s; }
    .analytics-submenu .analytics-submenu-link:nth-child(3) { animation-delay: .08s; }
    .analytics-submenu .analytics-submenu-link:nth-child(4) { animation-delay: .11s; }
    .analytics-submenu .analytics-submenu-link:nth-child(5) { animation-delay: .14s; }
    .analytics-submenu .analytics-submenu-link:nth-child(6) { animation-delay: .17s; }
    .analytics-submenu .analytics-submenu-link:nth-child(n+7) { animation-delay: .20s; }

    @keyframes navSubmenuReveal {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes navSubmenuItem {
        from { opacity: 0; transform: translateX(-6px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    /* Reduced motion: keep the states, drop the movement. */
    @media (prefers-reduced-motion: reduce) {
        .nav-scrollable .nav-link,
        .analytics-root .analytics-toggle,
        .nav-scrollable .analytics-submenu .analytics-submenu-link,
        .icon-wrap,
        .analytics-caret,
        .analytics-caret-wrap {
            transition: none;
        }

        .nav-scrollable .nav-link:hover .icon-wrap,
        .analytics-root .analytics-toggle:hover .icon-wrap,
        .nav-scrollable .analytics-submenu .analytics-submenu-link:hover {
            transform: none;
        }

        .analytics-submenu,
        .analytics-submenu .analytics-submenu-link {
            animation: none;
        }
    }

/* ── from MainLayout.razor ────────────────────────────────────────── */
/* #audit-26 — 8 rules that used to live here were ALSO declared in
       isolated-fallback.css, and this copy won on document order, so editing the file
       the styling policy names did nothing. They live there now, in the section at the
       end. Everything below is declared HERE only — do not re-add a global copy. */


    /* A soft accent hairline that fades in from the brand colour. */
    .top-row::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 2px;
        background: linear-gradient(90deg, rgba(0, 122, 255, 0.5), rgba(5, 38, 102, 0.18) 45%, transparent 80%);
        pointer-events: none;
    }

    .dark-mode .top-row::after {
        background: linear-gradient(90deg, rgba(96, 165, 250, 0.5), rgba(96, 165, 250, 0.12) 45%, transparent 80%);
    }

    .top-row-user-link::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 100%;
        height: 1.5px;
        border-radius: 999px;
        background: currentColor;
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .top-row-user-link:hover::after,
    .top-row-user-link:focus-visible::after {
        transform: scaleX(1);
    }

    .dark-mode .top-row-user-greeting {
        color: #cbd5e1;
    }

    .dark-mode .top-row-user-link {
        color: #60a5fa;
    }

    .sidebar::-webkit-scrollbar,
    .nav-scrollable::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track,
    .nav-scrollable::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb,
    .nav-scrollable::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.16);
        border-radius: 999px;
    }

    .sidebar:hover::-webkit-scrollbar-thumb,
    .nav-scrollable:hover::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.30);
    }

    /* ───────────────────────── Page body ───────────────────────── */
    /* Frame the routed page content as one elevated surface that echoes the
       banner / footer / navbar: a brand-tinted border, soft radius, a pinned
       accent top edge, and a dark surface that harmonises with the navbar.
       Scoped to .full-height-card (the layout wrapper) so nested Syncfusion
       .e-card components on individual pages are not affected. */
    .full-height-card.e-card {
        position: relative;
        padding: 1rem;
        border: 1px solid rgba(5, 38, 102, 0.12) !important;
        border-radius: 1rem;
        background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
        /* Inset accent strip (pinned — borders/shadows don't scroll) + soft lift. */
        box-shadow: inset 0 3px 0 0 rgba(0, 122, 255, 0.85),
                    0 18px 44px -26px rgba(5, 38, 102, 0.30);

        /* ⚠ Undo Syncfusion's `line-height: 36px` on `.e-card` (TrilokWeb#279).

           That is a FIXED PIXEL leading meant for a small card component, and this element is not
           one — it is the wrapper every routed page renders inside, so every descendant that does
           not set its own line-height inherits it. Because it does not scale with font size, the
           smaller the text the worse it gets: a 13px form label rendered at 2.7x leading, and a
           wrapped hint had close to a blank line through the middle of it.

           Measured before this rule: 71% of the visible text elements on /ops/infrastructure, 58%
           on /tempwearables, 56% on /settings. Not a regression from the 34.x upgrade — 29.1.37
           set the same value.

           Unitless so it scales with whatever size each descendant ends up at, and 1.5 because
           that is what the document outside this wrapper already uses (16px/24px).

           Same scoping as the rest of this rule: a real Syncfusion card nested inside a page keeps
           the component styling Syncfusion intended for it. */
        line-height: 1.5;
    }

    /* Let the framed card surface show through the inner content container. */
    .full-height-card .center-form-container {
        background: transparent !important;
    }

    .dark-mode .full-height-card.e-card {
        border-color: rgba(96, 165, 250, 0.16) !important;
        background: linear-gradient(180deg, #17191f 0%, #0e1014 100%);
        box-shadow: inset 0 3px 0 0 rgba(96, 165, 250, 0.80),
                    0 18px 44px -26px rgba(0, 0, 0, 0.65);
    }

    .dark-mode .full-height-card .center-form-container {
        background: transparent !important;
        color: #e6e9ef;
    }

    /* ───────────────────────── Footer ───────────────────────── */
    .app-footer {
        position: relative;
        text-align: center;
        border-top: 1px solid rgba(5, 38, 102, 0.10);
    }

    /* Centered accent rule riding the top border. */
    .app-footer::before {
        content: "";
        position: absolute;
        top: -1px;
        left: 50%;
        transform: translateX(-50%);
        width: min(420px, 62%);
        height: 2px;
        border-radius: 999px;
        background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.55), rgba(5, 38, 102, 0.45), transparent);
    }

    .app-footer__inner {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        font-size: 0.82rem;
        letter-spacing: 0.01em;
        color: #64748b;
    }

    /* ⚠ Both of these carried #94a3b8 — the DARK-mode footer tone — in BOTH themes. On the dark
       surface that is 7.31:1 and fine; on white it is 2.56:1, well under AA's 4.5:1. Dark mode
       never needed an override, so nothing flagged that the hard-coded value was the dark one.
       Inheriting from .app-footer__inner gives each theme its own tone — #64748b light, #94a3b8
       dark — and both pass.

       They cannot simply be lightened a little less: #64748b is already 4.76:1 on white, so any
       tone lighter than the surrounding text fails. A uniform footer is the only one that passes,
       which is why the de-emphasis is gone rather than reduced. */
    .app-footer__credit,
    .app-footer__copy {
        color: inherit;
    }

    .app-footer__brand {
        position: relative;
        font-weight: 700;
        text-decoration: none;
        background: linear-gradient(90deg, #052666, #007aff);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        transition: opacity 0.2s ease;
    }

    .app-footer__brand::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -3px;
        width: 100%;
        height: 1.5px;
        border-radius: 999px;
        background: linear-gradient(90deg, #052666, #007aff);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .app-footer__brand:hover {
        opacity: 0.85;
    }

    .app-footer__brand:hover::after,
    .app-footer__brand:focus-visible::after {
        transform: scaleX(1);
    }

    /* Keep the ™ visible even though the brand text is clipped to its gradient. */
    .app-footer__tm {
        font-size: 0.62em;
        font-weight: 600;
        margin-left: 1px;
        color: #007aff;
        -webkit-text-fill-color: #007aff;
    }

    .app-footer__dot {
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: currentColor;
        opacity: 0.4;
    }

    /* .app-footer__copy's colour is set with .app-footer__credit above — they share the fault and
       the fix, so they share the rule. */

    .dark-mode .app-footer {
        border-top-color: rgba(96, 165, 250, 0.14);
    }

    .dark-mode .app-footer__inner {
        color: #94a3b8;
    }

    .dark-mode .app-footer__brand {
        background: linear-gradient(90deg, #93c5fd, #60a5fa);
        -webkit-background-clip: text;
        background-clip: text;
    }

    .dark-mode .app-footer__brand::after {
        background: linear-gradient(90deg, #93c5fd, #60a5fa);
    }

    .dark-mode .app-footer__tm {
        color: #93c5fd;
        -webkit-text-fill-color: #93c5fd;
    }

    @media (prefers-reduced-motion: reduce) {
        .top-row-user-link::after,
        .app-footer__brand::after {
            transition: none;
        }
    }


/* The roster pickers' empty-state note (temp-wearable loan desk).
   Syncfusion renders NoRecordsTemplate inside the popup, which is portalled to the document
   root — so this cannot live in a dialog-scoped block. It replaces the stock "No Records
   Found" with a sentence that says WHICH empty this is: nothing typed yet, still searching,
   or a real miss. */
.yb-ddl-note {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--yb-text-muted, #586683);
    text-align: left;
}

.yb-ddl-note.is-busy {
    color: var(--yb-text, #1b2538);
}

.yb-ddl-note.is-busy::before {
    content: "";
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-inline-end: 0.45rem;
    vertical-align: -0.05rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: yb-ddl-note-spin 0.7s linear infinite;
}

@keyframes yb-ddl-note-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .yb-ddl-note.is-busy::before {
        animation: none;
    }
}

/* A disabled Syncfusion field in dark mode must LOOK locked. site.css paints every dark input
   with the same sunken fill, text and border (!important, (0,2,0)), so a locked field was
   indistinguishable from an editable one — the org admin's locked Organization beside the
   Branch they may pick in the pin dialog, and every branch admin's locked search filter.
   Light mode already greys a disabled field; this is its dark twin: it sits flat on the panel
   (surface-2, not sunken), with muted text and a softer border. (0,3,0) + !important beats the
   site.css rule regardless of load order. A disabled control is exempt from WCAG 1.4.11. */
[data-theme="dark"] .e-input-group.e-disabled,
[data-theme="dark"] .e-input-group.e-disabled input,
[data-theme="dark"] .e-input-group.e-disabled .e-input {
    background-color: var(--yb-surface-2, #1c212b) !important;
    color: var(--yb-text-muted, #a3b0c7) !important;
    border-color: rgba(148, 170, 205, 0.25) !important;
    cursor: not-allowed;
}

/* The active organisation and branch beside the breadcrumb (YbScopeStrip). A quiet accent-tinted
   block: it has to be findable on every screen without competing with the page's own title. The
   branch is the part that changes, so it carries the weight; the organisation is muted. It never
   shrinks below the branch — the breadcrumb yields first (see .yb-crumbs__item above). */
.yb-scope-strip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    min-width: 0;
    max-width: 65%;
    margin: 0 0 0 0.75rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(var(--yb-accent-rgb), 0.22);
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-accent-rgb), 0.08);
    color: var(--yb-text);
    font-family: var(--yb-font-body);
    font-size: 0.8125rem;
    line-height: 1.3;
    white-space: nowrap;
}

.yb-scope-strip__icon,
.yb-scope-strip__sep {
    flex-shrink: 0;
    color: var(--yb-text-muted);
    font-size: 0.75rem;
}

.yb-scope-strip__org {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--yb-text-muted);
    font-weight: 500;
}

.yb-scope-strip__branch {
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

/* "All sites" / "All branches" in place of a branch (an Operations board widened past it). */
.yb-scope-strip__branch--wide {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.yb-scope-strip__branch--wide i {
    color: var(--yb-brand-500);
    font-size: 0.75rem;
}

/* The ⓘ beside the branch: opens the branch's details (it replaced the per-page organisation
   banner). A borderless icon button — the strip already frames it. */
.yb-scope-strip__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin-left: 0.1rem;
    padding: 0;
    border: 0;
    border-radius: var(--yb-radius-sm);
    background: transparent;
    color: var(--yb-text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
}

.yb-scope-strip__info:hover,
.yb-scope-strip__info:focus-visible {
    background: rgba(var(--yb-accent-rgb), 0.14);
    color: var(--yb-text);
    outline: none;
}

/* The branch card behind the strip's info button — a display card, not a tooltip slab.
   - The navy band is --yb-brand-900, the sidebar's own colour, so the card belongs to the shell;
     in dark mode it lifts to --yb-brand-700 so it still separates from a near-black page.
   - The branch's own name, white in the display face, is the one strong element.
   - Amber marks the default branch: amber is already the app's "pinned" colour (the sidebar star).
   - Facts sit on single-hue tinted tiles — colour that organises, not a rainbow.
   The Syncfusion arrow is recoloured to the band it points out of. */
.e-tooltip-wrap.yb-scope-tip {
    --yb-card-band: var(--yb-brand-900);
    --yb-card-tile: rgba(var(--yb-accent-rgb), 0.10);
    --yb-card-tile-ink: var(--yb-brand-600);
    width: 21rem;
    max-width: calc(100vw - 2rem);
    overflow: visible;
    border: 0;
    border-radius: 10px;
    background: var(--yb-surface);
    box-shadow: 0 14px 34px rgba(5, 38, 102, 0.20), 0 2px 6px rgba(5, 38, 102, 0.10);
    opacity: 1;
}

[data-theme="dark"] .e-tooltip-wrap.yb-scope-tip {
    --yb-card-band: var(--yb-brand-700);
    --yb-card-tile: rgba(74, 144, 255, 0.16);
    --yb-card-tile-ink: var(--yb-brand-400);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(148, 170, 205, 0.18);
}

.e-tooltip-wrap.yb-scope-tip .e-tip-content {
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    color: var(--yb-text);
}

.e-tooltip-wrap.yb-scope-tip .e-arrow-tip-outer,
.e-tooltip-wrap.yb-scope-tip .e-arrow-tip-inner {
    border-bottom-color: var(--yb-card-band);
    color: var(--yb-card-band);
}

.yb-branch-card {
    font-family: var(--yb-font-body);
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: left;
}

.yb-branch-card__head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.95rem 1.1rem 0.9rem;
    border-top: 3px solid var(--yb-warning);
    background: var(--yb-card-band);
    color: #fff;
}

.yb-branch-card__org {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.yb-branch-card__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    font-family: var(--yb-font-display);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.2;
}

/* A rounded rectangle, not a pill (the design system avoids oval badges). */
.yb-branch-card__tag {
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    background: var(--yb-warning);
    color: #1b2538;
    font-family: var(--yb-font-body);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.3;
}

.yb-branch-card__body {
    display: grid;
    gap: 0.8rem;
    padding: 0.95rem 1.1rem 0.9rem;
}

.yb-branch-card__fact {
    display: grid;
    grid-template-columns: 2rem 1fr;
    column-gap: 0.75rem;
    align-items: start;
}

.yb-branch-card__tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--yb-card-tile);
    color: var(--yb-card-tile-ink);
    font-size: 0.95rem;
}

.yb-branch-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--yb-text);
}

.yb-branch-card__label {
    color: var(--yb-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.yb-branch-card__strong {
    font-weight: 600;
}

.yb-branch-card__sub {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--yb-text-muted);
}

.yb-branch-card__sub i {
    font-size: 0.75rem;
}

.yb-branch-card__meta {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0.75rem 1.1rem 0.9rem;
    border-top: 1px solid var(--yb-border);
    background: var(--yb-surface-2);
}

.yb-branch-card__meta div {
    display: grid;
    grid-template-columns: 3.25rem 1fr;
    column-gap: 0.75rem;
}

.yb-branch-card__meta dt {
    color: var(--yb-text-muted);
    font-weight: 600;
}

.yb-branch-card__meta dd {
    margin: 0;
    color: var(--yb-text);
    font-weight: 500;
}

.yb-branch-card__empty {
    margin: 0;
    padding: 0.9rem 1.1rem;
    color: var(--yb-text-muted);
}

.yb-branch-card__empty--inline {
    padding: 0;
}

/* On a phone the top bar has no room left: the menu, settings, theme and Logout buttons leave the
   trail about 77px at 390px (measured), and the strip squeezed beside it showed only its icon. So
   below the tablet breakpoint the strip moves to a row of its own under the bar (.yb-scope-row,
   rendered by MainLayout), full width, and the in-bar copy steps aside. */
.yb-scope-row {
    display: none;
}

@media (max-width: 767.98px) {
    .top-row .yb-scope-strip {
        display: none;
    }

    .yb-scope-row {
        display: block;
        padding: 0.4rem 1rem 0;
    }

    .yb-scope-row .yb-scope-strip {
        max-width: 100%;
        margin: 0;
    }
}

/* The sidebar's pinned label: organisation over branch (the container is .org-pinned-label above). */
.org-pinned-label__org,
.org-pinned-label__branch {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.org-pinned-label__branch {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Which sites an Operations board shows: the branch in use, or all of them (OpsScopeToggle). A
   two-option segmented control on the surface ramp; the chosen option carries the accent. */
.yb-ops-scope {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0 0 0.9rem;
    padding: 0.2rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
}

.yb-ops-scope__opt {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--yb-text-muted);
    font-family: var(--yb-font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.yb-ops-scope__opt:hover,
.yb-ops-scope__opt:focus-visible {
    color: var(--yb-text);
    outline: none;
    box-shadow: var(--yb-ring);
}

.yb-ops-scope__opt.is-on {
    background: var(--yb-surface);
    color: var(--yb-text);
    box-shadow: var(--yb-shadow-sm);
}

.yb-ops-scope__opt.is-on i {
    color: var(--yb-brand-500);
}

/* ── School Overview (#390) ───────────────────────────────────────────────────────────────────
   The principal's page. Built on the Operations overview's pieces (.yb-ops-section, -strip, -tile,
   -period, -table) so the two overviews read as one product; only what they lack is added here,
   all from the ui-refinement.css tokens, so dark mode follows the tokens with no rules of its own. */
.yb-so-count {
    display: inline-block;
    margin-left: 0.45rem;
    padding: 0.05rem 0.45rem;
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    border: 1px solid var(--yb-border);
    font-family: var(--yb-font-body, inherit);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--yb-text-muted);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.yb-so-note {
    margin: 0.5rem 0;
    font-size: 0.82rem;
    color: var(--yb-text-muted);
}

/* The table scrolls inside its own box at phone width; the page never does. */
.yb-so-scroll {
    overflow-x: auto;
    margin-block: 0.75rem;
}

.yb-so-table {
    min-width: 640px;
}

.yb-so-table tbody th {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--yb-border);
    font-weight: 600;
    color: var(--yb-text);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.yb-so-table tbody tr:last-child th {
    border-bottom: 0;
}

.yb-so-time,
.yb-so-num {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.yb-so-table .yb-so-num {
    text-align: right;
}

.yb-so-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--yb-text-muted);
}

.yb-so-none {
    font-style: italic;
    color: var(--yb-text-soft);
}

/* A rounded rect, not a pill (#37), and the word is always there beside the colour. */
.yb-so-flag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-danger-rgb), 0.13);
    border: 1px solid rgba(var(--yb-danger-rgb), 0.32);
    color: var(--yb-danger-text);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── School Overview: hierarchy (UI/UX pass, 2026-09-27) ───────────────────────────────────────
   The page read flat: five sections of equal weight, so "12 escalated, still open" weighed the
   same as "6 students have a baseline". One loud element — the opening sentence, in the display
   face — answers "what needs me today?"; everything under it is quieter and tighter than before.
   Scoped to .yb-so throughout: .yb-ops-tile and .yb-ops-strip are shared with the ops boards. */
.yb-so-lede {
    --tone: var(--yb-warning-rgb);
    margin: 0.25rem 0 1.9rem;
    padding: 0.15rem 0 0.15rem 1.1rem;
    border-left: 4px solid rgb(var(--tone));
    text-align: left;
    max-width: 62rem;
}

.yb-so-lede--clear { --tone: var(--yb-success-rgb); }

.yb-so-lede__sentence {
    margin: 0;
    font-family: var(--yb-font-display);
    font-size: clamp(1.45rem, 1.05rem + 1.3vw, 2.1rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--yb-text);
    text-wrap: balance;
}

.yb-so-lede__detail {
    margin: 0.45rem 0 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--yb-text-muted);
}

/* Tiles size to their number instead of stretching one figure across half the page, and read in
   sentence case — the all-caps labels were chrome, not information. */
.yb-so .yb-ops-strip {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 17rem));
}

/* On a phone a capped tile leaves a strip of nothing beside it; there it takes the row. */
@media (max-width: 560px) {
    .yb-so .yb-ops-strip { grid-template-columns: 1fr; }
}

.yb-so .yb-ops-tile__label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.86rem;
}

/* An alert's latest step as a chip. The word is always there beside the colour, and only an
   escalation carries an alarm hue; attended is the good news, notified is neutral. */
.yb-so-status {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--yb-text);
    white-space: nowrap;
}

.yb-so-status--escalated {
    background: rgba(var(--yb-danger-rgb), 0.12);
    border-color: rgba(var(--yb-danger-rgb), 0.38);
    color: var(--yb-danger-text);
}

.yb-so-status--attended {
    background: rgba(var(--yb-success-rgb), 0.1);
    border-color: rgba(var(--yb-success-rgb), 0.38);
}

.yb-so-status--none {
    border-style: dashed;
    color: var(--yb-text-muted);
}

/* "No one attended yet" is the signal in these tables, not a footnote: it was faint italic grey.
   Full-strength text with an amber mark; the fill colours only the mark, never the words. */
.yb-so .yb-so-none {
    font-style: normal;
    color: var(--yb-text);
}

.yb-so .yb-so-none::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.45rem;
    border-radius: 2px;
    background: rgb(var(--yb-warning-rgb));
    vertical-align: 0.08em;
}

.yb-so-total th,
.yb-so-total td {
    background: var(--yb-surface-2);
    font-weight: 600;
}

/* The shared selector's active state uses --yb-brand-600, which has no dark value: on the dark
   card it read at a glance as disabled. The School Overview selects a dark step for its own
   selectors (the Operations overview still has the shared style). */
html[data-theme="dark"] .yb-so .yb-ops-period__btn.is-active {
    color: var(--yb-brand-400);
    border-color: var(--yb-brand-400);
}

.yb-so .yb-ops-period__btn[aria-disabled="true"] {
    cursor: progress;
    opacity: 0.7;
}

.yb-so-withheld td {
    font-style: italic;
    color: var(--yb-text-muted);
}

/* ── Alert exceptions (TrilokAPI #401) ────────────────────────────────────────────────────────
   The approval ledger's list (yb-bge / yb-aar) with a row of category tabs above it. A tab carries
   its count and how many are still open; a handling problem with alerts still open takes the
   warning edge. The categories overlap, so nothing here is a total. */
.yb-aex-toolbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* The custom range: two pickers and their actions on one row under the toolbar. */
.yb-aex-range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem 1rem;
    margin: 0.5rem 0 0.25rem;
    padding: 0.75rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
}

.yb-aex-range__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 12rem;
}

.yb-aex-range__actions {
    display: flex;
    gap: 0.5rem;
    align-self: flex-end;
    padding-bottom: 0.15rem;
}

.yb-aex-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: var(--yb-text);
    font-size: 0.88rem;
    cursor: pointer;
}

.yb-aex-open input {
    accent-color: var(--yb-accent);
}

.yb-aex-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 0.5rem;
}

.yb-aex-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 11rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    color: var(--yb-text);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--yb-dur) var(--yb-ease), background var(--yb-dur) var(--yb-ease);
}

.yb-aex-tab:hover {
    border-color: var(--yb-border-strong);
}

.yb-aex-tab:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

.yb-aex-tab.is-warn {
    box-shadow: inset 3px 0 0 rgb(var(--yb-warning-rgb));
}

.yb-aex-tab.is-active {
    border-color: var(--yb-accent);
    background: color-mix(in srgb, var(--yb-accent) 9%, transparent);
}

.yb-aex-tab__name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.86rem;
    font-weight: 600;
}

.yb-aex-tab__figure {
    color: var(--yb-text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.yb-aex-meaning {
    margin: 0 0 0.75rem;
    color: var(--yb-text-muted);
    font-size: 0.86rem;
}

/* The ledger card's left rule is a warning by default (--sev, governance-breakglass.css, which
   loads later — hence the extra class). Here it is earned: only a row with a handling problem
   wears it; a critical-only row is the edge's grade and keeps a neutral rule. */
.yb-aex .yb-bge-event.yb-aex-row {
    border-left-color: var(--yb-border);
}

.yb-aex .yb-bge-event.yb-aex-row.is-problem {
    border-left-color: rgb(var(--yb-warning-rgb));
}

.yb-aex-what {
    color: var(--yb-text);
    font-size: 0.88rem;
}

/* The four exception counts on a dashboard (YbAlertExceptionTiles): the ops tiles under a small
   heading, set apart from the figures above. */
.yb-aex-tiles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.yb-aex-tiles > .yb-so-targets__title,
.yb-aex-tiles > .yb-ops-strip {
    margin: 0;
}

.yb-aex-tiles .yb-ops-tile__label .bi {
    color: var(--yb-text-muted);
}

.yb-aex-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Sensing coverage above the safety figures (#390 P3): the tiles the Management Overview uses,
   under a small heading, with room below before the period selector. */
.yb-so-coverage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* The heading already spaces the strip; the strip's own top margin doubled it. */
.yb-so-coverage > .yb-so-targets__title,
.yb-so-coverage > .yb-ops-strip {
    margin: 0;
}

/* ── Wellbeing by grade: a grade opens onto its sections (#390 P4) ──────────────────────────────
   The chevron sits in a fixed slot so every grade name starts at the same x whether or not it can
   open. A section row is the ops boards' child row (.yb-ops-child): sunken, lighter, with a spine —
   and indented to the grade's name, so the two levels never read as siblings (nor as the total row). */
.yb-so-grade {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.yb-so-disclose,
.yb-so-disclose-gap {
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

.yb-so-disclose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    color: var(--yb-text-muted);
    cursor: pointer;
    transition: color var(--yb-dur) var(--yb-ease), border-color var(--yb-dur) var(--yb-ease);
}

.yb-so-disclose:hover,
.yb-so-disclose[aria-expanded="true"] {
    color: var(--yb-brand-600);
    border-color: var(--yb-brand-600);
}

html[data-theme="dark"] .yb-so-disclose:hover,
html[data-theme="dark"] .yb-so-disclose[aria-expanded="true"] {
    color: var(--yb-brand-400);
    border-color: var(--yb-brand-400);
}

.yb-so-disclose:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

.yb-so-disclose .bi {
    transition: transform var(--yb-dur) var(--yb-ease);
}

.yb-so-disclose[aria-expanded="true"] .bi {
    transform: rotate(90deg);
}

.yb-so-table tbody tr.yb-so-section th,
.yb-so-table tbody tr.yb-so-section td {
    background: var(--yb-surface-sunken);
    font-size: 0.86rem;
}

.yb-so-table tbody tr.yb-so-section th {
    padding-left: calc(0.7rem + 1.5rem + 0.35rem);
    box-shadow: inset 3px 0 0 var(--yb-border-strong);
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .yb-so-disclose .bi {
        transition: none;
    }
}

/* ── School Overview: the safety overview's bars and columns (P3, #353) ─────────────────────────
   One series each, so one hue and no legend: the caption names the series and every value is
   labelled directly, so the list is also its own table. The mark colour is SELECTED per theme
   (brand-500 light, brand-400 dark), not flipped — both validated against their card surface with
   the dataviz palette validator (contrast >= 3:1). Thin marks, the data end rounded 4px, anchored
   to the baseline; the track is recessive. */
.yb-so {
    --yb-so-mark: var(--yb-brand-500);
}

html[data-theme="dark"] .yb-so {
    --yb-so-mark: var(--yb-brand-400);
}

/* One colour per QUESTION a Safety chart answers (owner, 2026-09-30, "Option A"): what happened (cause,
   criticality) plum, where (location) cyan, who (class) violet, when (day, hour) the brand blue above.
   Red, amber, green and teal are NEVER used: they belong to the deviation codes (SERV0008) and to
   status, and on a count of alerts they would read as a verdict (ADR 0001 D6). Validated with the
   dataviz palette checker: every mark clears 3:1 on its card in both themes and sits in the readable
   lightness band; with the warm hues reserved only four colours stay clearly apart, which is why day
   and hour — one question at two grains — share one. Dark steps are selected, not flipped.
   ChartPaletteTests reads these values back. */
.yb-so {
    --yb-so-what: #9c3584;
    --yb-so-where: #0b7fa3;
    --yb-so-who: #6a45c6;
}

html[data-theme="dark"] .yb-so {
    --yb-so-what: #c45aa8;
    --yb-so-where: #1f96bd;
    --yb-so-who: #8f6fe8;
}

.yb-so-what { --yb-so-mark: var(--yb-so-what); }
.yb-so-where { --yb-so-mark: var(--yb-so-where); }
.yb-so-who { --yb-so-mark: var(--yb-so-who); }

/* "No student named" and "Several classes" are not classes; they sit quieter than the rows that are. */
.yb-so-bars__row.is-aside .yb-so-bars__label {
    font-style: italic;
    color: var(--yb-text-muted);
}

/* ── Review Queue: outcomes (C9) and before/after (C7) ─────────────────────────────────────────
   Outcomes are the counsellor's recorded judgement. Owner: coloured as the dashboard's outcome
   breakdown colours Recovered / Stable / Needs escalation — Improving green, No change blue,
   Deteriorating red — by tint and border only, so the text keeps its contrast in both themes. An
   outcome that CLOSED the case (handed on by the counsellor) takes the counsellor violet: the accent
   blue it used to carry could not be told from No change's blue. */
.yb-rq-outcomes {
    margin-top: 1rem;
}

.yb-rq-outcomes__title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--yb-text);
}

.yb-rq-outcomes__list {
    list-style: none;
    margin: 0 0 0.4rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.yb-rq-outcome {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: 6px;
    background: var(--yb-card);
    color: var(--yb-text);
    font-size: 0.85rem;
}

.yb-rq-outcome__count {
    font-family: var(--yb-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.yb-rq-outcome.is-closing {
    background: rgba(var(--yb-counselor-rgb), 0.12);
    border-color: rgba(var(--yb-counselor-rgb), 0.55);
}

.yb-rq-outcome.is-empty { border-style: dashed; }
.yb-rq-outcome.is-zero { color: var(--yb-text-muted); }

.yb-rq-outcome.is-improving {
    background: rgba(var(--yb-success-rgb), 0.12);
    border-color: rgba(var(--yb-success-rgb), 0.55);
}

.yb-rq-outcome.is-no-change {
    background: rgba(var(--yb-info-rgb), 0.12);
    border-color: rgba(var(--yb-info-rgb), 0.55);
}

.yb-rq-outcome.is-deteriorating {
    background: rgba(var(--yb-danger-rgb), 0.12);
    border-color: rgba(var(--yb-danger-rgb), 0.55);
}

.yb-rq-effect__lede {
    max-width: 75ch;
    margin: 0.25rem 0 0.6rem;
    font-size: 0.9rem;
    color: var(--yb-text-muted);
    text-align: left;
}

.yb-rq-effect__summary {
    margin: 0 0 0.75rem;
    font-family: var(--yb-font-display);
    font-size: 1rem;
    color: var(--yb-text);
    text-align: left;
}

/* The ops table styles body cells only; a row header needs the same cell, left-set and a touch heavier. */
.yb-rq-effect__table tbody th,
.yb-so-response__table tbody th {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--yb-border);
    text-align: left;
    font-weight: 600;
    color: var(--yb-text);
}

.yb-rq-effect__table tbody tr:last-child th,
.yb-so-response__table tbody tr:last-child th { border-bottom: 0; }
.yb-rq-effect__table tbody tr:hover th,
.yb-so-response__table tbody tr:hover th { background: var(--yb-surface-2); }

/* Who responded, by staff type (School Overview, P6 v1). */
.yb-so-response {
    text-align: left;
}

.yb-so-response__lede {
    max-width: 75ch;
    margin: 0.25rem 0 0.6rem;
    font-size: 0.9rem;
    color: var(--yb-text-muted);
}

.yb-so-response__overall {
    margin-bottom: 0.75rem;
}

/* These chips are sentences: on a phone they wrap inside the card rather than run past it. */
.yb-so-response__overall .yb-so-chip {
    max-width: 100%;
    white-space: normal;
}

.yb-so-response__table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.yb-so-response__hidden {
    color: var(--yb-text-muted);
    font-style: italic;
}

/* By SPOC slot and the workload list (TrilokAPI #402): sub-panels of "Who responded". */
.yb-so-slots {
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--yb-border);
}

.yb-so-slots__title {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--yb-text);
}

.yb-rq-effect__table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Episodes before and after counselling on the Management Overview (M6, TrilokAPI #435): a sub-panel
   of Counselling, and of the organisation view, ruled off like the SPOC-slot panel. */
.yb-mo-effect .yb-so-scroll + .yb-so-scroll {
    margin-top: 0.85rem;
}

.yb-so-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
    margin-block: 0.75rem;
}

.yb-so-bars,
.yb-so-columns {
    margin: 0;
    padding: 0.9rem 1rem;
    background: var(--yb-card);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    box-shadow: var(--yb-shadow-xs);
}

.yb-so-bars__title {
    margin: 0 0 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--yb-text-muted);
}

.yb-so-bars__title .yb-so-sub {
    display: inline;
    margin-left: 0.4rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.yb-so-bars__list,
.yb-so-columns__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.yb-so-bars__row {
    display: grid;
    grid-template-columns: minmax(0, 16rem) 1fr 2.5rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.2rem 0;
}

/* Phone width: the label takes its own line, the bar and its value the next. Side by side, a 16rem
   label column left the bar a sliver on a 390px screen (browser QA of #353). */
@media (max-width: 480px) {
    .yb-so-bars__row {
        grid-template-columns: 1fr 2.5rem;
        row-gap: 0.15rem;
    }

    .yb-so-bars__label {
        grid-column: 1 / -1;
        white-space: normal;
    }
}

.yb-so-bars__label {
    font-size: 0.85rem;
    color: var(--yb-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yb-so-bars__track {
    height: 10px;
    background: var(--yb-surface-2);
    border-radius: 0 4px 4px 0;
}

.yb-so-bars__bar {
    display: block;
    height: 100%;
    min-width: 2px;
    background: var(--yb-so-mark);
    border-radius: 0 4px 4px 0;
}

.yb-so-bars__value {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--yb-text);
    font-variant-numeric: tabular-nums;
}

.yb-so-columns {
    margin-block: 0.75rem;
}

.yb-so-columns__list {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    overflow-x: auto;
}

.yb-so-columns__col {
    flex: 1 1 0;
    min-width: 2.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.yb-so-columns__value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--yb-text);
    font-variant-numeric: tabular-nums;
}

.yb-so-columns__track {
    display: flex;
    align-items: flex-end;
    width: 60%;
    max-width: 2.2rem;
    height: 96px;
    border-bottom: 1px solid var(--yb-border);
}

.yb-so-columns__bar {
    display: block;
    width: 100%;
    background: var(--yb-so-mark);
    border-radius: 4px 4px 0 0;
}

.yb-so-columns__label {
    font-size: 0.74rem;
    color: var(--yb-text-muted);
    white-space: nowrap;
}

/* By day (or week) and by hour of day side by side when the section is wide enough for both, stacked
   when it is not (ADR 0001 M4 / P3). */
.yb-so-timecharts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 0 0.85rem;
}

/* 24 columns must fit a card without scrolling, so they are narrow, packed, and the zero hours carry
   no number — the empty track already says zero. */
.yb-so-columns--hours .yb-so-columns__list {
    gap: 0;
    align-items: stretch;
    overflow-x: visible;
}

/* Every hour the same height, so the school band has a straight top edge. */
.yb-so-columns--hours .yb-so-columns__col {
    justify-content: flex-end;
}

.yb-so-columns--hours .yb-so-columns__col {
    min-width: 0;
}

.yb-so-columns--hours .yb-so-columns__track {
    width: 78%;
}

.yb-so-columns--hours .yb-so-columns__value {
    min-height: 1.1em;
    font-size: 0.68rem;
}

.yb-so-columns--hours .yb-so-columns__label {
    min-height: 1.1em;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

/* Grey means the school is CLOSED, on both time charts (owner, 2026-09-30): Sunday behind the day
   columns, and the hours outside the school day (PROD0001) behind the hour columns. School time stays
   plain — it is the normal frame. Shading the TIME, never the bar: an alert at 19:00 or on a Sunday
   keeps its full colour, because greying it would make a real alert look smaller. */
.yb-so-columns__col.is-closed {
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
}

.yb-so-columns__col.is-closed .yb-so-columns__label {
    color: var(--yb-text-soft, var(--yb-text-muted));
    font-style: italic;
}

/* The closed hours are one continuous stretch either side of the school day: square edges, no gap
   (the hour list has none), and upright axis numbers. */
.yb-so-columns--hours .yb-so-columns__col.is-closed {
    border-radius: 0;
}

.yb-so-columns--hours .yb-so-columns__col.is-closed .yb-so-columns__label {
    font-style: normal;
}

/* The school day gets the width: an empty hour outside it is a sliver (about a quarter of a school
   hour), so the day's shape is still there, midnight to midnight, but takes little room. A closed hour
   with an alert is NOT squeezed. Its axis number may run past the sliver into its neighbours, which
   are slivers too and carry no number of their own. */
.yb-so-columns--hours .yb-so-columns__col.is-squeezed {
    flex-grow: 0.28;
}

.yb-so-columns--hours .yb-so-columns__col.is-squeezed .yb-so-columns__track {
    visibility: hidden;
}

.yb-so-columns--hours .yb-so-columns__col.is-squeezed .yb-so-columns__label {
    overflow: visible;
    width: 0;
    display: flex;
    justify-content: center;
}

.yb-so-columns__key {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    color: var(--yb-text-muted);
}

.yb-so-columns__swatch {
    width: 0.9rem;
    height: 0.65rem;
    border-radius: 2px;
    background: var(--yb-surface-2);
    box-shadow: inset 0 0 0 1px var(--yb-border);
}

/* ── Against the branch's response targets (#356, ADR 0001 P2/M3) ───────────────────────────
   A sub-block of the Safety overview. Four chips partition the measured alerts; only "overdue,
   still waiting" carries the alarm, and only when it is not zero — the same spine-not-red-number
   rule as .yb-ops-tile.is-emphasis. Text colours are text tokens; the fills only tint. */
/* ── School Overview: cards with a chip legend ──────────────────────────────────────────────
   One device, used by Class wellbeing and Counsellor review: a wide card whose number is broken
   down by coloured chips. The chips carry the colour; the card stays the page's plain tile.
   The wide card spans two columns only when the strip itself is wide enough for two, so on a phone
   it never forces a second column (a container query on the strip, not the viewport). */
.yb-so-strip {
    container-type: inline-size;
}

@container (min-width: 460px) {
    .yb-so-strip .yb-ops-tile--wide {
        grid-column: span 2;
    }
}

.yb-so-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.55rem 0 0.4rem;
    padding: 0;
    list-style: none;
}

/* Chip sizing for both kinds (pattern hues, deviation codes). Two classes, so it outranks the
   pattern chip's own margin/nowrap without touching the counsellor queue's chips. */
.yb-so-chips .yb-so-chips__chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
    padding: 0.2rem 0.55rem;
    border-radius: var(--yb-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.yb-so-chips__count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Nothing in this band or pattern: it keeps its place, but steps back — no fill, a dashed edge,
   muted ink. Three classes, to outrank the pattern hue and its dark-mode rule. */
.yb-so-chips .yb-so-chips__chip.is-zero {
    background: transparent;
    border: 1px dashed var(--yb-border-strong);
    color: var(--yb-text-muted);
}

/* The episode mix: one bar, segments in the school's own deviation colours. */
.yb-so-mix {
    display: flex;
    gap: 2px;
    height: 0.6rem;
    margin-top: 0.35rem;
    border-radius: var(--yb-radius-sm);
    overflow: hidden;
}

.yb-so-mix__seg {
    display: block;
    min-width: 4px;
}

.yb-so-targets,
.yb-so-response {
    margin-block: 0.25rem 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    background: var(--yb-card);
}

.yb-so-targets__title {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--yb-text);
}

.yb-so-targets__rows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.9rem 1.5rem;
}

.yb-so-target__label {
    margin: 0 0 0.45rem;
    font-weight: 600;
    color: var(--yb-text);
}

.yb-so-target__label .yb-so-sub {
    display: inline;
    margin-left: 0.35rem;
    font-weight: 400;
}

.yb-so-target__chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.yb-so-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: 6px; /* a rounded rectangle, never a pill */
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--yb-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.yb-so-chip--good {
    background: rgba(var(--yb-success-rgb), 0.10);
    border-color: rgba(var(--yb-success-rgb), 0.35);
    color: var(--yb-text);
}

.yb-so-chip--alarm {
    background: rgba(var(--yb-danger-rgb), 0.10);
    border-color: rgba(var(--yb-danger-rgb), 0.45);
    border-left: 3px solid var(--yb-danger);
    color: var(--yb-text);
}

.yb-so-chip--alarm i { color: var(--yb-danger-text); }

.yb-so-target__foot {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--yb-text-muted);
}

/* ── The counsellor review queue (#389 C1, TrilokAPI #377) ──────────────────────────────────────
   Built on the School Overview's pieces (.yb-so-*, .yb-ops-*). A signal chip is a rounded rect in
   the brand tint, NOT a status colour: a signal names a pattern in the episode record, and a red
   chip would read as a verdict on the student (ADR 0001 D6). */
.yb-rq-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.25rem;
    margin: 1rem 0 0.25rem;
}

.yb-rq-asof {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.yb-rq-asof__label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--yb-text-muted);
}

.yb-rq-window {
    margin: 0;
}

.yb-rq-signal {
    display: inline-block;
    margin: 0 0.3rem 0.2rem 0;
    padding: 0.1rem 0.45rem;
    border-radius: var(--yb-radius-sm);
    background: rgba(var(--yb-accent-rgb), 0.1);
    border: 1px solid rgba(var(--yb-accent-rgb), 0.3);
    color: var(--yb-text);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

/* The C4 pattern chip (#389): ONE of these describes the student, so it is the solid chip and the
   signals beside it stay tinted — the eye should land on the summary, then read the facts it came
   from.

   NEVER a status colour: "gradually worsening" in red would turn a count into a verdict (ADR 0001
   D6), and "fewer than before" in green would promise recovery. That rule stands, and it is why
   this palette excludes red, amber and green outright — they are spoken for by the D-codes beside
   it (SERV0008: D4 #B02A37, D3 #DC3545, D2 #FFA500) and by --yb-danger/--yb-warning/--yb-success.

   What changed: the five were all one blue, so the chip and the glossary carried no information a
   counsellor could scan — the column had to be read word by word. Each pattern now takes a
   CATEGORICAL hue from a palette of five — plum, violet, indigo, teal, slate — the way a chart
   legend separates series. Which hue sits on which pattern is arbitrary and was settled by eye:
   no hue outranks another, and none of them maps onto good/bad.

   Tinted fill with hue-matched ink, not a solid fill, on purpose: the D-code bars sit on the same
   row and must keep the loudest colour, so severity still reads first and the pattern second.
   Measured 7.69–9.41:1 light and 7.89–8.60:1 dark, so every pair clears AA without ContrastInk
   having to rescue it. See ReviewQueueText.PatternClass for the vocabulary. */
.yb-rq-pattern {
    display: inline-block;
    margin: 0 0.3rem 0.2rem 0;
    padding: 0.1rem 0.5rem;
    border-radius: var(--yb-radius-sm);
    background: var(--yb-brand-600);
    border: 1px solid var(--yb-brand-600);
    color: #fff;
    font-size: 0.76rem;
    /* 500, not 600: the severity band beside it carries the weight. A row holding three D-codes
       and a pattern was four things shouting; the pattern is the quieter label of the two. */
    font-weight: 500;
    white-space: nowrap;
}

html[data-theme="dark"] .yb-rq-pattern {
    background: var(--yb-brand-500);
    border-color: var(--yb-brand-500);
}

/* The five categorical hues. A pattern with no modifier (none / no_baseline) keeps the brand chip
   above: the absence of a classification is not a sixth kind of one. */
.yb-rq-pattern--gradual-worsening {
    background: #efd6e3;
    border-color: #efd6e3;
    color: #5a2e48;
}

.yb-rq-pattern--sustained {
    background: #dcd2f0;
    border-color: #dcd2f0;
    color: #3f2c6b;
}

.yb-rq-pattern--repeated-short {
    background: #cfe0fa;
    border-color: #cfe0fa;
    color: #0b2f73;
}

.yb-rq-pattern--recovery {
    background: #c9e6ea;
    border-color: #c9e6ea;
    color: #154852;
}

.yb-rq-pattern--one-time {
    background: #dbe1e7;
    border-color: #dbe1e7;
    color: #333e49;
}

html[data-theme="dark"] .yb-rq-pattern--gradual-worsening {
    background: #3a2130;
    border-color: #3a2130;
    color: #e3b4cc;
}

html[data-theme="dark"] .yb-rq-pattern--sustained {
    background: #2e2545;
    border-color: #2e2545;
    color: #c9b8ee;
}

html[data-theme="dark"] .yb-rq-pattern--repeated-short {
    background: #16294a;
    border-color: #16294a;
    color: #a9c8f5;
}

html[data-theme="dark"] .yb-rq-pattern--recovery {
    background: #14313a;
    border-color: #14313a;
    color: #9fd4dd;
}

html[data-theme="dark"] .yb-rq-pattern--one-time {
    background: #242b33;
    border-color: #242b33;
    color: #bfcad6;
}

/* The C4 pattern line on a student's own page (#389). A quiet note, not a callout: it frames the
   episode grid under it, and a banner treatment would make one sentence shout over the evidence
   it is meant to introduce. Wraps rather than truncates — the "why" clause is the part that keeps
   the label honest, so it must never be the part that gets cut. */
.yb-c4-pattern {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem 0.55rem;
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--yb-border);
    border-left: 3px solid var(--yb-brand-600);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    font-size: 0.86rem;
    line-height: 1.45;
}

html[data-theme="dark"] .yb-c4-pattern {
    border-left-color: var(--yb-brand-400);
}

/* The left COLUMN: the chip and its sentence, then the closure note under them. It takes the width
   the measurements on the right do not, so the prose fills the card instead of stopping at a
   measure and leaving a third of it blank. */
.yb-c4-pattern__main {
    flex: 1 1 22rem;
    min-width: 0; /* or a long unbroken sentence would refuse to shrink and overflow the card */
}

/* The sentence that keeps the label honest — it must never be the part that gets cut. The chip
   sits INSIDE it, so the two read as one line and wrap together. */
.yb-c4-pattern__why {
    margin: 0;
    color: var(--yb-text);
}

/* ⚠ The detail container centres its children, so this block's prose came out centred — ragged on
   BOTH sides, in a narrow column inside a wide card. Same inheritance that had to be undone for
   .yb-c5; the pattern line never got it. Evidence reads from a left edge. */
.yb-c4-pattern { text-align: left; }

/* How long the episodes ran, as figures on the RIGHT COLUMN of the block rather than the tail of
   the sentence. flex-shrink 0 so they keep their own column instead of being squeezed, and no
   auto margin games — the left column growing is what pushes them right. */
.yb-c4-lengths {
    display: flex;
    flex: 0 0 auto;
    gap: 1.1rem;
    margin: 0;
    padding-left: 1.1rem;
    border-left: 1px solid var(--yb-border);
}

/* A closed case, on the student's own page (#355). Quiet: it qualifies the pattern above it, and
   a callout treatment would make the closure shout over the episodes it is a note about.

   ⚠ It is a block INSIDE the left column now, not a flex item of the card. As a flex item it had
   to fight for its own row — and `flex-basis: 100%` did not win it, because a max-width clamps a
   flex item's hypothetical main size. Worse, the row it did win pushed the measurements out of
   their column. Nesting settles both. */
.yb-c4-pattern__closure {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: var(--yb-text-muted);
}

/* C9's workload tiles (#389): four counts above the queue they summarise.

   ⚠ Counts, never a verdict — same rule as the pattern chip. No tile is coloured by how bad its
   number is, because "3" awaiting review is a workload, not a judgement about a school. The only
   colour here is the brand rule on the left of each tile. */
.yb-rq-workload {
    /* Top space separates the panel from the As Of control above it: without it the heading sat
       tight under the date picker and read as part of the filter row. */
    margin: 1.1rem 0 1.25rem;
}

.yb-rq-workload__title {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--yb-text);
}

/* auto-fit rather than four fixed columns: at 390px these stack to one, and at tablet widths they
   fall to two without a breakpoint of their own. */
.yb-rq-workload__tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.yb-rq-workload__tile {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--yb-border);
    border-left: 3px solid var(--yb-brand-600);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
}

.yb-rq-workload__label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--yb-text-muted);
}

.yb-rq-workload__value {
    margin: 0.1rem 0 0.25rem;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--yb-text);
    font-variant-numeric: tabular-nums;
}

.yb-rq-workload__meaning {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--yb-text-muted);
}

/* Full width, deliberately: a measure-capped paragraph under full-width tiles left a third of the
   card blank and read as a layout fault rather than as a reading aid. */
.yb-rq-workload__note,
.yb-rq-workload__clear {
    margin: 0.6rem 0 0;
}

html[data-theme="dark"] .yb-rq-workload__tile {
    border-left-color: var(--yb-brand-500);
}

.yb-c4-lengths__pair dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--yb-text-muted);
}

.yb-c4-lengths__pair dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--yb-text);
    font-variant-numeric: tabular-nums;
}

/* A deviation code in its CONFIGURED colour (SERV0008, via StressColorProvider) — the same colour
   that code wears on Student Analytics and the KPI dashboard, because a D3 must not be one colour
   here and another there. The colour is a SECOND channel only: the count and the code are always
   written out, so the cell reads correctly in greyscale and to a screen reader (which gets the
   whole cell as one string via aria-label).

   Colour belongs on the code, which is the platform's own severity vocabulary — and NOT on the
   pattern chip, where red would turn a count into a verdict. */
/* C5: where, when and with whom (#389, TrilokAPI #380). Three quiet columns under the pattern
   line, not cards: this is evidence that supports the sentence above it, and boxing it would give
   it more weight than the finding it explains. Each row is what / how many / how that compares
   with the student's own usual — the comparison is the part that must never be cut, so it wraps
   onto its own line rather than truncating. */
.yb-c5 {
    margin: 0 0 0.9rem;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    /* The detail container centres its children; lists of evidence must read from a left edge or
       every row starts in a different place and the eye cannot scan the counts. */
    text-align: left;
}

/* The disclosure header. Same geometry and the same tokens as the sensing lane's head directly
   above it (.yb-sense__head) — two disclosures on one screen that look different read as two
   different kinds of thing. */
.yb-c5__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
}

/* Title, count and codes wrap together as one block; the toggle sits outside it. */
.yb-c5__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.5rem;
    min-width: 0;
}

.yb-c5__head > i { color: var(--yb-accent-text); }

.yb-c5__head-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--yb-text);
}

/* The count survives the fold: it is what tells a reader whether opening this is worth it. */
.yb-c5__head-summary {
    font-size: 0.82rem;
    color: var(--yb-text-muted);
}

/* The deviation codes, in the colours SERV0008 configures. Same severity vocabulary as the
   Deviation column on the grid below — filled, so the eye ties the two together — but the ink is
   measured against the fill rather than assumed white (see ReviewQueueText.ReadableInk).

   A rounded RECT, not a 999px pill: a pill reads as a status badge, and this is a measurement. */
.yb-c5__codes {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* The person header's actions. They were Bootstrap BADGES worn by buttons — status styling on an
   action, off the brand ramp and with no focus ring of their own. Same quiet affordance as the
   disclosure toggle beside them, so everything clickable in this header reads as one family. */
.yb-head-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    color: var(--yb-text);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}

.yb-head-action:hover {
    border-color: var(--yb-accent);
    background: var(--yb-surface-2);
    color: var(--yb-accent-text);
}

.yb-head-action:focus-visible {
    outline: 2px solid var(--yb-ring, var(--yb-accent));
    outline-offset: 2px;
}

/* One primary among them: adding a session is the action that changes something. */
.yb-head-action--primary {
    border-color: var(--yb-success);
    background: var(--yb-success);
    color: #fff;
}

.yb-head-action--primary:hover {
    border-color: var(--yb-success);
    background: var(--yb-success);
    color: #fff;
    filter: brightness(0.95);
}

/* The "more" affordance inside a grid cell: it was a <span role="button"> reading "...". */
.yb-chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.4rem;
    padding: 0 0.3rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    color: var(--yb-text-muted);
    cursor: pointer;
}

.yb-chip-btn:hover {
    border-color: var(--yb-accent);
    background: var(--yb-surface-2);
    color: var(--yb-accent-text);
}

.yb-chip-btn:focus-visible {
    outline: 2px solid var(--yb-ring, var(--yb-accent));
    outline-offset: 2px;
}

.yb-c5__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--yb-radius-sm);
    background: transparent;
    color: var(--yb-text-muted);
    font-size: 0.78rem;
    cursor: pointer;
}

.yb-c5__toggle:hover {
    border-color: var(--yb-border);
    background: var(--yb-surface-2);
    color: var(--yb-text);
}

.yb-c5__toggle:focus-visible {
    outline: 2px solid var(--yb-ring, var(--yb-accent));
    outline-offset: 2px;
}

.yb-c5__toggle i { transition: transform var(--yb-dur, 0.15s) var(--yb-ease, ease); }
.yb-c5__toggle.is-open i { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
    .yb-c5__toggle i { transition: none; }
}

.yb-c5__panel {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--yb-border);
}

.yb-c5__lede {
    margin: 0 0 0.6rem;
    font-size: 0.86rem;
    color: var(--yb-text);
}

.yb-c5__cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.9rem 1.4rem;
}

.yb-c5__title {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--yb-text-muted);
}

.yb-c5__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Words, count and bar on one line; the comparison sentence beneath on its own.

   ⚠ Tried as a grid so the bars would line up in a column — but the sentence spans all three tracks
   and its width is distributed back into them, which stretched the row and opened a canyon between
   each row's words and its own bar. Adjacency beats alignment here: 1-4 rows per column is not a
   list anyone scans vertically. */
.yb-c5__list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.84rem;
    line-height: 1.4;
}

.yb-c5__what {
    font-weight: 600;
    color: var(--yb-text);
}

/* What a row's D2+ episodes were (TrilokAPI #382): the shared deviation chips, on their own line under
   the comparison, a size down from the head's so the row's sentence still leads. */
.yb-c5__row-codes {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.yb-c5__row-codes .yb-dev--chip .yb-ref__trigger.yb-dev {
    padding: 0.05rem 0.4rem;
    font-size: 0.72rem;
}

.yb-c5__count {
    color: var(--yb-text);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* The comparison, drawn. The fill is this row's share of the student's D2+ episodes; the tick is
   where their OWN usual share sits. Fill short of the tick, level with it, or past it — that is the
   whole point of the panel, and it lands before the sentence is read.

   Brand ink, never a deviation colour: these rows are proportions, not severities, and a red bar
   would read as a verdict on a place or a person. */
.yb-c5__meter {
    position: relative;
    flex: 0 0 4.5rem;
    align-self: center;
    height: 6px;
    border-radius: 3px;
    background: var(--yb-surface);
    box-shadow: inset 0 0 0 1px var(--yb-border);
}

.yb-c5__meter::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--yb-c5-fill, 0%);
    border-radius: 3px;
    background: var(--yb-brand-500);
}

/* Their usual, as a mark standing off the track so it reads as a reference and not as more fill. */
.yb-c5__meter::after {
    content: "";
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: var(--yb-c5-norm, 0%);
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    background: var(--yb-text-muted);
}

html[data-theme="dark"] .yb-c5__meter::before { background: var(--yb-brand-400); }

/* The comparison with their own norm. Muted, and on its own line when space is short, because it
   qualifies the count rather than competing with it. */
.yb-c5__norm {
    flex: 1 1 100%;
    color: var(--yb-text-muted);
}

/* The student's name is the way into their own screen (#389 C2/C3), so it reads as the link it is. */
.yb-rq-student {
    color: var(--yb-brand-600);
    font-weight: 600;
    text-decoration: none;
}

html[data-theme="dark"] .yb-rq-student {
    color: var(--yb-brand-400);
}

.yb-rq-student:hover,
.yb-rq-student:focus-visible {
    text-decoration: underline;
}

.yb-rq-table td,
.yb-rq-table tbody th {
    white-space: normal;
}

.yb-rq-meanings {
    margin-top: 1.4rem;
    padding: 0.9rem 1rem;
    background: var(--yb-surface-2);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    font-size: 0.85rem;
    color: var(--yb-text);
}

.yb-rq-meanings__title {
    margin: 0 0 0.4rem;
    font-weight: 700;
}

.yb-rq-meanings ul {
    margin: 0 0 0.4rem;
    padding-left: 1.1rem;
}

.yb-rq-meanings li {
    margin-bottom: 0.25rem;
}

/* ── Safety response-time targets (ALRT0003, #356) ────────────────────────────
   The settings editor for the per-alert response promises. Built from the shared
   tokens so it sits inside a setting card like the other editors, and so dark
   mode comes from the token overrides rather than a second set of rules here. */

/* The setting card centres its content, and a table of labelled boxes read down a
   column must not be: the same inherited text-align that centred the C4 pattern
   line and C5. Set on the editor root so every part of it agrees. */
.yb-sla-editor {
    text-align: left;
}

.yb-sla-editor__lede {
    color: var(--yb-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.yb-sla-editor__note {
    color: var(--yb-text-muted);
    font-size: 0.8125rem;
    margin: 0.5rem 0 0;
}

/* A notice about THIS value, as opposed to the closing note, which is a definition
   and always there. Same ink, marked by a rule rather than by colour: nothing here
   is a warning, it is a statement about what saving will do. */
.yb-sla-editor__note--state {
    border-left: 2px solid var(--yb-border-strong);
    padding-left: 0.5rem;
}

.yb-sla-grid {
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    overflow: hidden;
}

.yb-sla-grid__head,
.yb-sla-grid__row {
    display: grid;
    grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr) minmax(9rem, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.yb-sla-grid__head {
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.yb-sla-grid__row + .yb-sla-grid__row,
.yb-sla-grid__head + .yb-sla-grid__row {
    border-top: 1px solid var(--yb-border);
}

.yb-sla-grid__alert {
    font-size: 0.875rem;
}

.yb-sla-grid__field {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.yb-sla-grid__input {
    max-width: 6rem;
    /* Tabular figures: the minute columns are read down, not across. */
    font-variant-numeric: tabular-nums;
}

.yb-sla-grid__unit {
    color: var(--yb-text-muted);
    font-size: 0.8125rem;
}

/* The column heading, repeated per field for the narrow layout where the header
   row is gone. aria-hidden, because each input already carries its own label —
   announcing both would say everything twice. */
.yb-sla-grid__inline-label {
    display: none;
    color: var(--yb-text-muted);
    font-size: 0.8125rem;
    min-width: 7.5rem;
}

/* One column per line below the settings card's own breakpoint: three columns of
   number boxes do not survive a phone, and the alert name is the row's subject. */
@media (max-width: 640px) {
    .yb-sla-grid__head {
        display: none;
    }

    .yb-sla-grid__row {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    .yb-sla-grid__alert {
        font-weight: 600;
    }

    /* The label goes ABOVE its box here rather than beside it. Measured at 390: a
       label, a box and "minutes" on one line leave the box 63px, which clips its
       own "No target" placeholder to "No ta". */
    .yb-sla-grid__field {
        flex-wrap: wrap;
    }

    .yb-sla-grid__inline-label {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .yb-sla-grid__input {
        max-width: 8rem;
    }
}

/* ── Governance → Alert Approval Records (/governance/alert-approval-records, #396) ──
   Rides the break-glass ledger's card (.yb-bge-event: surface, border, left rule in --sev).
   One loud element per card: the span rail, raised → cleared, with the total set large in the
   display face. Everything else is quiet chips. Text colours are TEXT tokens; --yb-success and
   --yb-warning are fills, too light for small text, so they tint and colour icons, never words. */
.yb-aar-event--open    { --sev: var(--yb-info-rgb); }
.yb-aar-event--cleared { --sev: var(--yb-success-rgb); }
.yb-aar-event--legacy  { --sev: var(--yb-accent-rgb); }

/* Head: the alert (a link), its date, and the state chip pushed right. */
.yb-aar-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}

.yb-aar-alert {
    font-family: var(--yb-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--yb-accent-text);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.yb-aar-alert:hover,
.yb-aar-alert:focus-visible { text-decoration: underline; }

.yb-aar-alert i {
    font-size: 0.7em;
    margin-left: 0.3rem;
    vertical-align: 0.1em;
}

.yb-aar-date {
    font-size: 0.85rem;
    color: var(--yb-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Chips: small rounded rectangles, never pills (a 9px radius already reads as an oval at this
   height), sentence case, icon first. */
.yb-aar-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--yb-text-muted);
    white-space: nowrap;
}

.yb-aar-chip i { color: var(--yb-text-soft); }

.yb-aar-state {
    margin-left: auto;
    align-self: center;
    background: rgba(var(--sev), 0.12);
    border-color: rgba(var(--sev), 0.38);
    color: var(--yb-text);
}

.yb-aar-state i { color: rgb(var(--sev)); }
.yb-aar-event--open .yb-aar-state { color: var(--yb-info-text); }

.yb-aar-chip--good {
    background: rgba(var(--yb-success-rgb), 0.10);
    border-color: rgba(var(--yb-success-rgb), 0.35);
    color: var(--yb-text);
}

.yb-aar-chip--good i { color: rgb(var(--yb-success-rgb)); }

.yb-aar-chip--warn {
    background: rgba(var(--yb-warning-rgb), 0.14);
    border-color: rgba(var(--yb-warning-rgb), 0.45);
    color: var(--yb-text);
}

.yb-aar-chip--warn i { color: rgb(var(--yb-warning-rgb)); }

/* The span rail: raised clock | line with the total riding it | cleared clock. */
.yb-aar-span {
    display: grid;
    /* Capped: stretched across a wide card the rail is mostly empty line, and every alert —
       55 s or 12 min — drew the same length anyway. */
    grid-template-columns: auto minmax(7rem, 22rem) auto;
    justify-content: start;
    align-items: center;
    column-gap: 0.85rem;
    margin: 0.85rem 0 0.9rem;
}

.yb-aar-span__end {
    display: flex;
    flex-direction: column;
    min-width: 3.2rem;
}

.yb-aar-span__end--last { align-items: flex-end; }

.yb-aar-span__clock {
    font-family: var(--yb-font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--yb-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.yb-aar-span__cap {
    font-size: 0.75rem;
    color: var(--yb-text-muted);
}

.yb-aar-span__rail {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.6rem;
    /* A filled dot at each end; the open card's far end is hollow (below). */
    background:
        radial-gradient(circle, rgb(var(--sev)) 0 3.5px, transparent 4px) left center / 10px 10px no-repeat,
        radial-gradient(circle, rgb(var(--sev)) 0 3.5px, transparent 4px) right center / 10px 10px no-repeat;
}

.yb-aar-span__rail::before {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    top: 50%;
    border-top: 2px solid rgba(var(--sev), 0.5);
}

.yb-aar-event--open .yb-aar-span__rail {
    background:
        radial-gradient(circle, rgb(var(--sev)) 0 3.5px, transparent 4px) left center / 10px 10px no-repeat,
        radial-gradient(circle, transparent 0 2.5px, rgb(var(--sev)) 3px 4px, transparent 4.5px) right center / 10px 10px no-repeat;
}

.yb-aar-event--open .yb-aar-span__rail::before { border-top-style: dashed; }

.yb-aar-total,
.yb-aar-span__open {
    position: relative; /* sit on the line, masking it */
    padding: 0 0.75rem;
    background: var(--yb-card);
}

.yb-aar-total {
    font-family: var(--yb-font-display);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--yb-text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.yb-aar-span__open {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--yb-info-text);
}

.yb-aar-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* The running summary: the record's own words, kept, but quiet — the chips already said it. */
.yb-aar-attended {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0.7rem 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--yb-text);
    overflow-wrap: anywhere;
}

.yb-aar-attended .bi {
    flex: none;
    color: var(--yb-text-muted);
}

.yb-aar-summary {
    margin: 0.8rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--yb-border);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--yb-text-muted);
}

@media (max-width: 560px) {
    .yb-aar-total { font-size: 1.35rem; padding: 0 0.5rem; }
    .yb-aar-span { column-gap: 0.6rem; }
}


/* ── Shared info cards: YbLocation, YbClassSpocs, YbDeviation (TrilokWeb #432) ──────────────────
   Every dashboard shows a location, a class and a deviation code the same way: the code, and a card
   saying what it is. One look everywhere, so the class names are generic (.yb-ref*) and no page
   styles its own variant.

   Each component renders its card in place as a hidden SOURCE (.yb-ref__card — what
   aria-describedby reads). js/yb-ref-card.js copies it into one .yb-ref-float on <body> and places
   that next to the trigger: a card inside a transformed or clipped ancestor (the Safety Alerts
   timeline's step cards) could otherwise neither be placed nor escape the clip. It opens on hover,
   keyboard focus or a tap, and Escape closes it. Tokens only, so dark mode follows the overrides. */
.yb-ref {
    position: relative;
    display: inline;
}

.yb-ref__trigger {
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: inherit;
    cursor: help;
    text-decoration: underline dotted;
    text-decoration-color: var(--yb-border-strong);
    text-underline-offset: 3px;
}

.yb-ref__trigger:focus-visible {
    outline: none;
    border-radius: var(--yb-radius-sm);
    box-shadow: var(--yb-ring);
}

/* The in-place source: never shown itself. */
.yb-ref__card {
    display: none;
}

.yb-ref-float {
    display: none;
    position: fixed;
    z-index: 10000;
    min-width: 12rem;
    max-width: min(20rem, calc(100vw - 16px));
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius);
    background: var(--yb-surface);
    box-shadow: var(--yb-shadow-md);
    color: var(--yb-text);
    font-family: var(--yb-font-body);
    font-size: 0.8125rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.4;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    white-space: normal;
}

.yb-ref-float.is-shown {
    display: block;
}

.yb-ref__title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.yb-ref__rows,
.yb-ref__groups {
    display: grid;
    gap: 0.2rem;
}

.yb-ref__row {
    display: grid;
    grid-template-columns: 5.25rem 1fr;
    gap: 0.5rem;
}

.yb-ref__key {
    color: var(--yb-text-muted);
}

.yb-ref__val.is-empty {
    color: var(--yb-text-muted);
    font-style: italic;
}

.yb-ref__group + .yb-ref__group {
    margin-top: 0.2rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--yb-border);
}

.yb-ref__group-head,
.yb-ref__text,
.yb-ref__note {
    display: block;
}

.yb-ref__group-head {
    font-weight: 600;
}

.yb-ref__note {
    margin-top: 0.3rem;
    color: var(--yb-text-muted);
}

.yb-ref-none {
    color: var(--yb-text-muted);
}

/* A deviation code: the school's colour as the fill (inline, SERV0008) with a measured ink. A
   rounded rectangle, never a pill. With no colour yet — or nothing to count — it is a plain chip. */
.yb-ref__trigger.yb-dev {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    min-width: 1.9rem;
    padding: 0.08rem 0.4rem;
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    color: var(--yb-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    text-decoration: none;
}

.yb-ref__trigger.yb-dev.is-zero {
    background: transparent;
    color: var(--yb-text-muted);
    font-weight: 400;
}

.yb-dev--chip .yb-ref__trigger.yb-dev {
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
}

.yb-dev--chip .yb-ref__trigger.yb-dev.is-zero {
    border: 1px dashed var(--yb-border-strong);
}

.yb-dev--chip .yb-dev__label {
    font-weight: 500;
}

/* A column head: the band's label over its lower edge ("D2 / > 25%"). */
.yb-dev--head .yb-ref__trigger.yb-dev {
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.yb-dev__range {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0;
    opacity: 0.9;
    white-space: nowrap;
}

.yb-dev__swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px var(--yb-border);
}

/* ── Management Overview (#437): the governance links card ─────────────────────────────────── */
.yb-mo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

.yb-mo-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-card);
    color: var(--yb-accent-text);
    text-decoration: none;
    transition: border-color var(--yb-dur) var(--yb-ease), box-shadow var(--yb-dur) var(--yb-ease);
}

.yb-mo-links a:hover,
.yb-mo-links a:focus-visible {
    border-color: var(--yb-border-strong);
    box-shadow: var(--yb-shadow-xs);
}

/* The Management Overview's "the period before" lines (#438): quieter than the figure they follow. */
.yb-ops-tile__foot.yb-mo-before {
    color: var(--yb-text-soft);
    font-style: italic;
}

/* The Management Overview's security-log counts (#443): one pill per kind and outcome, so the
   counts never run together into one line. */
.yb-mo-security {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.6rem;
    padding: 0;
    list-style: none;
}

.yb-mo-security li {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-pill);
    background: var(--yb-surface-2);
    color: var(--yb-text-muted);
    font-size: 0.85rem;
}

.yb-mo-security__count {
    color: var(--yb-text);
    font-weight: 600;
}

/* ── Management Overview look and feel (after the School Overview and the Review Queue) ──────────
   One loud element: the opening lede, in the display face, ruled in the brand ink rather than the
   School Overview's amber — management's opening line reports, it does not raise an alarm. Every
   tile then takes the Review Queue's brand rule so the same counsellor figures look the same on
   both pages, and the strips span the row so their right edge meets the tables under them. */
/* ── C7: how long and how intense, before → after a first session (TrilokAPI #437) ─────────────
   One row of three measurements under the comparison's sentence, on the Review Queue, the Management
   Overview and the student's page alike. Plain ink: counts beside a judgement, never a verdict (D6);
   the only colour is the bands' own (SERV0008, through YbDeviation). */
/* Two named columns — "14 days before the session", "14 days after the session" — and one row per
   measure. Owner review: an arrow between two numbers did not say which was which. */
.yb-c7-cmp {
    width: auto;
    min-width: min(100%, 34rem);
    margin: 0.35rem 0 0.9rem;
    border-collapse: collapse;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.yb-c7-cmp th,
.yb-c7-cmp td {
    padding: 0.45rem 1.1rem 0.45rem 0;
    border-bottom: 1px solid var(--yb-border);
    vertical-align: middle;
}

.yb-c7-cmp thead th {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--yb-text-muted);
}

.yb-c7-cmp__side {
    min-width: 11rem;
}

/* The before column is the one read first: its head carries the rule that starts the comparison. */
.yb-c7-cmp thead th[data-side="before"],
.yb-c7-cmp thead th[data-side="after"] {
    padding-left: 0.75rem;
    border-bottom: 2px solid var(--yb-border-strong);
}

.yb-c7-cmp tbody td {
    padding-left: 0.75rem;
    font-weight: 600;
    color: var(--yb-text);
}

.yb-c7-cmp tbody td:nth-child(2) {
    background: var(--yb-surface-2);
}

.yb-c7-cmp tbody th {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--yb-text-muted);
}

.yb-c7-cmp tbody tr:last-child th,
.yb-c7-cmp tbody tr:last-child td {
    border-bottom: 0;
}

/* One student's card: Before / After as two dated rows, measures across the full width. */
.yb-c7-cmp--compact {
    width: 100%;
    min-width: 40rem;
    margin: 0.2rem 0 0.6rem;
}

.yb-c7-cmp--compact thead th {
    padding-left: 0;
    border-bottom: 2px solid var(--yb-border-strong);
}

.yb-c7-cmp--compact tbody th {
    white-space: nowrap;
    padding-right: 1.5rem;
}

.yb-c7-cmp--compact tbody td {
    padding-left: 0;
}

/* The before row is shaded, as the before column is elsewhere, so the two layouts read alike. */
.yb-c7-cmp--compact tbody td:nth-child(2) {
    background: none;
}

.yb-c7-cmp--compact tr[data-side="before"] th,
.yb-c7-cmp--compact tr[data-side="before"] td {
    background: var(--yb-surface-2);
}

.yb-c7-cmp--compact tr[data-side="before"] th {
    padding-left: 0.5rem;
}

.yb-c7-cmp--compact tr[data-side="after"] th {
    padding-left: 0.5rem;
}

.yb-c7-cmp__side-name {
    font-weight: 700;
    color: var(--yb-text);
}

.yb-c7-cmp__when {
    font-size: 0.8rem;
    color: var(--yb-text-muted);
}

.yb-c7-cmp__bands {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.yb-c7-cmp__none {
    font-weight: 500;
    font-style: italic;
    color: var(--yb-text-muted);
}

.yb-c7-shape__note {
    margin: -0.4rem 0 0.8rem;
    font-size: 0.82rem;
    font-style: italic;
    color: var(--yb-text-muted);
    text-align: left;
}

/* Tables: each measure is a column group with Before / After under it. */
.yb-c7-table .yb-c7-group {
    text-align: center;
    border-bottom: 1px solid var(--yb-border);
}

.yb-c7-table .yb-c7-sides th {
    font-size: 0.72rem;
}

.yb-c7-table td.yb-c7-before {
    background: var(--yb-surface-2);
}

/* The student's card is a .yb-c5 disclosure (same frame, head and toggle as the one below it); it
   only sits a little clear of the pattern line above. */
.yb-c7 {
    margin-top: 0.75rem;
}

.yb-c7 .yb-c5__panel .yb-so-scroll {
    margin-top: 0.6rem;
}

/* Inside the disclosure's grey panel the usual before-row shading would vanish; there the before
   row is lifted to the card surface instead, so the two rows still read as two. */
.yb-c7 .yb-c7-cmp--compact tr[data-side="before"] th,
.yb-c7 .yb-c7-cmp--compact tr[data-side="before"] td {
    background: var(--yb-card);
}

/* "Outcome recorded: No change" as a badge (owner) — a rounded RECT, not a pill, in the Review
   Queue's outcome-chip style and colours: Improving green, No change blue, Deteriorating red (as the
   dashboard's outcome breakdown), closing outcomes the counsellor violet, "not recorded" dashed. */
.yb-c7-outcome {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.12rem 0.55rem;
    border: 1px solid var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-card);
    font-size: 0.8rem;
    line-height: 1.4;
}

.yb-c7-outcome__label {
    color: var(--yb-text-muted);
}

.yb-c7-outcome__value {
    font-weight: 600;
    color: var(--yb-text);
}

.yb-c7-outcome.is-closing {
    background: rgba(var(--yb-counselor-rgb), 0.12);
    border-color: rgba(var(--yb-counselor-rgb), 0.55);
}

.yb-c7-outcome.is-empty {
    border-style: dashed;
}

.yb-c7-outcome.is-improving {
    background: rgba(var(--yb-success-rgb), 0.12);
    border-color: rgba(var(--yb-success-rgb), 0.55);
}

.yb-c7-outcome.is-no-change {
    background: rgba(var(--yb-info-rgb), 0.12);
    border-color: rgba(var(--yb-info-rgb), 0.55);
}

.yb-c7-outcome.is-deteriorating {
    background: rgba(var(--yb-danger-rgb), 0.12);
    border-color: rgba(var(--yb-danger-rgb), 0.55);
}

.yb-c7__counts {
    font-variant-numeric: tabular-nums;
}

/* ── The briefing band: the Management Overview's one loud element ─────────────────────────────
   A board briefing, not a dashboard header: which school and which week, the two-line answer in the
   display face, and the four figures that answer management's question. Its own treatment per
   theme — a mild mist in light, graphite in dark — both echoing the sidebar's navy-to-aubergine, with
   a gradient bar across the top. Nothing green or red: every figure is a count (D6), and the
   arrows say direction only. Figures sit on hairline dividers, not in cards — the band is one object. */
.yb-mo-brief {
    /* Light: a report cover in a mild mist — pale slate-indigo drifting into a faint mauve at the right,
       the sidebar's own navy-to-aubergine at a tenth of its strength. The bar across the top is that
       gradient at full strength, like a letterhead. */
    --brief-bg: linear-gradient(118deg, #f5f6fc 0%, #eceff9 42%, #eee9f5 78%, #f3e9f2 100%);
    --brief-border: rgba(40, 24, 88, 0.11);
    --brief-bar: linear-gradient(90deg, #052767 0%, #2a1a6e 55%, #3a0647 100%);
    --brief-text: #1b1a3a;
    --brief-muted: #4f4d6b;
    --brief-soft: #75728f;
    --brief-rule: rgba(40, 24, 88, 0.12);
    --brief-accent: #553a85;
    --brief-spark: #6e5aa8;
    --brief-dots: rgba(58, 6, 71, 0.07);
    --brief-shadow: 0 1px 2px rgba(27, 26, 58, 0.05), 0 14px 34px rgba(42, 26, 110, 0.10);
    position: relative;
    margin: 0 0 1rem;
    padding: 1.6rem 1.75rem 1.3rem;
    border: 1px solid var(--brief-border);
    border-radius: var(--yb-radius-lg);
    background: var(--brief-bg);
    color: var(--brief-text);
    box-shadow: var(--brief-shadow);
    overflow: hidden;
    text-align: left;
}

/* Dark: graphite with a faint aubergine warmth, matching the charcoal sidebar rather than the blue of
   the light theme; a muted mauve bar and soft lilac accents. No blue anywhere in the dark band. */
html[data-theme="dark"] .yb-mo-brief {
    --brief-bg: linear-gradient(118deg, #26232e 0%, #1f1c26 45%, #211b27 75%, #251b2a 100%);
    --brief-border: rgba(203, 184, 230, 0.14);
    --brief-bar: linear-gradient(90deg, #6a5a8e 0%, #8a6b9c 55%, #a07496 100%);
    --brief-text: #f3f0f7;
    --brief-muted: rgba(225, 218, 236, 0.76);
    --brief-soft: rgba(225, 218, 236, 0.56);
    --brief-rule: rgba(203, 184, 230, 0.14);
    --brief-accent: #cbb8e6;
    --brief-spark: #b7a2d8;
    --brief-dots: rgba(203, 184, 230, 0.07);
    --brief-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* The letterhead bar: a pseudo-element, because a border cannot carry a gradient round a corner. */
.yb-mo-brief::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--brief-bar);
    pointer-events: none;
}

/* A fine dot grid, fading in from the right: texture for the cover, never behind the words. */
.yb-mo-brief::before {
    content: "";
    position: absolute;
    inset: 0 0 0 45%;
    background-image: radial-gradient(var(--brief-dots) 1.2px, transparent 1.3px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
    pointer-events: none;
}

.yb-mo-brief > * {
    position: relative;
}

.yb-mo-brief__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.25rem;
}

.yb-mo-brief__where {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.yb-mo-brief__org {
    font-size: 0.82rem;
    color: var(--brief-muted);
}

.yb-mo-brief__branch {
    font-family: var(--yb-font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brief-text);
}

.yb-mo-brief__when {
    margin: 0 0 0 auto;
    font-size: 0.85rem;
    color: var(--brief-muted);
    font-variant-numeric: tabular-nums;
}

/* The shared scope toggle keeps its own look on the light cover; on the dark one it is re-inked. */
.yb-mo-brief .yb-ops-scope {
    margin: 0;
}

html[data-theme="dark"] .yb-mo-brief .yb-ops-scope {
    border-color: var(--brief-rule);
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .yb-mo-brief .yb-ops-scope__opt {
    color: var(--brief-muted);
}

html[data-theme="dark"] .yb-mo-brief .yb-ops-scope__opt.is-on {
    background: var(--brief-text);
    color: #1f1c26;
}

.yb-mo-brief__lede {
    margin: 1.6rem 0 0;
    max-width: 58rem;
}

.yb-mo-brief .yb-mo-brief__sentence {
    margin: 0;
    font-size: clamp(1.7rem, 1.15rem + 1.5vw, 2.55rem);
    line-height: 1.15;
    color: var(--brief-text);
}

/* The comparison clause wraps as one piece (it still wraps inside itself on a phone). */
.yb-mo-brief__clause {
    display: inline-block;
}

.yb-mo-brief .yb-mo-brief__detail {
    margin: 0.6rem 0 0;
    max-width: 70ch;
    font-size: 1.02rem;
    line-height: 1.5;
    color: var(--brief-muted);
}

.yb-mo-vitals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 1rem 0;
    margin: 1.5rem 0 0;
    padding: 1.1rem 0 0;
    border-top: 1px solid var(--brief-rule);
}

.yb-mo-vital {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0 1.25rem;
    border-left: 1px solid var(--brief-rule);
}

.yb-mo-vital:first-child {
    padding-left: 0;
    border-left: 0;
}

.yb-mo-vital dd {
    margin: 0;
}

.yb-mo-vital__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brief-muted);
}

.yb-mo-vital__value {
    font-family: var(--yb-font-display);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--brief-text);
    font-variant-numeric: tabular-nums;
}

.yb-mo-vital__delta {
    font-size: 0.82rem;
    color: var(--brief-accent);
}

.yb-mo-vital__arrow {
    display: inline-block;
    min-width: 0.8em;
    font-weight: 700;
}

.yb-mo-vital__note {
    font-size: 0.78rem;
    color: var(--brief-soft);
}

/* The alerts figure's own days (or weeks), drawn from the same counts as the chart below it. */
.yb-mo-vital__spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 1.75rem;
    max-width: 11rem;
    margin-top: 0.35rem !important;
}

.yb-mo-vital__spark span {
    flex: 1 1 0;
    min-width: 4px;
    border-radius: 2px 2px 0 0;
    background: var(--brief-spark);
    opacity: 0.65;
}

@media (max-width: 640px) {
    .yb-mo-brief { padding: 1.1rem 1rem 1rem; }
    .yb-mo-brief__when { margin-left: 0; width: 100%; }
    .yb-mo-vital { padding: 0; border-left: 0; }
}

/* ── The chapter bar: the page's four sections, and the one count that says whether to go there ──
   Not sticky: the layout's content card (.e-card.full-height-card) is overflow-y:auto but grows with
   the page rather than scrolling, which pins a sticky child to a box that never moves. Changing that
   shared card for one bar is not worth its reach; the bar is the page's table of contents instead. */
.yb-mo-chapters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 1.25rem;
    padding: 0.3rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    box-shadow: var(--yb-shadow-xs);
}

.yb-mo-chapter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--yb-text);
    font-family: var(--yb-font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--yb-dur) var(--yb-ease);
}

.yb-mo-chapter:hover {
    background: var(--yb-surface-2);
}

.yb-mo-chapter:focus-visible {
    outline: none;
    box-shadow: var(--yb-ring);
}

.yb-mo-chapter__count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--yb-text-muted);
    font-variant-numeric: tabular-nums;
}

/* A section heading lands with a little air above it, not flush against the window's edge. */
.yb-mo .yb-ops-section__title {
    scroll-margin-top: 1rem;
}

/* Each section opens with the question it answers — in the display face, quieter than its title. */
.yb-mo-question {
    margin: -0.35rem 0 0.95rem;
    max-width: 70ch;
    font-family: var(--yb-font-display);
    font-style: italic;
    font-size: 1rem;
    color: var(--yb-text-muted);
    text-align: left;
}

.yb-mo .yb-ops-strip {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

/* The Review Queue's small radius too: on the page's larger radius the 3px rule curled into a
   bracket instead of reading as a straight edge. */
.yb-mo .yb-ops-tile {
    border-left: 3px solid var(--yb-brand-600);
    border-radius: var(--yb-radius-sm);
}

html[data-theme="dark"] .yb-mo .yb-ops-tile {
    border-left-color: var(--yb-brand-500);
}

/* The one tile allowed to alarm keeps its red rule (overdue access reviews, nobody attended). */
.yb-mo .yb-ops-tile.is-emphasis,
html[data-theme="dark"] .yb-mo .yb-ops-tile.is-emphasis {
    border-left-color: var(--yb-danger);
}

/* A section's parts after its headline figures sit in ruled sub-panels, so four blocks of equal
   weight read as one figure row and its supporting detail. */
.yb-mo-sub {
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--yb-border);
    text-align: left;
}

.yb-mo-sub > .yb-rq-workload {
    margin-top: 0;
}

/* ── A zone always carries its colour (TrilokWeb #435) ────────────────────────
   Zones are named by colour (the Zone lookup has no colour field), so the location card shows the
   zone as that colour: a swatch beside the name, on a wash of it. Same values as the Safety Alerts
   zone rails (--sa-red/green/blue), redeclared here because the card is copied onto <body>, outside
   the .sa-* scopes those tokens live in. A name that is not a colour gets a neutral swatch. */
:root {
    --yb-zone-red: #e5484d;
    --yb-zone-green: #15916b;
    --yb-zone-blue: #2f72e0;
    --yb-zone-amber: #c27c0e;
    --yb-zone-other: #7a879c;
}

[data-theme="dark"] {
    --yb-zone-red: #ff6369;
    --yb-zone-green: #4cc79a;
    --yb-zone-blue: #6ba5f5;
    --yb-zone-amber: #f0b44c;
    --yb-zone-other: #94a3b8;
}

.yb-zone { --yb-zone: var(--yb-zone-other); }
.yb-zone--red { --yb-zone: var(--yb-zone-red); }
.yb-zone--green { --yb-zone: var(--yb-zone-green); }
.yb-zone--blue { --yb-zone: var(--yb-zone-blue); }
.yb-zone--amber { --yb-zone: var(--yb-zone-amber); }

.yb-ref__val.yb-zone {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-self: start;
    padding: 0.02rem 0.45rem 0.02rem 0.3rem;
    border: 1px solid color-mix(in srgb, var(--yb-zone) 45%, transparent);
    border-radius: var(--yb-radius-sm);
    background: color-mix(in srgb, var(--yb-zone) 14%, transparent);
    font-weight: 600;
}

.yb-zone__swatch {
    flex: none;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    background: var(--yb-zone);
}

/* ── The known-condition mark (TrilokAPI #359, ADR 0001 D6) ─────────────────────────────────
   THAT a student's pattern is accounted for — never what the condition is. Deliberately quiet:
   brand ink and a bookmark, no severity colour. It is context for the reader, not a finding, and
   the student stays in review with it shown. */
.yb-kc {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.35rem;
}

.yb-kc__state,
.yb-kc-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.5rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-2);
    color: var(--yb-text);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.yb-kc__state.is-active,
.yb-kc-flag {
    border-color: color-mix(in srgb, var(--yb-accent) 40%, transparent);
    background: color-mix(in srgb, var(--yb-accent) 9%, transparent);
}

.yb-kc__state.is-active > i,
.yb-kc-flag > i {
    color: var(--yb-accent-text);
}

.yb-kc__state.is-ended {
    color: var(--yb-text-muted);
    font-weight: 500;
}

/* The student's own critical safety alerts, as a count (TrilokAPI #401). An outlined chip in the
   danger ink — a safety fact the counsellor should know, not a wellbeing band, so it wears none of
   the deviation colours. */
.yb-crit-alerts {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--yb-danger) 45%, transparent);
    border-radius: var(--yb-radius-sm);
    background: color-mix(in srgb, var(--yb-danger) 7%, transparent);
    color: var(--yb-text);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.yb-crit-alerts > i {
    color: var(--yb-danger-text);
}

.yb-crit-alerts--queue {
    display: flex;
    width: fit-content;
    margin-top: 0.2rem;
    font-size: 0.7rem;
}

/* On the queue row it sits under the student id, on a line of its own. */
.yb-kc-flag {
    display: flex;
    margin-top: 0.2rem;
    font-size: 0.7rem;
    width: fit-content;
}

.yb-kc__explain {
    margin: 0;
    color: var(--yb-text-muted);
    font-size: 0.86rem;
}

/* A principal's mark, for the counsellor to review (owner ruling 2026-09-30). A note, not a
   warning: the mark is sound, it just is not the counsellor's own yet. */
.yb-kc__review {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.5rem;
    border: 1px dashed var(--yb-border-strong);
    border-radius: var(--yb-radius-sm);
    color: var(--yb-text);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.yb-kc__review > i {
    color: var(--yb-text-muted);
}

/* On the queue row it sits under the known-condition flag, on a line of its own. */
.yb-kc__review--queue {
    display: flex;
    width: fit-content;
    margin-top: 0.2rem;
    font-size: 0.68rem;
}

/* The principal's reasons: a fixed list, one per line, chosen like the rest of the dialogs' cards. */
.yb-kc-choices {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-radius: var(--yb-radius-sm);
}

.yb-kc-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface);
    color: var(--yb-text);
    font-size: 0.88rem;
    cursor: pointer;
}

.yb-kc-choice input {
    accent-color: var(--yb-accent);
}

.yb-kc-choice.is-active {
    border-color: var(--yb-accent);
    background: color-mix(in srgb, var(--yb-accent) 9%, transparent);
}

.yb-kc-choice:focus-within {
    box-shadow: var(--yb-ring);
}

.yb-kc-choices.yb-field-invalid .yb-kc-choice {
    border-color: var(--yb-danger);
}

.yb-kc-switch {
    align-self: flex-start;
    padding: 0;
    font-size: 0.84rem;
}

/* What the principal did — never what the student's record now is. */
.yb-kc-done {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--yb-text);
    font-size: 0.92rem;
}

.yb-kc-trigger {
    gap: 0.3rem;
}

.yb-kc-done > i {
    color: var(--yb-success);
}

/* ── Search grids: load the next server page (#466) ──────────────────────────────────────────────
   The foot of a server-paginated search grid: "Showing 100 of 240 students" and the button that
   appends the next page. Tokens only, so dark mode follows the token overrides. */
.yb-load-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.875rem;
    margin-top: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px dashed var(--yb-border);
    border-radius: var(--yb-radius-sm);
    background: var(--yb-surface-sunken);
}

.yb-load-more__count {
    color: var(--yb-text-muted);
    font-size: 0.875rem;
}

.yb-load-more__error {
    flex-basis: 100%;
    margin: 0;
    text-align: center;
    color: var(--yb-danger-text);
    font-size: 0.875rem;
}

.yb-load-more__spin {
    display: inline-block;
    animation: yb-load-more-spin 0.9s linear infinite;
}

@keyframes yb-load-more-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .yb-load-more__spin { animation: none; }
}

/* ── Governance → Counselling Record History (/governance/counselling-amendments, #300) ──
   Rides the break-glass ledger's card (.yb-bge-event: surface, border, left rule in --sev). The
   rule's colour says what kind of change it was; a deletion is the one loud card. Before → after
   pairs sit in a quiet list; the before side is struck through so the eye lands on the after.
   Text colours are TEXT tokens; the --sev fills only tint and rule. */
.yb-cra-event--record     { --sev: var(--yb-accent-rgb); }
.yb-cra-event--intimation { --sev: var(--yb-info-rgb); }
.yb-cra-event--delete     { --sev: var(--yb-danger-rgb); }

.yb-cra .yb-bge-event__head {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.yb-cra .yb-bge-event__when { margin-left: auto; }

/* Qualified with .yb-cra: governance-breakglass.css loads after this sheet and its
   .yb-bge-event__tag (same specificity) would paint the label in the --sev FILL, which is too
   light for 0.7rem text. The fill keeps the icon; the words take text tokens. */
.yb-cra .yb-cra-tag { color: var(--yb-text); }
.yb-cra .yb-cra-tag i { color: rgb(var(--sev)); }
.yb-cra .yb-cra-event--delete .yb-cra-tag { color: var(--yb-danger-text); }

/* The "since deleted" chip wears Alert approval records' chip (.yb-aar-chip, a rounded rectangle). */

.yb-cra-subject {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    font-size: 0.95rem;
}

.yb-cra-record {
    font-size: 0.8rem;
    color: var(--yb-text-soft);
    font-variant-numeric: tabular-nums;
}

.yb-cra-changes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.8rem 0 0;
    padding: 0.65rem 0.8rem;
    background: var(--yb-surface-2);
    border-radius: var(--yb-radius-sm);
}

.yb-cra-change {
    display: grid;
    grid-template-columns: minmax(7.5rem, 10rem) 1fr;
    gap: 0.75rem;
    align-items: baseline;
}

.yb-cra-change__field {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--yb-text-soft);
}

.yb-cra-change__values,
.yb-cra-change__withheld {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.yb-cra-change__before {
    color: var(--yb-text-muted);
    text-decoration: line-through;
    /* Neutral, not danger red: a red strike through the x-height tints the word and reads as an
       error, and a superseded value is not one. */
    text-decoration-color: var(--yb-text-soft);
}

.yb-cra-change__arrow {
    margin: 0 0.4rem;
    color: var(--yb-text-soft);
    font-size: 0.8rem;
}

.yb-cra-change__after {
    color: var(--yb-text);
    font-weight: 600;
}

.yb-cra-change__withheld {
    color: var(--yb-text-muted);
    font-style: italic;
}

/* Notes are prose: old above new, each its own short paragraph, capped near 75 characters a line so
   a long note stays readable on a wide screen. The old one is struck and muted; the new one leads. */
.yb-cra-change--long { align-items: start; }

.yb-cra-change--long .yb-cra-change__values {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 75ch;
}

.yb-cra-change--long .yb-cra-change__before,
.yb-cra-change--long .yb-cra-change__after {
    margin: 0;
    line-height: 1.5;
}

.yb-cra-change--long .yb-cra-change__after { font-weight: 500; }

.yb-cra-change__withheld i {
    margin-right: 0.3rem;
    font-style: normal;
    color: var(--yb-text-soft);
}

@media (max-width: 575.98px) {
    .yb-cra-change {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
}

/* An icon-only row action (the band's History): square, so it reads as a button and
   not a stray glyph. Doubled class, because ui-refinement.css loads after this sheet and
   its .yb-row-btn padding would otherwise win. The label lives in aria-label + tooltip. */
.yb-row-btn.yb-row-btn--icon { padding: 0.3rem 0.45rem; }

/* ── Band custody history (TrilokAPI #189 P4b) ─────────────────────────────
   A rail down the left: each holder is a node on it, newest at the top. The
   current holder's node is filled; a loan rides a dashed stretch of rail; the
   rail fades out where records begin, because nothing before that is known.
   Tokens only, so dark mode follows. */
.yb-custody-dialog__body { padding: 4px 2px 8px; }

.yb-custody { list-style: none; margin: 0; padding: 0; }

.yb-custody__row {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 0 0 16px 28px;
}

/* The rail: a stretch below each node, down to the next one. */
.yb-custody__row::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 16px;
    bottom: 0;
    border-left: 2px solid var(--yb-border-strong);
}

.yb-custody__row:last-child::before { display: none; }

.yb-custody__row--loan::before { border-left-style: dashed; border-left-color: var(--yb-indigo-text); }

/* Before records: the rail does not stop, it runs out. */
.yb-custody__row--before-records:last-child { padding-bottom: 28px; }

.yb-custody__row--before-records:last-child::before {
    display: block;
    border-left: 0;
    width: 2px;
    background: linear-gradient(var(--yb-border-strong), transparent);
}

.yb-custody__node {
    position: absolute;
    left: 1px;
    top: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--yb-border-strong);
    background: var(--yb-surface);
}

.yb-custody__row--now .yb-custody__node {
    border-color: var(--yb-accent-text);
    background: var(--yb-accent-text);
    box-shadow: 0 0 0 4px rgba(var(--yb-accent-rgb), 0.16);
}

.yb-custody__row--loan .yb-custody__node { border-color: var(--yb-indigo-text); }

.yb-custody__row--loan.yb-custody__row--now .yb-custody__node { background: var(--yb-indigo-text); }

.yb-custody__who {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    font-size: .92rem;
    color: var(--yb-text);
}

.yb-custody__when { font-size: .82rem; color: var(--yb-text); }

.yb-custody__meta { font-size: .76rem; color: var(--yb-text-muted); }

.yb-custody__tag {
    font-size: .72rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--yb-radius-sm);
}

.yb-custody__tag--now { color: var(--yb-accent-text); background: rgba(var(--yb-accent-rgb), 0.14); }

.yb-custody__tag--loan { color: var(--yb-indigo-text); background: rgba(var(--yb-indigo-rgb), 0.14); }
/* ── Returning bands on Wearable Allocations (TrilokAPI #189 P4d) ───────────────────────────────
   Header and filter reuse .kpi-section-head and .yb-seg; only the state tag, its outcome line
   and the reason field are new. Tags follow .yb-custody__tag: rounded rectangles, token colours,
   so dark mode comes from the token overrides. */
/* text-align: the page shell centres its text, which put the heading over the middle of its line. */
.yb-returning { margin-top: 2rem; text-align: left; }

.yb-returning__count {
    margin-left: .35rem;
    font-size: .72rem;
    font-weight: 600;
    opacity: .75;
}

.yb-returning__state {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--yb-radius-sm);
}

.yb-returning__state--waiting { color: var(--yb-indigo-text); background: rgba(var(--yb-indigo-rgb), 0.14); }

.yb-returning__state--quarantined { color: var(--yb-danger-text); background: rgba(var(--yb-danger-rgb), 0.12); }

.yb-returning__state--released { color: var(--yb-text-muted); background: var(--yb-surface-2); }

.yb-returning__outcome {
    display: block;
    margin-top: .2rem;
    font-size: .78rem;
    color: var(--yb-text-muted);
    white-space: normal;
}

.yb-returning__reason { margin-top: .75rem; text-align: left; }

/* Temp-wearable issue dialog: the guest fields' wrapper (TrilokWeb, typing-loss fix). It stays
   mounted for every holder kind so its text boxes never need a Value; display: contents keeps each
   field a direct flex item of .yb-tw-dialog__body, so the 14px gap still applies. Its own name, not
   .yb-tw-guest: that class belongs to temp-wearable.css (the detail dialog's guest facts, with
   margin and a dashed rule), and sharing it set display: contents on that list too (#490). */
.yb-tw-issue-guest { display: contents; }

.yb-tw-issue-guest[hidden] { display: none; }
