/* RAZUM shared UI kit: composable components above the Bootstrap foundation. */

/* Product-only bundle (never TV): viewport and nested scroll areas keep native scrolling. */
html, .app-shell, .app-shell * {
    scrollbar-width: thin;
    scrollbar-color: var(--rz-scrollbar-thumb) transparent;
}
html::-webkit-scrollbar, .app-shell::-webkit-scrollbar, .app-shell *::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track, .app-shell::-webkit-scrollbar-track, .app-shell *::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb, .app-shell::-webkit-scrollbar-thumb, .app-shell *::-webkit-scrollbar-thumb {
    border-radius: var(--rz-radius-sm); background: var(--rz-scrollbar-thumb);
}
html::-webkit-scrollbar-thumb:hover, .app-shell::-webkit-scrollbar-thumb:hover, .app-shell *::-webkit-scrollbar-thumb:hover { background: var(--rz-scrollbar-thumb-hover); }
html::-webkit-scrollbar-corner, .app-shell::-webkit-scrollbar-corner, .app-shell *::-webkit-scrollbar-corner { background: transparent; }
@media (forced-colors: active) {
    html, .app-shell, .app-shell * { scrollbar-color: auto; scrollbar-width: auto; }
    html::-webkit-scrollbar, .app-shell::-webkit-scrollbar, .app-shell *::-webkit-scrollbar { width: auto; height: auto; }
    html::-webkit-scrollbar-thumb, .app-shell::-webkit-scrollbar-thumb, .app-shell *::-webkit-scrollbar-thumb { background: CanvasText; }
}

/* Opt-in geometry for featured informational panels; never applied globally. */
.rz-panel--feature {
    border-radius: 24px 2px 24px 2px;
}

/* Media and avatars */
.rz-media { max-width: 100%; }
.rz-media[data-rz-image-state="loading"] {
    background-color: var(--rz-color-surface-strong);
    background-image: linear-gradient(110deg, transparent 25%, rgb(255 255 255 / 0.58) 42%, transparent 58%);
    background-position: 150% 0;
    background-size: 220% 100%;
    color: transparent;
    opacity: 0.62;
    filter: blur(3px);
    transition: opacity var(--rz-transition), filter var(--rz-transition);
    animation: rz-media-placeholder 1.35s linear infinite;
}
.rz-media[data-rz-image-state="loaded"],
.rz-media[data-rz-image-state="fallback"] {
    background-image: none;
    color: inherit;
    opacity: 1;
    filter: none;
    animation: none;
}
/* Small identity images must stay visually stable across navigation and table redraws. */
.rz-media[data-rz-kind="avatar"],
.rz-avatar.rz-media {
    background-image: none;
    color: inherit;
    opacity: 1;
    filter: none;
    animation: none;
    transition: none;
}
.rz-avatar { display: inline-block; flex: 0 0 auto; object-fit: cover; border-radius: 30%; }
.rz-avatar--xs { width: 36px; height: 36px; }
.rz-avatar--sm { width: 44px; height: 44px; }
.rz-avatar--md { width: 56px; height: 56px; }
.rz-avatar--lg { width: 96px; height: 96px; }
.rz-avatar--xl { width: 150px; height: 150px; }
@keyframes rz-media-placeholder { to { background-position: -150% 0; } }

/* Actions */
.rz-icon-button {
    display: inline-grid;
    width: var(--rz-control-height);
    height: var(--rz-control-height);
    flex: 0 0 var(--rz-control-height);
    place-items: center;
    padding: 0;
    border: 1px solid var(--rz-color-border);
    border-radius: var(--rz-radius-xs);
    background: var(--rz-color-surface);
    color: var(--rz-color-ink-soft);
    line-height: 1;
    transition: color var(--rz-transition-fast), background-color var(--rz-transition-fast), border-color var(--rz-transition-fast), transform var(--rz-transition-fast);
}
.rz-icon-button:hover:not(:disabled) { border-color: var(--rz-color-brand); background: var(--rz-color-brand-soft); color: var(--rz-color-brand); transform: translateY(-1px); }
.rz-icon-button:focus-visible { outline: 0; box-shadow: var(--rz-focus-ring); }
.rz-icon-button:disabled, .rz-icon-button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.rz-icon-button--danger:hover:not(:disabled) { border-color: var(--rz-color-danger); background: var(--rz-color-danger-soft); color: var(--rz-color-danger); }

