/* =====================================================================================================================
   Journal v2 - shared stylesheet (U0, frozen foundation). Linked by the portals' wwwroot/index.html as
   _content/LmsJournalClientComponents/css/journal.css; it imports the three track sheets.

   Rules for every journal sheet:
   - every class starts with jr- and every rule stays low-specificity (one class, or :where() around the context), so a
     portal page can tune the journal with ordinary rules; no !important (the Admin portal's global !important table
     rules target .portal-table / .rz-*, which the journal never uses);
   - colours, type sizes and geometry come from the --jr-* tokens below; the two skins map them to the portal tokens
     (Lecturer: --color-brand-*, --tenant-primary, --tenant-accent; Admin: --portal-*, --tenant-action, --ui-scale);
   - surfaces under sticky grid cells are opaque (--jr-surface), never the translucent shell background;
   - animations are wrapped in @media (prefers-reduced-motion: no-preference);
   - dialogs (<dialog>) and popovers ([popover]) render in the top layer: they still inherit the tokens from .jr.
   ===================================================================================================================== */

@import url("journal-grid.css");
@import url("journal-attendance.css");
@import url("journal-chrome.css");
@import url("journal-plan.css");
@import url("journal-log.css");
@import url("journal-tools.css");
@import url("journal-warnings.css");
@import url("journal-comments.css");
@import url("journal-reviews.css");
@import url("journal-live.css");
@import url("journal-status.css");
@import url("journal-rubric.css");

/* ---------------------------------------------------------------------------------------------------------------------
   Tokens (defaults = the Lecturer look with its fallbacks)
   --------------------------------------------------------------------------------------------------------------------- */