/* Segmented radios: 2–3 options, compatible with existing LMS status markup. */
:is(.rz-segmented, .manage-status-switch) {
    --rz-segments: 2;
    --rz-selected: 0;
    position: relative;
    display: inline-grid;
    grid-template-columns: repeat(var(--rz-segments), minmax(0, 1fr));
    max-width: 100%;
    isolation: isolate;
    padding: var(--rz-space-1);
    border: 1px solid var(--rz-color-border);
    border-radius: var(--rz-radius-lg);
    background: var(--rz-color-surface-muted);
}
:is(.rz-segmented, .manage-status-switch):has(> label:nth-of-type(3)) { --rz-segments: 3; }
:is(.rz-segmented, .manage-status-switch):has(> input:checked + label:nth-of-type(2)) { --rz-selected: 1; }
:is(.rz-segmented, .manage-status-switch):has(> input:checked + label:nth-of-type(3)) { --rz-selected: 2; }
:is(.rz-segmented, .manage-status-switch)::before {
    content: "";
    position: absolute;
    inset: var(--rz-space-1) auto var(--rz-space-1) var(--rz-space-1);
    width: calc((100% - 2 * var(--rz-space-1)) / var(--rz-segments));
    border-radius: var(--rz-radius-md);
    background: var(--rz-color-surface);
    box-shadow: var(--rz-shadow-sm);
    transform: translateX(calc(var(--rz-selected) * 100%));
    transition: transform var(--rz-transition);
    opacity: 0;
    z-index: -1;
}
:is(.rz-segmented, .manage-status-switch):has(> input:checked)::before { opacity: 1; }
:is(.rz-segmented, .manage-status-switch) > form { display: none; }
:is(.rz-segmented, .manage-status-switch) > input { position: absolute; opacity: 0; pointer-events: none; }
:is(.rz-segmented, .manage-status-switch) > label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--rz-control-height);
    padding: var(--rz-space-1) var(--rz-space-3);
    margin: 0;
    border-radius: var(--rz-radius-md);
    color: var(--rz-color-text-muted);
    font-size: var(--rz-text-sm);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    min-width: 0;
    overflow-wrap: anywhere;
    transition: color var(--rz-transition-fast);
}
:is(.rz-segmented, .manage-status-switch) > input:checked + label { color: var(--rz-color-brand); }
:is(.rz-segmented, .manage-status-switch) > input:focus-visible + label { box-shadow: var(--rz-focus-ring); }
:is(.rz-segmented, .manage-status-switch) > input:disabled + label { opacity: .55; cursor: not-allowed; }
@media (max-width: 575.98px) {
    :is(.rz-segmented, .manage-status-switch) > label { padding-inline: var(--rz-space-1); font-size: var(--rz-text-xs); }
}
.rz-icon-button--forward { border-radius: var(--rz-radius-icon-action); background: var(--rz-color-surface-muted); color: var(--rz-color-brand); }
@media (prefers-reduced-motion: reduce) {
    :is(.rz-segmented, .manage-status-switch)::before,
    :is(.rz-segmented, .manage-status-switch) > label,
    .rz-icon-button { transition: none; }
}

/* Statuses and feedback */
.rz-status--neutral { background: var(--rz-color-surface-strong); color: var(--rz-color-text-secondary); }
.rz-status--success { background: var(--rz-color-success-soft); color: #004725; }
.rz-status--warning { background: var(--rz-color-warning-soft); color: #603000; }
.rz-status--danger, .rz-status--error { background: var(--rz-color-danger-soft); color: #7f101d; }
.rz-status--info { background: var(--rz-color-info-soft); color: #0d485c; }
.rz-status--prominent { min-height: 36px; padding: 6px 11px; border: 1px solid currentColor; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.rz-status--decision { min-width: 105px; justify-content: center; border: 1px solid currentColor; }
/* Compatibility status names during template migration. */
.rz-status:is(.learning-status--completed, .survey-status--active, .choice-badge--for, .status-completed) { background: var(--rz-color-success-soft); color: var(--rz-color-success); }
.rz-status:is(.learning-status--failed, .choice-badge--against, .status-requires_attention, .status-cancelled) { background: var(--rz-color-danger-soft); color: var(--rz-color-danger); }
.rz-status:is(.learning-status--overdue, .survey-status--draft, .status-completed_with_warnings) { background: var(--rz-color-warning-soft); color: var(--rz-color-warning); }
.rz-status:is(.learning-status--progress, .learning-status--in_progress, .status-running) { background: var(--rz-color-brand-soft); color: var(--rz-color-brand); }
.rz-status:is(.learning-status--assigned) { background: var(--rz-color-info-soft); color: var(--rz-color-info); }
.rz-status:is(.survey-status--closed, .choice-badge--abstain) { background: var(--rz-color-surface-strong); color: var(--rz-color-text-secondary); }

.rz-progress { width: 100%; height: 8px; margin-top: var(--rz-space-3); overflow: hidden; border-radius: var(--rz-radius-pill); background: var(--rz-color-surface-strong); }
.rz-progress__value { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--rz-color-brand); transition: width var(--rz-transition); }
.rz-job { display: grid; gap: var(--rz-space-2); }
.rz-job progress { width: 100%; height: 10px; accent-color: var(--rz-color-brand); }
.rz-job[aria-busy="true"] { cursor: progress; }

.rz-state, .rz-empty-state {
    display: grid;
    min-height: 180px;
    place-items: center;
    gap: var(--rz-space-3);
    padding: var(--rz-space-8);
    border: 1px dashed var(--rz-color-border-strong);
    border-radius: var(--rz-radius-sm);
    background: var(--rz-color-surface-muted);
    color: var(--rz-color-text-muted);
    text-align: center;
}
.rz-empty-state__icon { display: grid; width: 56px; height: 56px; place-items: center; border-radius: var(--rz-radius-sm); background: var(--rz-color-brand-soft); color: var(--rz-color-brand); }
.rz-empty-state__title { margin: 0; color: var(--rz-color-ink); font-weight: 700; }
.rz-empty-state__description { max-width: 55ch; margin: var(--rz-space-1) 0 0; }
.rz-empty-state--plain { border: 0; background: transparent; }
.rz-state--loading { cursor: progress; }
.rz-state--error { border-style: solid; border-color: #e3aab0; background: var(--rz-color-danger-soft); color: #7f101d; }

.rz-week-deadlines { overflow: hidden; border: 1px solid var(--rz-color-border); border-radius: var(--rz-radius-md); box-shadow: var(--rz-shadow-xs); }
.rz-week-deadlines__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--rz-space-2); }
.rz-week-deadlines__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--rz-space-1); }
.rz-week-deadlines__day { display: grid; position: relative; min-width: 0; min-height: 52px; justify-items: center; gap: var(--rz-space-1); padding: var(--rz-space-2) var(--rz-space-1); border: 1px solid var(--rz-color-border); border-radius: var(--rz-radius-sm); background: var(--rz-color-surface-muted); text-align: center; }
.rz-week-deadlines__day-button { display: grid; position: absolute; inset: 0; width: 100%; min-width: 0; min-height: 44px; place-items: center; padding: var(--rz-space-2) var(--rz-space-1); border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.rz-week-deadlines__day-button:hover { background: color-mix(in srgb, var(--rz-color-brand-soft) 72%, transparent); }
.rz-week-deadlines__day-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--rz-color-brand) 45%, transparent); outline-offset: 2px; }
.rz-week-deadlines__day.is-today { border-color: var(--rz-color-brand); background: var(--rz-color-brand-soft); }
.rz-week-deadlines__day.is-selected { box-shadow: inset 0 -3px 0 var(--rz-color-brand); }
.rz-week-deadlines__day.has-deadline .rz-week-deadlines__marker { color: var(--rz-color-text-muted); }
.rz-week-deadlines__day.is-urgent .rz-week-deadlines__marker { color: var(--bs-warning); }
.rz-week-deadlines__weekday { color: var(--rz-color-text-muted); font-size: var(--rz-text-xs); font-weight: 700; text-transform: uppercase; }
.rz-week-deadlines__date { font-size: var(--rz-text-sm); font-weight: 700; }
.rz-week-deadlines__marker { display: inline-flex; font-size: 13px; line-height: 1; }
.rz-week-deadlines__count { position: absolute; z-index: 1; top: -4px; right: -4px; min-width: 14px; padding: 0 3px; border-radius: var(--rz-radius-pill); background: var(--rz-color-brand); color: #fff; font-size: 9px; font-weight: 750; line-height: 14px; pointer-events: none; }
.rz-week-deadlines__lists { display: grid; gap: var(--rz-space-3); }
/* Approved counter digest: shared by the site toast and UI Lab variant 02. */
.rz-notification-digest { min-width: 0; overflow-wrap: anywhere; color: var(--rz-color-ink); background: var(--rz-color-surface); border: 1px solid var(--rz-color-border); border-radius: var(--rz-radius-md); box-shadow: var(--rz-shadow-sm); }
.rz-notification-digest__eyebrow { display: flex; align-items: center; gap: var(--rz-space-2); padding: var(--rz-space-3) var(--rz-space-4); padding-inline-end: var(--rz-space-16); background: var(--rz-color-brand-soft); color: var(--rz-color-brand); font-size: var(--rz-text-xs); font-weight: 600; }
.rz-notification-digest__body { padding: var(--rz-space-4); }
.rz-notification-digest__total { display: flex; align-items: center; flex-wrap: wrap; gap: var(--rz-space-3); }
.rz-notification-digest__total > strong { font-size: var(--rz-text-3xl); line-height: 1; letter-spacing: -.04em; color: var(--rz-color-brand); }
.rz-notification-digest__heading { font-size: var(--rz-text-base); font-weight: 650; line-height: 1.5; margin: 0; }
.rz-notification-digest__muted { color: var(--rz-color-text-secondary); font-size: var(--rz-text-xs); margin: var(--rz-space-1) 0 0; }
.rz-notification-digest__chips { list-style: none; padding: 0; margin: var(--rz-space-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--rz-space-2); }
.rz-notification-digest__chips[hidden] { display: none; }
.rz-notification-digest__chips li { padding: var(--rz-space-1) var(--rz-space-2); background: var(--rz-color-brand-soft); color: var(--rz-color-brand); font-size: var(--rz-text-xs); border-radius: var(--rz-radius-sm); }
.rz-notification-digest__note { color: var(--rz-color-text-secondary); font-size: var(--rz-text-xs); line-height: 1.6; margin: var(--rz-space-3) 0 0; }
.rz-notification-digest__footer { border-top: 1px solid var(--rz-color-border); padding: var(--rz-space-1) var(--rz-space-4); }
.rz-notification-digest__action { display: flex; align-items: center; justify-content: space-between; gap: var(--rz-space-2); min-height: var(--rz-control-height); width: 100%; padding: 0; border: 0; background: none; color: var(--rz-color-brand); font-size: var(--rz-text-sm); font-weight: 600; text-align: start; text-decoration: none; }
.rz-notification-digest__action:focus-visible { outline: 0; box-shadow: var(--rz-focus-ring); }
.rz-notification-digest__action:hover { color: var(--rz-color-brand-hover); }

.rz-week-deadlines__list { display: grid; gap: var(--rz-space-2); margin: 0; padding: 0; list-style: none; }
.rz-week-deadlines__list li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: var(--rz-space-2); align-items: start; font-size: var(--rz-text-sm); }
.rz-week-deadlines__list-date { color: var(--rz-color-text-muted); font-weight: 700; }
.rz-week-deadlines__list-title { min-width: 0; color: inherit; font-weight: 650; overflow-wrap: anywhere; text-decoration: none; }
.rz-week-deadlines__list-title:hover { color: var(--rz-color-brand); text-decoration: underline; text-underline-offset: 3px; }
.rz-week-deadlines__list-title:focus-visible { border-radius: 2px; outline: 3px solid color-mix(in srgb, var(--rz-color-brand) 45%, transparent); outline-offset: 2px; }