.jr {
    --jr-brand: #5e0b14;
    --jr-brand-hover: color-mix(in srgb, var(--jr-brand) 86%, #ffffff);
    --jr-brand-strong: color-mix(in srgb, var(--jr-brand) 78%, #000000);
    --jr-on-brand: #ffffff;
    --jr-brand-text: var(--jr-brand);
    --jr-brand-soft: color-mix(in srgb, var(--jr-brand) 7%, #ffffff);
    --jr-brand-softer: color-mix(in srgb, var(--jr-brand) 4%, #ffffff);
    --jr-brand-line: color-mix(in srgb, var(--jr-brand) 24%, #ffffff);
    --jr-select: color-mix(in srgb, var(--jr-brand-text) 10%, var(--jr-surface));
    --jr-accent: #b88a3b;
    --jr-accent-text: color-mix(in srgb, var(--jr-accent) 66%, #2a1d05);
    --jr-accent-soft: color-mix(in srgb, var(--jr-accent) 13%, #ffffff);

    --jr-bg: #f4f5f7;
    --jr-surface: #ffffff;
    --jr-surface-2: #f8f9fb;
    --jr-sunken: #eef0f3;
    --jr-line: #e1e4ea;
    --jr-line-soft: #eceef2;
    --jr-line-strong: #cdd3db;
    --jr-text: #1b1e23;
    --jr-title: var(--jr-text);
    --jr-text-2: #4b5462;
    --jr-muted: #69727f;

    --jr-ok: #12775a;
    --jr-ok-soft: #e3f3ec;
    --jr-warn: #8f560a;
    --jr-warn-soft: #fcefda;
    --jr-bad: #ad2c39;
    --jr-bad-soft: #fbe6e8;
    --jr-on-bad: #ffffff;
    --jr-info: #2a5aa3;
    --jr-info-soft: #e6eef8;

    --jr-att-present: var(--jr-ok);
    --jr-att-present-soft: var(--jr-ok-soft);
    --jr-att-late: var(--jr-warn);
    --jr-att-late-soft: var(--jr-warn-soft);
    --jr-att-absent: var(--jr-bad);
    --jr-att-absent-soft: var(--jr-bad-soft);
    --jr-att-excused: var(--jr-info);
    --jr-att-excused-soft: var(--jr-info-soft);

    /* component groups (assigned by the grid track per component kind / order) */
    --jr-kind-1: #25786c;
    --jr-kind-2: #5a4cb0;
    --jr-kind-3: #a3660d;
    --jr-kind-4: #8b1b2b;
    --jr-kind-5: #b0485a;
    --jr-kind-6: #2f6fa8;
    --jr-kind-7: #5f7420;
    --jr-kind-8: #8a5a9e;
    --jr-kind-none: #8a919c;

    --jr-hatch: rgba(27, 30, 35, 0.05);
    --jr-scrim: rgba(20, 22, 26, 0.32);
    --jr-toast-bg: #1f2329;
    --jr-toast-fg: #f3f4f6;
    --jr-toast-action: #f0c97a;
    --jr-focus: var(--jr-brand-text);
    --jr-ring: 0 0 0 3px color-mix(in srgb, var(--jr-brand) 14%, transparent);
    --jr-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 12px 32px rgba(17, 24, 39, 0.07);
    --jr-shadow-pop: 0 2px 6px rgba(17, 24, 39, 0.08), 0 24px 60px rgba(17, 24, 39, 0.18);

    --jr-font: "Manrope", "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", sans-serif;
    --jr-fs-2xs: 10.5px;
    --jr-fs-xs: 11.5px;
    --jr-fs-sm: 12.5px;
    --jr-fs: 13.5px;
    --jr-fs-md: 14.5px;
    --jr-fs-lg: 16.5px;
    --jr-fs-xl: 19px;

    --jr-radius: 16px;
    --jr-radius-md: 11px;
    --jr-radius-sm: 8px;
    --jr-radius-xs: 6px;
    --jr-radius-pill: 999px;
    --jr-gap-1: 4px;
    --jr-gap-2: 8px;
    --jr-gap-3: 12px;
    --jr-gap-4: 16px;
    --jr-gap-5: 20px;
    --jr-ctl-h: 34px;
    --jr-ctl-h-sm: 28px;
    --jr-ctl-px: 12px;

    /* compact (the default): a session column is a date and a component name wide, as in the old journal */
    --jr-row-h: 32px;
    --jr-col-w: 76px;
    --jr-col-w-wide: 96px;
    --jr-head-h: 44px;
    /* "ფანცულაია ალექსანდრე" whole in the lecturer portal's Noto Sans Georgian (V2-12; no avatar since 2026-10-13) */
    --jr-name-w: 212px;

    /* the grade grid's quiet state fills (no hatching) and hovers */
    --jr-cell-locked: color-mix(in srgb, var(--jr-text) 3.5%, var(--jr-surface));
    --jr-cell-na: color-mix(in srgb, var(--jr-text) 6%, var(--jr-surface));
    --jr-row-hover: color-mix(in srgb, var(--jr-brand) 4%, transparent);
    --jr-head-hover: color-mix(in srgb, var(--jr-brand) 6%, var(--jr-surface-2));
    /* the grid's lines and its crosshair while it has the focus (the cursor's row and the cursor's column header) */
    --jr-grid-vline: color-mix(in srgb, var(--jr-line-soft) 55%, var(--jr-surface));
    --jr-head-bg: color-mix(in srgb, var(--jr-brand) 2.5%, var(--jr-surface-2));
    --jr-head-cur: color-mix(in srgb, var(--jr-brand) 9%, var(--jr-surface-2));
    --jr-row-active: color-mix(in srgb, var(--jr-brand) 5.5%, transparent);

    --jr-shell-bg: var(--jr-surface);
    --jr-shell-border: var(--jr-line);
    --jr-shell-shadow: var(--jr-shadow);
    --jr-bar-bg: var(--jr-surface);
    --jr-tools-bg: var(--jr-surface-2);
    --jr-status-bg: var(--jr-surface-2);
    --jr-motion: 160ms ease-out;

    position: relative;
    min-width: 0;
    color: var(--jr-text);
    font-family: var(--jr-font);
    font-size: var(--jr-fs);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.jr:where([data-jr-density="comfortable"]) {
    --jr-row-h: 40px;
    --jr-col-w: 82px;
    --jr-col-w-wide: 100px;
    --jr-head-h: 50px;
    /* the name over the personal number in the comfortable rows */
    --jr-name-w: 232px;
}

/* ---------------------------------------------------------------------------------------------------------------------
   Skin: Lecturer (MudBlazor portal, tenant primary + accent; Manrope + Noto Sans Georgian)
   --------------------------------------------------------------------------------------------------------------------- */

.jr:where([data-jr-skin="lecturer"]) {
    --jr-brand: var(--color-brand-900, var(--tenant-primary, #5e0b14));
    --jr-brand-hover: var(--color-brand-800, color-mix(in srgb, var(--tenant-primary, #5e0b14) 90%, #ffffff));
    --jr-brand-strong: var(--color-brand-950, color-mix(in srgb, var(--tenant-primary, #5e0b14) 72%, #180307));
    --jr-brand-soft: color-mix(in srgb, var(--jr-brand) 7%, #ffffff);
    --jr-brand-softer: var(--color-brand-50, color-mix(in srgb, var(--jr-brand) 5%, #ffffff));
    --jr-select: var(--color-brand-100, color-mix(in srgb, var(--jr-brand) 11%, #ffffff));
    --jr-accent: var(--color-accent-gold, var(--tenant-accent, #b88a3b));
    --jr-accent-soft: var(--color-accent-gold-soft, color-mix(in srgb, var(--tenant-accent, #b88a3b) 13%, #ffffff));

    --jr-bg: var(--color-page-bg, #f6f7f9);
    --jr-surface: var(--color-surface, #ffffff);
    --jr-surface-2: var(--color-surface-subtle, #fafafb);
    --jr-sunken: color-mix(in srgb, var(--color-border, #e5e7eb) 50%, #ffffff);
    --jr-line: var(--color-border, #e5e7eb);
    --jr-line-soft: color-mix(in srgb, var(--color-border, #e5e7eb) 62%, #ffffff);
    --jr-line-strong: var(--color-border-strong, #d8dce2);
    --jr-text: var(--color-text-primary, #1d2025);
    --jr-text-2: var(--color-text-secondary, #5d6673);
    --jr-muted: color-mix(in srgb, var(--color-text-muted, #7b8490) 82%, #1d2025);

    --jr-ok: color-mix(in srgb, var(--color-success, #168a68) 86%, #000000);
    --jr-ok-soft: var(--color-success-soft, #eaf7f2);
    --jr-warn: color-mix(in srgb, var(--color-warning, #b7791f) 78%, #2b1a00);
    --jr-warn-soft: var(--color-warning-soft, #fff6e5);
    --jr-bad: color-mix(in srgb, var(--color-danger, #c43d4b) 88%, #000000);
    --jr-bad-soft: var(--color-danger-soft, #fdedef);

    --jr-radius: var(--radius-lg, 16px);
    --jr-radius-md: var(--radius-md, 12px);
    --jr-radius-sm: var(--radius-sm, 8px);
    --jr-shadow: var(--shadow-card, 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05));
    --jr-motion: var(--motion-fast, 160ms ease-out);
    --jr-font: "Manrope", "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------------------------------------------------------------------
   Skin: Admin (Radzen portal, tenant action colour, glass surfaces, compact rem scale that follows --ui-scale)
   --------------------------------------------------------------------------------------------------------------------- */

.jr:where([data-jr-skin="admin"]) {
    --jr-k: var(--admin-type-scale, 1.3);
    --jr-brand: var(--tenant-action, var(--portal-primary, #1f6fd6));
    --jr-brand-hover: color-mix(in srgb, var(--jr-brand) 88%, #000000);
    --jr-brand-strong: color-mix(in srgb, var(--jr-brand) 76%, #000000);
    --jr-on-brand: var(--tenant-on-action, #ffffff);
    --jr-brand-text: color-mix(in srgb, var(--jr-brand) 84%, #0b1b2e);
    --jr-brand-soft: color-mix(in srgb, var(--jr-brand) 8%, #ffffff);
    --jr-brand-softer: color-mix(in srgb, var(--jr-brand) 4%, #ffffff);
    --jr-brand-line: color-mix(in srgb, var(--jr-brand) 26%, #ffffff);
    --jr-select: color-mix(in srgb, var(--jr-brand) 11%, #ffffff);
    --jr-accent: var(--tenant-accent, #b89146);
    --jr-accent-soft: color-mix(in srgb, var(--tenant-accent, #b89146) 13%, #ffffff);

    --jr-bg: var(--portal-bg, #f4f6fb);
    --jr-surface: var(--portal-surface-strong, #ffffff);
    --jr-surface-2: color-mix(in srgb, var(--portal-text, #18314f) 2.5%, var(--jr-surface));
    --jr-sunken: color-mix(in srgb, var(--portal-text, #18314f) 6%, var(--jr-surface));
    --jr-line: color-mix(in srgb, var(--portal-text, #18314f) 11%, #ffffff);
    --jr-line-soft: color-mix(in srgb, var(--portal-text, #18314f) 6.5%, #ffffff);
    --jr-line-strong: color-mix(in srgb, var(--portal-text, #18314f) 20%, #ffffff);
    --jr-text: var(--portal-text, #18314f);
    --jr-title: var(--portal-title, #10253f);
    --jr-text-2: color-mix(in srgb, var(--portal-text-soft, #5f708b) 72%, var(--portal-text, #18314f));
    --jr-muted: var(--portal-text-soft, #5f708b);

    --jr-ok: color-mix(in srgb, var(--portal-success, #0a8a61) 88%, #000000);
    --jr-ok-soft: color-mix(in srgb, var(--portal-success, #0a8a61) 10%, #ffffff);
    --jr-warn: color-mix(in srgb, var(--portal-warning, #b77a17) 80%, #2b1a00);
    --jr-warn-soft: color-mix(in srgb, var(--portal-warning, #b77a17) 12%, #ffffff);
    --jr-bad: color-mix(in srgb, var(--tenant-danger, var(--portal-danger, #d14a63)) 86%, #000000);
    --jr-bad-soft: color-mix(in srgb, var(--tenant-danger, var(--portal-danger, #d14a63)) 9%, #ffffff);
    --jr-info: #2c5c96;
    --jr-info-soft: #e8eff8;

    --jr-scrim: color-mix(in srgb, var(--portal-title, #10253f) 32%, transparent);
    --jr-toast-bg: var(--portal-title, #10253f);
    --jr-shadow: var(--portal-shadow-soft, 0 0.5rem 1.5rem rgba(26, 44, 79, 0.08));
    --jr-shadow-pop: 0 0.2rem 0.5rem rgba(26, 44, 79, 0.08), var(--portal-shadow, 0 1.25rem 3.4375rem rgba(26, 44, 79, 0.16));
    --jr-shell-bg: var(--portal-surface, rgba(255, 255, 255, 0.82));
    --jr-shell-border: var(--portal-border, rgba(53, 82, 131, 0.12));
    --jr-shell-shadow: var(--portal-shadow-soft, 0 0.5rem 1.5rem rgba(26, 44, 79, 0.08)), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --jr-bar-bg: color-mix(in srgb, var(--jr-surface) 70%, transparent);
    --jr-tools-bg: color-mix(in srgb, var(--portal-bg-soft, var(--portal-bg, #f4f6fb)) 82%, transparent);
    --jr-status-bg: color-mix(in srgb, var(--portal-bg-soft, var(--portal-bg, #f4f6fb)) 90%, transparent);

    --jr-font: "Manrope", "Noto Sans Georgian", "Segoe UI", sans-serif;
    --jr-fs-2xs: calc(0.58rem * var(--jr-k));
    --jr-fs-xs: calc(0.63rem * var(--jr-k));
    --jr-fs-sm: calc(0.68rem * var(--jr-k));
    --jr-fs: calc(0.74rem * var(--jr-k));
    --jr-fs-md: calc(0.8rem * var(--jr-k));
    --jr-fs-lg: calc(0.92rem * var(--jr-k));
    --jr-fs-xl: 1.3rem;

    --jr-radius: var(--portal-radius-lg, 1.125rem);
    --jr-radius-md: var(--ui-radius-md, 0.875rem);
    --jr-radius-sm: var(--ui-radius-sm, 0.5rem);
    --jr-radius-xs: 0.4rem;
    --jr-gap-1: 0.3rem;
    --jr-gap-2: 0.6rem;
    --jr-gap-3: 0.88rem;
    --jr-gap-4: 1.18rem;
    --jr-gap-5: 1.47rem;
    --jr-ctl-h: 2.45rem;
    --jr-ctl-h-sm: 2.05rem;
    --jr-ctl-px: 0.88rem;
    --jr-row-h: 2.35rem;
    --jr-col-w: 5.7rem;
    --jr-col-w-wide: 7.4rem;
    --jr-head-h: 3.4rem;
    /* a two-part name beside the stage chip ("ზედგინიძე თამარ · ნაწ. 2") fits at 1280 and 1440 (V2-12; no avatar) */
    --jr-name-w: 15.4rem;
}

.jr:where([data-jr-skin="admin"][data-jr-density="comfortable"]) {
    --jr-row-h: 3rem;
    --jr-col-w: 6.3rem;
    --jr-col-w-wide: 7.8rem;
    --jr-head-h: 3.9rem;
    --jr-name-w: 16.6rem;
}

/* component group colour hooks: class="jr-kind-3" sets --jr-kc for meters, dots and group borders */
.jr-kind-1 { --jr-kc: var(--jr-kind-1); }
.jr-kind-2 { --jr-kc: var(--jr-kind-2); }
.jr-kind-3 { --jr-kc: var(--jr-kind-3); }
.jr-kind-4 { --jr-kc: var(--jr-kind-4); }
.jr-kind-5 { --jr-kc: var(--jr-kind-5); }
.jr-kind-6 { --jr-kc: var(--jr-kind-6); }
.jr-kind-7 { --jr-kc: var(--jr-kind-7); }
.jr-kind-8 { --jr-kc: var(--jr-kind-8); }
.jr-kind-none { --jr-kc: var(--jr-kind-none); }

/* the component colour as text (header names, group names): a touch deeper than the colour itself */
:is(.jr-kind-1, .jr-kind-2, .jr-kind-3, .jr-kind-4, .jr-kind-5, .jr-kind-6, .jr-kind-7, .jr-kind-8) {
    --jr-kc-ink: color-mix(in srgb, var(--jr-kc) 84%, #111111);
}

/* ---------------------------------------------------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------------------------------------------------- */

:where(.jr, .jr *, .jr *::before, .jr *::after) {
    box-sizing: border-box;
}

:where(.jr) :focus-visible {
    outline: 2px solid var(--jr-focus);
    outline-offset: 2px;
}

/* Windows High Contrast (forced colours) drops every box-shadow: the rings drawn with shadows (field shells, the grids'
   cursor and selection, the roll call's row) get an outline in a system colour instead (VC3-05; the grid and
   attendance sheets add their own cells). */
@media (forced-colors: active) {
    :where(.jr) :focus-visible {
        outline: 2px solid Highlight;
    }

    .jr .jr-input:focus-within {
        outline: 2px solid Highlight;
        outline-offset: 1px;
    }

    .jr .jr-cal__day.is-selected {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
    }
}

:where(.jr) :is(h1, h2, h3, h4, p) {
    margin: 0;
}

:where(.jr) :is(button, input, select, textarea) {
    font: inherit;
    color: inherit;
}

.jr-icon {
    width: 1em;
    height: 1em;
    flex: none;
    vertical-align: -0.14em;
}

.jr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.jr-num {
    font-variant-numeric: tabular-nums;
}

/* the journal's own scrollers (the grade grid, the semester attendance grid, the roll call, popover lists): slim bars
   in a quiet ink */
:where(.jr-grid-scroll, .jr-ag__scroll, .jr-roll__list, .jr-picker__list, .jr-facet-menu__list) {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--jr-text) 22%, transparent) transparent;
}

.jr-muted {
    color: var(--jr-muted);
}

.jr-spacer {
    flex: 1 1 0;
}

.jr-tone-brand { color: var(--jr-brand-text); }
.jr-tone-ok { color: var(--jr-ok); }
.jr-tone-warn { color: var(--jr-warn); }
.jr-tone-bad { color: var(--jr-bad); }
.jr-tone-info { color: var(--jr-info); }
.jr-tone-accent { color: var(--jr-accent-text); }
.jr-tone-muted { color: var(--jr-muted); }

/* ---------------------------------------------------------------------------------------------------------------------
   Shell
   --------------------------------------------------------------------------------------------------------------------- */

.jr-header-slot {
    margin-bottom: var(--jr-gap-3);
}

.jr-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--jr-shell-bg);
    border: 1px solid var(--jr-shell-border);
    border-radius: var(--jr-radius);
    box-shadow: var(--jr-shell-shadow);
    overflow: hidden;
    overflow: clip;
}

.jr-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.jr-topbar,
.jr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--jr-gap-2) var(--jr-gap-3);
    min-width: 0;
    padding: var(--jr-gap-2) var(--jr-gap-3);
    border-bottom: 1px solid var(--jr-line);
}

.jr-topbar {
    min-height: calc(var(--jr-ctl-h) + 2 * var(--jr-gap-2) + 6px);
    background: var(--jr-bar-bg);
}

.jr-toolbar {
    background: var(--jr-tools-bg);
}

.jr-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--jr-gap-2) var(--jr-gap-3);
    padding: var(--jr-gap-2) var(--jr-gap-3);
    border-bottom: 1px solid var(--jr-line);
    font-size: var(--jr-fs-sm);
    color: var(--jr-text-2);
    background: var(--jr-surface-2);
}

.jr-banner--info { background: var(--jr-info-soft); color: var(--jr-text); }
.jr-banner--ok { background: var(--jr-ok-soft); color: var(--jr-text); }
.jr-banner--warn { background: var(--jr-warn-soft); color: var(--jr-text); }
.jr-banner--bad { background: var(--jr-bad-soft); color: var(--jr-text); }

.jr-banner > .jr-icon {
    font-size: 1.15em;
}

.jr-banner__text {
    flex: 1 1 220px;
    min-width: 0;
}

/* ---------------------------------------------------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------------------------------------------------- */

.jr-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--jr-ctl-h);
    padding: 0 var(--jr-ctl-px);
    border: 1px solid var(--jr-line);
    border-radius: var(--jr-radius-md);
    background: var(--jr-surface);
    color: var(--jr-text);
    font: inherit;
    font-size: var(--jr-fs-sm);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--jr-motion), border-color var(--jr-motion), color var(--jr-motion), box-shadow var(--jr-motion);
}

.jr-btn:hover {
    background: var(--jr-surface-2);
    border-color: var(--jr-line-strong);
}

.jr-btn:active {
    background: var(--jr-sunken);
}

.jr-btn > .jr-icon {
    font-size: 1.2em;
}

.jr-btn--primary {
    border-color: var(--jr-brand);
    background: var(--jr-brand);
    color: var(--jr-on-brand);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--jr-brand) 30%, transparent);
}

.jr-btn--primary:hover {
    border-color: var(--jr-brand-hover);
    background: var(--jr-brand-hover);
}

.jr-btn--primary:active {
    background: var(--jr-brand-strong);
}

.jr-btn--danger {
    border-color: var(--jr-bad);
    background: var(--jr-bad);
    color: var(--jr-on-bad);
}

.jr-btn--danger:hover {
    border-color: color-mix(in srgb, var(--jr-bad) 88%, #000000);
    background: color-mix(in srgb, var(--jr-bad) 88%, #000000);
}

.jr-btn--soft {
    border-color: var(--jr-brand-line);
    background: var(--jr-brand-soft);
    color: var(--jr-brand-text);
}

.jr-btn--soft:hover {
    background: var(--jr-select);
}

.jr-btn--ghost {
    border-color: transparent;
    background: transparent;
}

.jr-btn--ghost:hover {
    border-color: transparent;
    background: var(--jr-sunken);
}

.jr-btn--sm {
    min-height: var(--jr-ctl-h-sm);
    padding: 0 calc(var(--jr-ctl-px) - 3px);
    border-radius: var(--jr-radius-sm);
    font-size: var(--jr-fs-xs);
}

.jr-btn--block {
    width: 100%;
}

.jr-btn:disabled,
.jr-btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.jr-icon-btn {
    appearance: none;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--jr-ctl-h-sm);
    height: var(--jr-ctl-h-sm);
    padding: 0;
    border: 0;
    border-radius: var(--jr-radius-sm);
    background: transparent;
    color: var(--jr-muted);
    font-size: 1.15em;
    cursor: pointer;
    transition: background-color var(--jr-motion), color var(--jr-motion);
}

.jr-icon-btn:hover {
    background: var(--jr-sunken);
    color: var(--jr-text);
}

.jr-icon-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.jr-icon-btn[aria-pressed="true"] {
    background: var(--jr-brand-soft);
    color: var(--jr-brand-text);
}

.jr-text-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 0;
    border-radius: var(--jr-radius-sm);
    background: transparent;
    color: var(--jr-text-2);
    font-size: var(--jr-fs-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.jr-text-btn:hover {
    background: var(--jr-sunken);
    color: var(--jr-text);
}

.jr-text-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.jr-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--jr-brand-text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ---------------------------------------------------------------------------------------------------------------------
   Chips, badges, segmented control, meters, avatars, kbd
   --------------------------------------------------------------------------------------------------------------------- */

.jr-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--jr-radius-pill);
    background: var(--jr-sunken);
    color: var(--jr-text-2);
    font-size: var(--jr-fs-xs);
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.jr-chip > .jr-icon { font-size: 1.1em; }
.jr-chip--ok { background: var(--jr-ok-soft); color: var(--jr-ok); }
.jr-chip--warn { background: var(--jr-warn-soft); color: var(--jr-warn); }
.jr-chip--bad { background: var(--jr-bad-soft); color: var(--jr-bad); }
.jr-chip--info { background: var(--jr-info-soft); color: var(--jr-info); }
.jr-chip--brand { background: var(--jr-brand-soft); color: var(--jr-brand-text); }
.jr-chip--accent { background: var(--jr-accent-soft); color: var(--jr-accent-text); }
.jr-chip--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--jr-line); }

.jr-fchip {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--jr-ctl-h-sm);
    padding: 0 10px;
    border: 1px solid var(--jr-line);
    border-radius: var(--jr-radius-pill);
    background: var(--jr-surface);
    color: var(--jr-text-2);
    font-size: var(--jr-fs-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--jr-motion), border-color var(--jr-motion), color var(--jr-motion);
}

.jr-fchip:hover {
    border-color: var(--jr-line-strong);
}

.jr-fchip b,
.jr-fchip .jr-fchip__count {
    color: var(--jr-text);
    font-variant-numeric: tabular-nums;
}

.jr-fchip[aria-pressed="true"] {
    border-color: var(--jr-brand-line);
    background: var(--jr-brand-soft);
    color: var(--jr-brand-text);
}

.jr-fchip[aria-pressed="true"] b,
.jr-fchip[aria-pressed="true"] .jr-fchip__count {
    color: var(--jr-brand-text);
}

.jr-badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--jr-radius-pill);
    background: var(--jr-brand);
    color: var(--jr-on-brand);
    font-size: var(--jr-fs-2xs);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.jr-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border-radius: var(--jr-radius-md);
    background: var(--jr-sunken);
}

.jr-seg__btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: calc(var(--jr-ctl-h) - 6px);
    padding: 0 11px;
    border: 0;
    border-radius: calc(var(--jr-radius-md) - 3px);
    background: transparent;
    color: var(--jr-text-2);
    font-size: var(--jr-fs-sm);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.jr-seg__btn > .jr-icon {
    font-size: 1.15em;
}

.jr-seg__btn:hover {
    color: var(--jr-text);
}

.jr-seg__btn[aria-pressed="true"],
.jr-seg__btn[aria-checked="true"] {
    background: var(--jr-surface);
    color: var(--jr-text);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.1), 0 0 0 1px rgba(17, 24, 39, 0.03);
}

.jr-meter {
    display: block;
    flex: 1 1 auto;
    min-width: 16px;
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--jr-sunken);
}

.jr-meter > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--jr-kc, var(--jr-brand-text));
}

.jr-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--jr-sunken);
    color: var(--jr-text-2);
    font-size: var(--jr-fs-2xs);
    font-weight: 700;
    text-transform: uppercase;
}

.jr-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jr-avatar--md { width: 32px; height: 32px; font-size: var(--jr-fs-xs); }
.jr-avatar--lg { width: 42px; height: 42px; font-size: var(--jr-fs-md); }

:where(.jr) kbd,
.jr-kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--jr-line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--jr-surface);
    color: var(--jr-text);
    font-family: var(--jr-font);
    font-size: var(--jr-fs-2xs);
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------------------------------------------------
   Inputs (the focus ring belongs to the field shell, never to the inner control)
   --------------------------------------------------------------------------------------------------------------------- */

.jr-field {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.jr-label {
    color: var(--jr-text-2);
    font-size: var(--jr-fs-xs);
    font-weight: 700;
}

.jr-field--required .jr-label::after {
    content: " *";
    color: var(--jr-bad);
}

.jr-hint {
    color: var(--jr-muted);
    font-size: var(--jr-fs-xs);
}

.jr-error-text {
    color: var(--jr-bad);
    font-size: var(--jr-fs-xs);
    font-weight: 600;
}

.jr-input {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: var(--jr-ctl-h);
    padding: 0 10px;
    border: 1px solid var(--jr-line);
    border-radius: var(--jr-radius-md);
    background: var(--jr-surface);
    color: var(--jr-muted);
    transition: border-color var(--jr-motion), box-shadow var(--jr-motion);
}

.jr-input:hover {
    border-color: var(--jr-line-strong);
}

.jr-input:focus-within {
    border-color: var(--jr-brand-line);
    box-shadow: var(--jr-ring);
}

.jr-input--invalid,
.jr-input--invalid:focus-within {
    border-color: var(--jr-bad);
}

.jr-input--disabled {
    background: var(--jr-surface-2);
    opacity: 0.7;
}

.jr-input__control {
    appearance: none;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: calc(var(--jr-ctl-h) - 2px);
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--jr-text);
    font-size: var(--jr-fs);
}

.jr-input__control:focus,
.jr-input__control:focus-visible {
    outline: none;
}

.jr-input__control::placeholder {
    color: var(--jr-muted);
    opacity: 1;
}

.jr-input__control::-webkit-search-cancel-button {
    display: none;
}

select.jr-input__control {
    cursor: pointer;
    padding-right: 4px;
}

.jr-input--area {
    align-items: stretch;
    padding: 8px 10px;
}

textarea.jr-input__control {
    height: auto;
    min-height: 72px;
    line-height: 1.5;
    resize: vertical;
}

.jr-search {
    flex: 0 1 240px;
}

/* Date field (JrDateField): dd.MM.yyyy in both languages, a calendar under its button (V3-09) */
.jr-datefield {
    position: relative;
    display: grid;
    gap: 6px;
    min-width: 0;
}

.jr-input.jr-datefield__shell {
    padding-right: 3px;
}

.jr-datefield__input {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.jr-icon-btn.jr-datefield__btn[aria-expanded="true"] {
    background: var(--jr-brand-soft);
    color: var(--jr-brand-text);
}

/* The calendar is a [popover="manual"] in the top layer, placed under the field (above it when the window has no room
   below) by journal-common.js calendarKeys, so a dialog body or a popover that scrolls never clips it (W4V-01). No
   `display` here: the browser keeps a popover hidden until it is shown; the inside lays itself out. */
.jr-cal {
    position: fixed;
    inset: auto;
    width: max-content;
    max-width: calc(100vw - 16px);
    height: auto;
    margin: 0;
    padding: 8px;
    overflow: visible;
    border: 1px solid var(--jr-line);
    border-radius: var(--jr-radius-md);
    background: var(--jr-surface);
    color: var(--jr-text);
    box-shadow: var(--jr-shadow-pop);
    font-family: var(--jr-font);
    font-size: var(--jr-fs);
    line-height: 1.45;
}

.jr-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.jr-cal__title {
    color: var(--jr-title, var(--jr-text));
    font-size: var(--jr-fs-sm);
    font-weight: 800;
}

.jr-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 2.25em);
    gap: 2px;
    font-size: var(--jr-fs-sm);
}

.jr-cal__wd {
    display: grid;
    place-items: center;
    height: 1.9em;
    color: var(--jr-muted);
    font-size: var(--jr-fs-2xs);
    font-weight: 700;
}

.jr-cal__day {
    appearance: none;
    display: grid;
    place-items: center;
    height: 2.1em;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--jr-radius-sm);
    background: transparent;
    color: var(--jr-text);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    cursor: pointer;
}

.jr-cal__day:hover:not(:disabled) {
    background: var(--jr-surface-2);
}

.jr-cal__day.is-outside {
    color: var(--jr-muted);
    font-weight: 500;
}

.jr-cal__day.is-today {
    border-color: var(--jr-brand-line);
}

.jr-cal__day.is-selected,
.jr-cal__day.is-selected:hover {
    background: var(--jr-brand);
    color: var(--jr-on-brand);
}

.jr-cal__day:disabled {
    color: var(--jr-muted);
    opacity: 0.45;
    cursor: default;
}

.jr-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--jr-text);
    font-size: var(--jr-fs-sm);
    cursor: pointer;
}

.jr-check input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--jr-brand);
}

/* ---------------------------------------------------------------------------------------------------------------------
   Popover and menus (top layer; JrPopover places them)
   --------------------------------------------------------------------------------------------------------------------- */

.jr-popover {
    position: fixed;
    inset: auto;
    z-index: 1000;
    width: max-content;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 16px));
    max-height: min(70vh, 560px);
    margin: 0;
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--jr-line);
    border-radius: var(--jr-radius-md);
    background: var(--jr-surface);
    color: var(--jr-text);
    box-shadow: var(--jr-shadow-pop);
    font-family: var(--jr-font);
    font-size: var(--jr-fs);
    line-height: 1.45;
}

.jr-popover:focus {
    outline: none;
}

.jr-popover--wide {
    max-width: min(480px, calc(100vw - 16px));
}

.jr-menu {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jr-menu__head {
    display: grid;
    gap: 2px;
    padding: 8px 10px 6px;
}

.jr-menu__head b {
    font-size: var(--jr-fs);
}

.jr-menu__head span {
    font-size: var(--jr-fs-xs);
}

/* only the plain lines are muted: a line with a class of its own keeps its colour (the column menu's lock state with
   its .jr-tone-*, the publication state), which this rule would otherwise beat */
.jr-menu__head span:not([class]) {
    color: var(--jr-muted);
}

.jr-menu__item {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: var(--jr-radius-sm);
    background: transparent;
    color: var(--jr-text);
    font-size: var(--jr-fs);
    text-align: left;
    cursor: pointer;
}

.jr-menu__item > .jr-icon {
    color: var(--jr-muted);
    font-size: 1.15em;
}

.jr-menu__item:hover,
.jr-menu__item:focus-visible {
    outline: none;
    background: var(--jr-sunken);
}

.jr-menu__item[aria-disabled="true"],
.jr-menu__item:disabled {
    color: var(--jr-muted);
    cursor: not-allowed;
}

.jr-menu__item--danger {
    color: var(--jr-bad);
}

.jr-menu__item--danger > .jr-icon {
    color: var(--jr-bad);
}

.jr-menu__item small {
    display: block;
    color: var(--jr-muted);
    font-size: var(--jr-fs-xs);
    white-space: normal;
}

.jr-menu__sep {
    height: 1px;
    margin: 5px 4px;
    background: var(--jr-line);
}

.jr-popover__note {
    padding: 2px 10px 6px;
    color: var(--jr-muted);
    font-size: var(--jr-fs-xs);
}

/* ---------------------------------------------------------------------------------------------------------------------
   Dialog and drawer (native <dialog>, top layer; JrDialog)
   --------------------------------------------------------------------------------------------------------------------- */

.jr-dialog {
    width: min(480px, calc(100vw - 24px));
    max-width: none;
    max-height: min(88dvh, 860px);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 1px solid var(--jr-line);
    border-radius: var(--jr-radius);
    background: var(--jr-surface);
    color: var(--jr-text);
    box-shadow: var(--jr-shadow-pop);
    font-family: var(--jr-font);
    font-size: var(--jr-fs);
    line-height: 1.45;
}

.jr-dialog::backdrop {
    background: var(--jr-scrim, rgba(20, 22, 26, 0.32));
}

.jr-dialog--sm { width: min(380px, calc(100vw - 24px)); }
.jr-dialog--lg { width: min(640px, calc(100vw - 24px)); }
.jr-dialog--xl { width: min(900px, calc(100vw - 24px)); }

.jr-dialog__frame {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    min-height: 0;
}

.jr-dialog__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 10px 18px;
}

.jr-dialog__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: var(--jr-radius-sm);
    background: var(--jr-brand-soft);
    font-size: 1.25em;
}

.jr-dialog__icon.jr-tone-ok { background: var(--jr-ok-soft); }
.jr-dialog__icon.jr-tone-warn { background: var(--jr-warn-soft); }
.jr-dialog__icon.jr-tone-bad { background: var(--jr-bad-soft); }
.jr-dialog__icon.jr-tone-info { background: var(--jr-info-soft); }

.jr-dialog__titles {
    display: grid;
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
    padding-top: 2px;
}

.jr-dialog__title {
    color: var(--jr-title);
    font-size: var(--jr-fs-lg);
    font-weight: 800;
    line-height: 1.3;
    text-wrap: balance;
}

.jr-dialog__subtitle {
    color: var(--jr-muted);
    font-size: var(--jr-fs-sm);
}

.jr-dialog__close {
    margin: -2px -4px 0 0;
}

.jr-dialog__body {
    display: grid;
    gap: 12px;
    min-height: 0;
    padding: 4px 18px 16px;
    overflow: auto;
    overscroll-behavior: contain;
}

.jr-dialog__text {
    color: var(--jr-text-2);
}

.jr-dialog__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--jr-line-soft);
    background: var(--jr-surface-2);
    border-radius: 0 0 var(--jr-radius) var(--jr-radius);
}

.jr-dialog--drawer {
    width: min(400px, 100vw);
    height: 100dvh;
    max-height: none;
    margin: 0 0 0 auto;
    border-width: 0 0 0 1px;
    border-radius: 0;
}

.jr-dialog--drawer .jr-dialog__frame {
    height: 100%;
}

.jr-dialog--drawer .jr-dialog__head {
    padding: 14px 14px 12px 16px;
    border-bottom: 1px solid var(--jr-line);
}

.jr-dialog--drawer .jr-dialog__body {
    flex: 1 1 auto;
    align-content: start;
    gap: 18px;
    padding: 16px;
}

.jr-dialog--drawer .jr-dialog__foot {
    border-radius: 0;
}

.jr-dialog--drawer.jr-dialog--lg { width: min(520px, 100vw); }

@media (prefers-reduced-motion: no-preference) {
    .jr-dialog--modal[open] {
        animation: jr-dialog-in 160ms ease-out;
    }

    .jr-dialog--drawer[open] {
        animation: jr-drawer-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    .jr-dialog[open]::backdrop {
        animation: jr-fade-in 160ms ease-out;
    }
}

@keyframes jr-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

@keyframes jr-drawer-in {
    from { transform: translateX(24px); opacity: 0.4; }
    to { transform: none; opacity: 1; }
}

@keyframes jr-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------------------------------------------------------------------------------------------------------------------
   Toasts (ToastHost renders .jr-toast-dock > .jr-toast-stack > .jr-toast at the end of .jr; the dock is sticky to
   the viewport bottom while the workspace is in view)
   --------------------------------------------------------------------------------------------------------------------- */

.jr-toast-dock {
    position: sticky;
    bottom: 12px;
    z-index: 30;
    height: 0;
    pointer-events: none;
}

/* --jr-statusbar-h: the status bar's real height (journal-common.js watchStatusBar), so a toast never covers a bar that
   wraps onto three or four lines on a phone, with the very links the toast points to (W4V-06). */
.jr-toast-stack {
    position: absolute;
    left: 12px;
    bottom: calc(var(--jr-statusbar-h, 40px) + 12px);
    display: grid;
    gap: 8px;
    justify-items: start;
    max-width: min(460px, calc(100% - 24px));
}

.jr-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    padding: 9px 10px 9px 12px;
    border-radius: var(--jr-radius-md);
    background: var(--jr-toast-bg);
    color: var(--jr-toast-fg);
    box-shadow: var(--jr-shadow-pop);
    font-size: var(--jr-fs-sm);
    font-weight: 600;
    pointer-events: auto;
}

.jr-toast > .jr-icon {
    font-size: 1.2em;
}

.jr-toast--success > .jr-icon { color: #7fd8b4; }
.jr-toast--warning > .jr-icon { color: #f2c46d; }
.jr-toast--error > .jr-icon { color: #f59aa3; }

.jr-toast__text {
    min-width: 0;
}

.jr-toast__action {
    appearance: none;
    padding: 2px 4px;
    border: 0;
    background: none;
    color: var(--jr-toast-action);
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.jr-toast__close {
    color: inherit;
    opacity: 0.7;
}

.jr-toast__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
    .jr-toast {
        animation: jr-toast-in 180ms ease-out;
    }
}

@keyframes jr-toast-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------------------------------------------------
   Status bar (StatusBar renders it as the last row of the shell)
   --------------------------------------------------------------------------------------------------------------------- */

/* Sticky to the bottom of the page's scroller: when the workspace is taller than the screen (a long roll call, a
   phone, a short laptop screen), the save state, the rejected / conflict chips and undo stay in view. The shell clips
   with overflow: clip (no scroll container), so the bar sticks to the portal's content scroller. */
.jr-statusbar {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    min-height: 40px;
    padding: 6px var(--jr-gap-3);
    border-top: 1px solid var(--jr-line);
    background: var(--jr-status-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--jr-text-2);
    font-size: var(--jr-fs-sm);
}

/* the save state as a quiet pill in its own colour */
.jr-statusbar__save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px 3px 8px;
    border-radius: var(--jr-radius-pill);
    background: color-mix(in srgb, currentColor 9%, transparent);
    font-weight: 700;
    white-space: nowrap;
}

.jr-statusbar__save > .jr-icon { font-size: 1.2em; }
.jr-statusbar__save--ok { color: var(--jr-ok); }
.jr-statusbar__save--busy { color: var(--jr-accent-text); }
.jr-statusbar__save--warn { color: var(--jr-warn); }
.jr-statusbar__save--bad { color: var(--jr-bad); }

.jr-statusbar__info {
    flex: 1 1 220px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jr-statusbar__info--warn { color: var(--jr-warn); font-weight: 600; }
.jr-statusbar__info--bad { color: var(--jr-bad); font-weight: 600; }

.jr-statusbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* ---------------------------------------------------------------------------------------------------------------------
   States: empty / loading / error, spinner, progress bar, skeleton
   --------------------------------------------------------------------------------------------------------------------- */

.jr-state {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    min-height: 220px;
    padding: 40px 16px;
    color: var(--jr-muted);
    text-align: center;
}

.jr-state__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--jr-sunken);
    font-size: 1.5em;
}

.jr-state__icon.jr-tone-bad { background: var(--jr-bad-soft); }
.jr-state__icon.jr-tone-warn { background: var(--jr-warn-soft); }
.jr-state__icon.jr-tone-ok { background: var(--jr-ok-soft); }
.jr-state__icon.jr-tone-brand { background: var(--jr-brand-soft); }

.jr-state__title {
    color: var(--jr-text);
    font-size: var(--jr-fs-md);
    font-weight: 700;
}

.jr-state__text {
    max-width: 52ch;
    font-size: var(--jr-fs-sm);
}

.jr-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--jr-sunken);
    border-top-color: var(--jr-brand-text);
    border-radius: 50%;
}

.jr-progress {
    position: relative;
    height: 2px;
    overflow: hidden;
    background: var(--jr-brand-soft);
}

.jr-progress > i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    background: var(--jr-brand-text);
}

.jr-skeleton {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--jr-sunken), var(--jr-surface-2), var(--jr-sunken));
    background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
    .jr-spinner {
        animation: jr-spin 0.8s linear infinite;
    }

    .jr-progress > i {
        animation: jr-progress 1.1s ease-in-out infinite;
    }

    .jr-skeleton {
        animation: jr-shimmer 1.4s ease-in-out infinite;
    }
}

@keyframes jr-spin {
    to { transform: rotate(360deg); }
}

@keyframes jr-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}

@keyframes jr-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* ---------------------------------------------------------------------------------------------------------------------
   Narrow screens
   --------------------------------------------------------------------------------------------------------------------- */

@media (max-width: 760px) {
    .jr {
        --jr-name-w: 150px;
    }

    .jr-topbar,
    .jr-toolbar,
    .jr-banner,
    .jr-statusbar {
        padding-inline: 10px;
    }

    .jr-search {
        flex: 1 1 160px;
    }

    .jr-statusbar__info {
        flex-basis: 100%;
        order: 3;
    }

    .jr-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }

    .jr-dialog--drawer {
        width: 100vw;
        max-height: none;
        border-left-width: 0;
    }

    .jr-dialog__foot .jr-btn {
        flex: 1 1 auto;
    }

    .jr-toast-stack {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
