/*
 * Brand styling for the Keycloak account console (parent: keycloak.v3).
 *
 * This sheet and admin/resources/css/jazzinec-admin.css are deliberately
 * identical apart from the admin-only section at the end of that file. Both are
 * generated from console-theme/ -- edit the template or the brand config, never
 * the output.
 *
 * The console is a React app built on PatternFly 5, and PatternFly drives
 * almost everything from CSS custom properties. This file therefore restates
 * the *tokens* and leaves PatternFly's own rules alone. Overriding rules
 * directly is what broke the earlier revision: PatternFly scopes many
 * component variables to the component root
 * (`.pf-v5-c-nav { --pf-v5-c-nav__link--Color: ... }`), so a `:root` override
 * never reaches them, and a flat `background:` override repaints a surface
 * without repainting the text that sits on it.
 *
 * Two facts about the parent theme drive the choices below.
 *
 * 1. keycloak.v3 ships `darkMode=true`, which makes index.ftl put
 *    `pf-v5-theme-dark` on <html> whenever the OS asks for a dark scheme.
 *    We set `darkMode=false` in theme.properties, so none of PatternFly's
 *    `.pf-v5-theme-dark` rules can fire and this file only has to describe one
 *    palette.
 *
 * 2. The masthead and the page sidebar are *dark surfaces by default*.
 *    PatternFly remaps `--pf-v5-global--Color--100` to its light-on-dark value
 *    inside `.pf-v5-c-masthead` and `.pf-v5-c-page__sidebar`, so painting those
 *    surfaces white without undoing the remap leaves the navigation white on
 *    white. Jazzinec has a white header, so this sheet does both: it repaints
 *    the surfaces and reverses the remap on the same selectors PatternFly
 *    used.
 */

/* ------------------------------------------------------------------ fonts */

/* The console bundle does not carry Roboto, so the theme ships
   the same files the site loads through @fontsource. */

@font-face {
    font-family: 'Roboto Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/roboto-latin-ext-wght-normal.woff2')
        format('woff2-variations');
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Roboto Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/roboto-latin-wght-normal.woff2')
        format('woff2-variations');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------- brand tokens */
/* Mirrors frontend/app/styles/tokens.sass. Keep the two in step. */
:root {
    /* Palette. */
    --jz-primary: #292929; /* buttons, active state, focus */
    --jz-primary-strong: #111111;
    --jz-primary-soft: #fff0b3;
    --jz-primary-soft-md: #fff0b3;
    --jz-primary-focus: rgb(41 41 41 / 16%);
    --jz-field-outline: #a4a4a1;
    --jz-accent: #292929; /* links */
    --jz-accent-strong: #111111;
    --jz-accent-soft: #fff0b3;
    --jz-danger: #a23d38;
    --jz-danger-strong: #87302c;
    --jz-success: #365e49;
    --jz-success-strong: #2c503e;
    --jz-ink: #1d1d1d;
    --jz-muted: #606060;

    /* Surfaces. */
    --jz-surface: #ffffff;
    --jz-surface-soft: #f4f4f3;
    --jz-surface-muted: #ebebea;
    --jz-surface-strong: #dddddd;
    --jz-border: #dededd;
    --jz-border-strong: #a4a4a1;

    /*
     * Chrome -- masthead and page sidebar. These are the tokens that decide
     * whether the console has a light header or a dark one; the rules that use
     * them are the same either way. For a dark chrome set --jz-chrome-bg to
     * the dark brand colour and --jz-chrome-text / --jz-chrome-muted to the
     * light-on-dark pair (zhtreking is the reference for that variant).
     */
    --jz-chrome-bg: #f0f0ef;
    --jz-chrome-text: #292929;
    --jz-chrome-muted: #555555;
    --jz-chrome-border: #dededd;
    --jz-chrome-rule: 1px solid var(--jz-border);
    --jz-chrome-link: #292929;
    --jz-chrome-link-hover: #111111;
    --jz-sidebar-rule: 1px solid var(--jz-border);
    --jz-chrome-blur: none;
    --jz-page-bg: #f4f4f3;

    /* Navigation: resting colour, current colour, fills, separators. */
    --jz-nav-link: #555555;
    --jz-nav-current: #292929;
    --jz-nav-hover-bg: #e7e7e5;
    --jz-nav-current-bg: #fff0b3;
    --jz-nav-separator: #dededd;

    /* Geometry. Only buttons and labels are pills unless the brand says so. */
    --jz-radius-card: 0;
    --jz-radius-field: 0;
    --jz-radius-control: 0;
    --jz-radius-button: 0;
    --jz-radius-pill: 0;

    --jz-shadow-card: 0 2px 8px rgb(31 35 40 / 6%);
    --jz-shadow-card-hover: 0 6px 18px rgb(31 35 40 / 10%);
    --jz-shadow-button: none;
    --jz-shadow-button-hover: none;

    /* Cards: hairline plus shadow, no accent rule on top. Set
       --jz-card-accent to e.g. `4px solid var(--jz-primary)` for a brand
       that marks its panels with a coloured rule. */
    --jz-card-border: var(--jz-border);
    --jz-card-accent: 1px solid var(--jz-border);

    /* Secondary button: outlined here; fill it for a brand that does. */
    --jz-secondary-bg: var(--jz-surface);
    --jz-secondary-border: var(--jz-border-strong);
    --jz-secondary-hover-bg: var(--jz-surface-soft);
    --jz-secondary-hover-border: var(--jz-primary);

    /* Type. */
    --jz-font-text: 'Roboto Variable', Roboto, Arial, sans-serif;
    --jz-font-head: var(--jz-font-text);

    /* Small-caps eyebrow treatment for section labels and table headers. Set
       both to none / 0 for a brand that never sets anything in uppercase. */
    --jz-eyebrow-transform: uppercase;
    --jz-eyebrow-spacing: 0.06em;

    /* List rows: zebra fill and hover. transparent = hairlines only. */
    --jz-zebra: var(--jz-surface-soft);
    --jz-row-hover: var(--jz-surface-soft);

    /* Fields: surface fill, grey outline, soft halo on focus. A brand whose
       fields are tinted and frameless sets --jz-field-bg to the tint and
       --jz-field-outline to the same value. */
    --jz-field-bg: var(--jz-surface);
    --jz-field-hover-border: var(--jz-primary);
    --jz-field-focus-border: var(--jz-primary);
    --jz-field-focus-ring: 0 0 0 4px var(--jz-primary-focus);

    /* Filled button. Set the hover pair to an accent for a brand that inverts
       instead of darkening. */
    --jz-on-primary: #ffffff;
    --jz-on-primary-hover: #ffffff;
    --jz-primary-hover-bg: var(--jz-primary-strong);
    --jz-secondary-weight: 600;

    /* "Current realm" badge in the admin sidebar. */
    --jz-badge-bg: var(--jz-primary-soft);
    --jz-badge-fg: var(--jz-primary-strong);

    /* The colour PatternFly paints current-item bars and tab indicators
       with. Usually the primary, but a brand may mark "here" in an accent. */
    --jz-active: var(--jz-primary);
    --jz-active-strong: var(--jz-primary-strong);

    --jz-focus-outline: 2px solid var(--jz-primary);
    --jz-focus-offset: 2px;
    --jz-secondary-hover-shadow: none;

    /*
     * One height for everything that reads as a control. PatternFly lays a
     * toolbar out top-aligned and assumes they all match, so sizing fields and
     * buttons independently is what makes a toolbar look scattered.
     */
    --jz-control-height: 38px;

    /*
     * Permanent underline for links inside data tables. Leave it at none when
     * the accent is clearly different from the body colour; set it to
     * underline when it is not -- in a grid the link is the only navigation
     * and colour alone may not carry it.
     */
    --jz-table-link-decoration: underline;

    --jz-transition: 0.15s;
}

/* ------------------------------------------- PatternFly global palette map */
:root {
    /*
     * Typography. These four are the tokens PatternFly 5 actually reads --
     * --FontFamily--text for body copy and --FontFamily--heading for titles,
     * each with a variable-font twin that wins when it is defined. The
     * --sans-serif names below them are the PatternFly 4 spelling and do
     * nothing here; leaving only those is why headings kept coming out in
     * RedHatDisplay while the body had already switched over.
     */
    --pf-v5-global--FontFamily--text: var(--jz-font-text);
    --pf-v5-global--FontFamily--text--vf: var(--jz-font-text);
    --pf-v5-global--FontFamily--heading: var(--jz-font-head);
    --pf-v5-global--FontFamily--heading--vf: var(--jz-font-head);

    --pf-v5-global--FontSize--xs: 0.75rem;
    --pf-v5-global--FontSize--sm: 0.8125rem;
    --pf-v5-global--FontSize--md: 0.9375rem;
    --pf-v5-global--FontSize--lg: 1.0625rem;
    --pf-v5-global--FontSize--xl: 1.125rem;
    --pf-v5-global--FontSize--2xl: 1.3125rem;
    --pf-v5-global--FontSize--3xl: 1.5rem;
    --pf-v5-global--FontSize--4xl: 1.75rem;

    --pf-v5-global--LineHeight--md: 1.5;
    --pf-v5-global--LineHeight--sm: 1.35;

    /* Links on the site are not underlined until you point at them. */
    --pf-v5-global--link--TextDecoration: none;
    --pf-v5-global--link--TextDecoration--hover: underline;

    /*
     * Chrome surfaces. PatternFly derives the masthead from dark-100 and the
     * page sidebar from --pf-v5-c-page__sidebar--BackgroundColor, which is
     * itself declared at :root. Both are set to the site's white here; the
     * text on them is fixed further down, on the components themselves.
     */
    --pf-v5-c-page__sidebar--BackgroundColor: var(--jz-chrome-bg);

    /* Light surfaces. */
    --pf-v5-global--BackgroundColor--100: var(--jz-surface);
    --pf-v5-global--BackgroundColor--200: var(--jz-surface-soft);
    --pf-v5-global--BackgroundColor--light-100: var(--jz-surface);
    --pf-v5-global--BackgroundColor--light-200: var(--jz-surface-soft);
    --pf-v5-global--BackgroundColor--light-300: var(--jz-page-bg);

    /* Text on light surfaces. */
    --pf-v5-global--Color--100: var(--jz-ink);
    --pf-v5-global--Color--200: var(--jz-muted);
    --pf-v5-global--Color--dark-100: var(--jz-ink);
    --pf-v5-global--Color--dark-200: var(--jz-muted);

    /* Hairlines. */
    --pf-v5-global--BorderColor--100: var(--jz-border-strong);
    --pf-v5-global--BorderColor--200: var(--jz-border-strong);
    --pf-v5-global--BorderColor--300: var(--jz-border);

    /* Accents. active-color--400 is what PatternFly paints the current-item
       bar in the vertical navigation with, so branding it brands the nav. */
    --pf-v5-global--primary-color--100: var(--jz-primary);
    --pf-v5-global--primary-color--200: var(--jz-primary-strong);
    --pf-v5-global--primary-color--dark-100: var(--jz-primary);
    --pf-v5-global--primary-color--light-100: var(--jz-active);
    --pf-v5-global--active-color--100: var(--jz-active);
    --pf-v5-global--active-color--200: var(--jz-active-strong);
    --pf-v5-global--active-color--400: var(--jz-active);

    --pf-v5-global--link--Color: var(--jz-accent);
    --pf-v5-global--link--Color--hover: var(--jz-accent-strong);
    --pf-v5-global--link--Color--dark: var(--jz-accent);
    --pf-v5-global--link--Color--dark--hover: var(--jz-accent-strong);

    --pf-v5-global--danger-color--100: var(--jz-danger);
    --pf-v5-global--danger-color--200: var(--jz-danger-strong);

    /* Semantic colours keep their meaning; success only changes shade, so the
       checkmarks the console scatters around read as the brand rather than as
       PatternFly. Warning and danger stay as they are -- amber and red carry
       meaning no palette should overwrite. */
    --pf-v5-global--success-color--100: var(--jz-success);
    --pf-v5-global--success-color--200: var(--jz-success-strong);

    /* PatternFly's own radii, used by the odds and ends this sheet does not
       name explicitly. */
    --pf-v5-global--BorderRadius--sm: var(--jz-radius-control);
    --pf-v5-global--BorderRadius--lg: var(--jz-radius-pill);
}

/* ------------------------------------------------------------------ shell */
body {
    font-family: var(--jz-font-text);
    color: var(--jz-ink);
    background-color: var(--jz-page-bg);
}

/* The pre-React loading screen is plain markup in index.ftl, so it needs the
   brand applied directly rather than through a token. */
.keycloak__loading-container {
    background: var(--jz-surface-soft);
    color: var(--jz-ink);
}

#loading-text {
    color: var(--jz-muted);
    font-family: var(--jz-font-head);
}

/* Controls ease between their states on the site rather than snapping. */
a,
button,
input,
select,
textarea,
.pf-v5-c-button,
.pf-v5-c-nav__link {
    transition:
        color var(--jz-transition) ease,
        background-color var(--jz-transition) ease,
        border-color var(--jz-transition) ease,
        box-shadow var(--jz-transition) ease,
        opacity var(--jz-transition) ease;
}

:focus-visible {
    outline: var(--jz-focus-outline);
    outline-offset: var(--jz-focus-offset);
}

/* --------------------------------------------------------------- masthead */
/*
 * The masthead and the page sidebar are the "chrome". PatternFly treats them
 * as dark bands: besides the fill, it remaps --pf-v5-global--Color--100 *on
 * these elements* to its light-on-dark value, and draws the item separators
 * from a near-black palette entry. All three have to move together, or the
 * navigation ends up invisible -- white on white for a light chrome, or dark
 * on dark if only the fill is changed.
 *
 * Everything here runs through the --jz-chrome-* tokens, so the same rules
 * describe a white header and a dark one; only the values differ.
 *
 * The second selector repeats PatternFly's own compound
 * (`.pf-v5-c-masthead .pf-v5-c-button.pf-m-plain`) because it has to match its
 * specificity to win.
 */
.pf-v5-c-masthead,
.pf-v5-c-masthead .pf-v5-c-button.pf-m-plain {
    --pf-v5-global--Color--100: var(--jz-chrome-text);
    --pf-v5-global--Color--200: var(--jz-chrome-muted);
    /* PatternFly reaches for the light-on-dark pair from inside the chrome as
       well -- flyout menus, section titles. Point them at the same values so
       the chrome is described once, whichever way round it is. */
    --pf-v5-global--Color--light-100: var(--jz-chrome-text);
    --pf-v5-global--Color--light-200: var(--jz-chrome-muted);
}

/* Link buttons sitting in the masthead read on the chrome, not on the page. */
.pf-v5-c-masthead .pf-v5-c-button {
    --pf-v5-c-button--m-link--Color: var(--jz-chrome-link);
    --pf-v5-c-button--m-link--hover--Color: var(--jz-chrome-link-hover);
}

.pf-v5-c-masthead {
    --pf-v5-c-masthead--BackgroundColor: var(--jz-chrome-bg);
    --pf-v5-c-masthead--item-border-color--base: var(--jz-chrome-border);
    --pf-v5-c-masthead__main--before--BorderBottomColor: var(
        --jz-chrome-border
    );

    border-bottom: var(--jz-chrome-rule);
    backdrop-filter: var(--jz-chrome-blur);
}

/* The brand <img> already gets a height from the console's own CSS module; it
   only needs a free width so the logo keeps its aspect ratio. */
.pf-v5-c-masthead__brand img {
    width: auto;
}

/* -------------------------------------------------------- sidebar and nav */
/*
 * Same three-part fix as the masthead. `.pf-v5-c-page__header` is the v4 name
 * PatternFly still lists alongside the sidebar in that remap, so it is
 * repeated here for the same reason.
 */
.pf-v5-c-page__sidebar,
.pf-v5-c-page__header {
    --pf-v5-global--Color--100: var(--jz-chrome-text);
    --pf-v5-global--Color--200: var(--jz-chrome-muted);
    --pf-v5-global--Color--light-100: var(--jz-chrome-text);
    --pf-v5-global--Color--light-200: var(--jz-chrome-muted);
}

/* The sidebar's edge is its own token: a brand may mark the masthead with a
   thick accent rule and still want a plain hairline down the sidebar. */
.pf-v5-c-page__sidebar {
    border-inline-end: var(--jz-sidebar-rule);
}

/*
 * Navigation. The site's links are muted until you point at them, the current
 * one is full-strength text with an accent bar beside it, and nothing carries
 * a fill (Navigation.vue / Navbar.vue). PatternFly's defaults are the
 * light-on-dark set, so every one of them has to be restated.
 */
.pf-v5-c-nav {
    --pf-v5-c-nav__link--Color: var(--jz-nav-link);
    --pf-v5-c-nav__link--hover--Color: var(--jz-nav-current);
    --pf-v5-c-nav__link--focus--Color: var(--jz-nav-current);
    --pf-v5-c-nav__link--active--Color: var(--jz-nav-current);
    --pf-v5-c-nav__link--m-current--Color: var(--jz-nav-current);

    --pf-v5-c-nav__link--BackgroundColor: transparent;
    --pf-v5-c-nav__link--hover--BackgroundColor: var(--jz-nav-hover-bg);
    --pf-v5-c-nav__link--focus--BackgroundColor: var(--jz-nav-hover-bg);
    --pf-v5-c-nav__link--active--BackgroundColor: var(--jz-nav-current-bg);
    --pf-v5-c-nav__link--m-current--BackgroundColor: var(--jz-nav-current-bg);
    --pf-v5-c-nav__item--m-current--not--m-expanded__link--BackgroundColor: var(
        --jz-nav-current-bg
    );

    /* ::before is the hairline between items -- quiet. ::after is the bar
       beside the current item and inherits the brand from active-color--400. */
    --pf-v5-c-nav__link--before--BorderColor: var(--jz-nav-separator);
    --pf-v5-c-nav__item--before--BorderColor: var(--jz-nav-separator);
    --pf-v5-c-nav--c-divider--BackgroundColor: var(--jz-chrome-border);
    /* The flyout the collapsed sidebar opens is a chrome surface too. */
    --pf-v5-c-nav--c-menu--BackgroundColor: var(--jz-chrome-bg);
    --pf-v5-c-nav__item--m-flyout--c-menu--BackgroundColor: var(
        --jz-chrome-bg
    );

    --pf-v5-c-nav__section-title--Color: var(--jz-chrome-muted);
    --pf-v5-c-nav__section-title--BorderBottomColor: var(--jz-chrome-border);
    --pf-v5-c-nav__scroll-button--Color: var(--jz-chrome-text);

    --pf-v5-c-nav__link--FontWeight: 400;

    font-family: var(--jz-font-head);
}

/* PatternFly has no weight token for the current item. */
.pf-v5-c-nav__link.pf-m-current {
    font-weight: 600;
}

/*
 * PatternFly stacks the page heading and the page body in two separate
 * sections, so their paddings meet and leave a hole between the subtitle and
 * the first section heading. Half it on both sides.
 */
.pf-v5-c-page__main-section {
    --pf-v5-c-page__main-section--PaddingTop: 16px;
    --pf-v5-c-page__main-section--PaddingBottom: 16px;
}

/* --------------------------------------------------------------- headings */
.pf-v5-c-title {
    font-family: var(--jz-font-head);
    color: var(--jz-ink);
    line-height: 1.2;
}

/*
 * The page heading. The admin console does not use .pf-v5-c-title for it -- it
 * renders a bare <h1> inside .pf-v5-c-content -- so that shape is listed too,
 * scoped to the main region so the sidebar is not caught by it.
 */
.pf-v5-c-title.pf-m-2xl,
.pf-v5-c-title.pf-m-3xl,
.pf-v5-c-title.pf-m-4xl,
.pf-v5-c-page__main .pf-v5-c-content > h1 {
    font-family: var(--jz-font-head);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    color: var(--jz-ink);
    /* PatternFly already spaces the heading block; the site's own margin on
       top of that leaves a hole between the title and the line under it. */
    margin-bottom: 4px;
}

.pf-v5-c-title.pf-m-xl,
.pf-v5-c-title.pf-m-lg {
    font-weight: 700;
    color: var(--jz-ink);
}

/* Section labels in the sidebar take the site's eyebrow treatment. Scoped to
   titles inside a real .pf-v5-c-nav__section -- the admin console's realm row
   is also a __section-title but sits directly under .pf-v5-c-nav. */
.pf-v5-c-nav__section > .pf-v5-c-nav__section-title {
    font-size: var(--pf-v5-global--FontSize--xs);
    font-weight: 700;
    text-transform: var(--jz-eyebrow-transform);
    letter-spacing: var(--jz-eyebrow-spacing);
}

/* ---------------------------------------------------------------- buttons */
.pf-v5-c-button {
    --pf-v5-c-button--BorderRadius: var(--jz-radius-button);
    /* The outline is drawn by ::after, which has its own radius variable --
       set only the first and an outlined button gets a square ring. */
    --pf-v5-c-button--after--BorderRadius: var(--jz-radius-button);
    --pf-v5-c-button--FontWeight: 600;

    --pf-v5-c-button--m-primary--Color: var(--jz-on-primary);
    --pf-v5-c-button--m-primary--BackgroundColor: var(--jz-primary);
    --pf-v5-c-button--m-primary--hover--Color: var(--jz-on-primary-hover);
    --pf-v5-c-button--m-primary--hover--BackgroundColor: var(
        --jz-primary-hover-bg
    );
    --pf-v5-c-button--m-primary--focus--Color: var(--jz-on-primary-hover);
    --pf-v5-c-button--m-primary--focus--BackgroundColor: var(
        --jz-primary-hover-bg
    );
    --pf-v5-c-button--m-primary--active--Color: var(--jz-on-primary-hover);
    --pf-v5-c-button--m-primary--active--BackgroundColor: var(
        --jz-primary-hover-bg
    );

    --pf-v5-c-button--m-secondary--Color: var(--jz-ink);
    --pf-v5-c-button--m-secondary--BackgroundColor: var(--jz-secondary-bg);
    --pf-v5-c-button--m-secondary--after--BorderColor: var(
        --jz-secondary-border
    );
    --pf-v5-c-button--m-secondary--hover--Color: var(--jz-ink);
    --pf-v5-c-button--m-secondary--hover--BackgroundColor: var(
        --jz-secondary-hover-bg
    );
    --pf-v5-c-button--m-secondary--hover--after--BorderColor: var(
        --jz-secondary-hover-border
    );

    --pf-v5-c-button--m-link--Color: var(--jz-accent);
    --pf-v5-c-button--m-link--hover--Color: var(--jz-accent-strong);

    --pf-v5-c-button--m-danger--BackgroundColor: var(--jz-danger);
    --pf-v5-c-button--m-danger--hover--BackgroundColor: var(
        --jz-danger-strong
    );

    font-family: var(--jz-font-head);
}

/*
 * Padding is set in em so it tracks the label, and only on the variants that
 * actually paint a shape -- link and plain buttons stay text, and the controls
 * glued into an input group are excluded below.
 *
 * Room comes from a smaller label rather than a taller button: at PatternFly's
 * stock 1rem the button grows past the height of the inputs it shares a
 * toolbar with and breaks the row.
 */
.pf-v5-c-button.pf-m-primary,
.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-tertiary,
.pf-v5-c-button.pf-m-danger,
.pf-v5-c-button.pf-m-warning {
    --pf-v5-c-button--FontSize: 0.875rem;
    --pf-v5-c-button--PaddingTop: 0.55em;
    --pf-v5-c-button--PaddingBottom: 0.55em;
    --pf-v5-c-button--PaddingLeft: 1.3em;
    --pf-v5-c-button--PaddingRight: 1.3em;
}

/*
 * Case, tracking and weight are the call to action's, not every filled
 * variant's: a brand that sets its primary button in uppercase does not
 * usually shout on "Cancel" and "Delete" as well.
 *
 * The menu-toggle variant is listed with it because the console's call to
 * action is sometimes a split dropdown ("Assign role", "Add mapper") and
 * sometimes a plain button -- they have to read as the same control.
 */
.pf-v5-c-button.pf-m-primary,
.pf-v5-c-menu-toggle.pf-m-primary {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: var(--jz-shadow-button);
}

.pf-v5-c-button.pf-m-secondary {
    font-weight: var(--jz-secondary-weight);
}

.pf-v5-c-button.pf-m-secondary:hover {
    box-shadow: var(--jz-secondary-hover-shadow);
}

.pf-v5-c-button.pf-m-primary:hover {
    box-shadow: var(--jz-shadow-button-hover);
}

/* The compact variant keeps the same proportions at a smaller scale. */
.pf-v5-c-button.pf-m-small {
    --pf-v5-c-button--FontSize: 0.8125rem;
    --pf-v5-c-button--PaddingTop: 0.4em;
    --pf-v5-c-button--PaddingBottom: 0.4em;
    --pf-v5-c-button--PaddingLeft: 1.2em;
    --pf-v5-c-button--PaddingRight: 1.2em;
}

/* Icon-only buttons have no shape to round. */
.pf-v5-c-button.pf-m-plain,
.pf-v5-c-toggle-group .pf-v5-c-button {
    --pf-v5-c-button--BorderRadius: 0;
    --pf-v5-c-button--after--BorderRadius: 0;
    border-radius: 0;
}

/*
 * A control button, a dropdown and a menu toggle standing on their own are
 * fields: they take the field's corners and its horizontal inset. Squaring
 * everything with a toggle in it -- which an earlier revision did -- left the
 * console's filter dropdowns and typeahead selects as sharp boxes sitting next
 * to rounded text inputs.
 */
.pf-v5-c-button.pf-m-control,
.pf-v5-c-menu-toggle,
.pf-v5-c-dropdown__toggle {
    --pf-v5-c-button--BorderRadius: var(--jz-radius-field);
    --pf-v5-c-button--after--BorderRadius: var(--jz-radius-field);
    --pf-v5-c-button--PaddingLeft: var(--pf-v5-global--spacer--md);
    --pf-v5-c-button--PaddingRight: var(--pf-v5-global--spacer--md);
    --pf-v5-c-menu-toggle--BorderRadius: var(--jz-radius-field);

    border-radius: var(--jz-radius-field);
}

/*
 * Inside an input group the pair has to read as ONE control: rounding stays on
 * the outer edges only. Without this the text input kept all four corners and
 * the copy button glued to it stayed square, so the two looked like separate
 * controls that happened to touch.
 *
 * `> *` covers every shape the console glues together -- form control, text
 * input group, button, menu toggle -- and comes after the rules above so it
 * wins on order at equal specificity.
 */
.pf-v5-c-input-group > .pf-v5-c-input-group__item > * {
    border-radius: 0;
}

.pf-v5-c-input-group > .pf-v5-c-input-group__item:first-child > * {
    border-start-start-radius: var(--jz-radius-field);
    border-end-start-radius: var(--jz-radius-field);
}

.pf-v5-c-input-group > .pf-v5-c-input-group__item:last-child > * {
    border-start-end-radius: var(--jz-radius-field);
    border-end-end-radius: var(--jz-radius-field);
}

/* The button's ring is drawn by ::after and needs the same corners. */
.pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-button::after {
    border-radius: inherit;
}

/*
 * A search box, a filter dropdown and the button glued to it are fields, and
 * they sit next to real form fields in every console toolbar. Give them the
 * field's own fill and the same step-down text size, or they read as holes.
 */
.pf-v5-c-page__main .pf-v5-c-text-input-group {
    --pf-v5-c-text-input-group--BackgroundColor: var(--jz-field-bg);
}

/*
 * PAST -- a menu toggle is not always a field.
 *
 * The same component is the console's filter dropdown AND its call to action
 * ("Assign role", "Add mapper" are MenuToggle pf-m-primary, not buttons). An
 * earlier revision gave every non-plain toggle a flat `background-color`, which
 * beat `--m-primary--BackgroundColor` while the variant kept its own
 * light-on-dark text -- a white label on a cream fill, i.e. an invisible
 * button. Set the component's *token*, and only for the variants that do not
 * bring their own colours.
 */
.pf-v5-c-page__main
    .pf-v5-c-menu-toggle:not(.pf-m-plain, .pf-m-primary, .pf-m-secondary),
.pf-v5-c-page__main .pf-v5-c-select__toggle {
    --pf-v5-c-menu-toggle--BackgroundColor: var(--jz-field-bg);
    --pf-v5-c-menu-toggle--hover--BackgroundColor: var(--jz-field-bg);
    --pf-v5-c-menu-toggle--focus--BackgroundColor: var(--jz-field-bg);
    --pf-v5-c-menu-toggle--active--BackgroundColor: var(--jz-field-bg);
    --pf-v5-c-menu-toggle--m-expanded--BackgroundColor: var(--jz-field-bg);
}

/*
 * The toggle variants that ARE buttons take the button palette, so a dropdown
 * call to action and a plain one look like the same control.
 */
.pf-v5-c-menu-toggle {
    --pf-v5-c-menu-toggle--m-primary--Color: var(--jz-on-primary);
    --pf-v5-c-menu-toggle--m-primary--BackgroundColor: var(--jz-primary);
    --pf-v5-c-menu-toggle--m-primary--hover--BackgroundColor: var(
        --jz-primary-hover-bg
    );
    --pf-v5-c-menu-toggle--m-primary--focus--BackgroundColor: var(
        --jz-primary-hover-bg
    );
    --pf-v5-c-menu-toggle--m-primary--active--BackgroundColor: var(
        --jz-primary-hover-bg
    );
    --pf-v5-c-menu-toggle--m-primary--m-expanded--BackgroundColor: var(
        --jz-primary-hover-bg
    );
    --pf-v5-c-menu-toggle--m-primary--m-expanded--Color: var(
        --jz-on-primary-hover
    );
    --pf-v5-c-menu-toggle--m-primary--BorderRadius: var(--jz-radius-button);

    --pf-v5-c-menu-toggle--m-secondary--Color: var(--jz-ink);
    --pf-v5-c-menu-toggle--m-secondary--BackgroundColor: var(
        --jz-secondary-bg
    );
    --pf-v5-c-menu-toggle--m-secondary--before--BorderColor: var(
        --jz-secondary-border
    );
    --pf-v5-c-menu-toggle--m-secondary--hover--BackgroundColor: var(
        --jz-secondary-hover-bg
    );
    --pf-v5-c-menu-toggle--m-secondary--hover--before--BorderColor: var(
        --jz-secondary-hover-border
    );
    --pf-v5-c-menu-toggle--m-secondary--BorderRadius: var(--jz-radius-button);

    --pf-v5-c-menu-toggle--m-split-button--m-action--m-primary--child--BackgroundColor: var(
        --jz-primary
    );
    --pf-v5-c-menu-toggle--m-split-button--m-action--m-primary--child--hover--BackgroundColor: var(
        --jz-primary-hover-bg
    );
}

.pf-v5-c-page__main .pf-v5-c-text-input-group__text-input,
.pf-v5-c-page__main
    .pf-v5-c-menu-toggle:not(.pf-m-plain, .pf-m-primary, .pf-m-secondary),
.pf-v5-c-page__main .pf-v5-c-select__toggle {
    font-size: 0.875rem;
}

/*
 * PAST -- one control height, not per-component padding.
 *
 * PatternFly lays a toolbar out with `--pf-v5-c-toolbar--AlignItems--base:
 * flex-start` and assumes every control in the row is the same height; its own
 * are. Sizing fields by padding and buttons by em-padding, as an earlier
 * revision did, made a 39px search box sit next to a 30px button and a 20px
 * checkbox, all hanging from the top edge -- the "scattered toolbar".
 *
 * So: one height token for everything that reads as a control, and the row
 * centred through PatternFly's own alignment token.
 */
.pf-v5-c-page__main .pf-v5-c-toolbar {
    --pf-v5-c-toolbar--AlignItems--base: center;
}

.pf-v5-c-page__main .pf-v5-c-text-input-group,
.pf-v5-c-page__main .pf-v5-c-menu-toggle:not(.pf-m-plain),
.pf-v5-c-page__main .pf-v5-c-select__toggle,
.pf-v5-c-page__main .pf-v5-c-button.pf-m-control,
.pf-v5-c-page__main .pf-v5-c-button.pf-m-primary,
.pf-v5-c-page__main .pf-v5-c-button.pf-m-secondary,
.pf-v5-c-page__main .pf-v5-c-button.pf-m-tertiary,
.pf-v5-c-page__main .pf-v5-c-button.pf-m-danger,
.pf-v5-c-page__main .pf-v5-c-button.pf-m-warning,
.pf-v5-c-form-control {
    min-height: var(--jz-control-height);
}

/* The compact variant opts out -- it is meant to be smaller. */
.pf-v5-c-page__main .pf-v5-c-button.pf-m-small {
    min-height: 0;
}

/*
 * Height only -- never the inline padding. A search group reserves its left
 * inset for the magnifier through .pf-v5-c-text-input-group__text.pf-m-icon,
 * and overriding padding-inline on the input drops the icon on top of the
 * placeholder.
 */

/*
 * A control button is glued to a field, so its ring has to be the field's ring
 * on all four sides. PatternFly gives the bottom edge its own token, echoing
 * the underline of its own form controls -- ours are outlined boxes, so a
 * different colour there just draws a coloured hook around the corner once the
 * button is rounded.
 */
.pf-v5-c-page__main .pf-v5-c-button.pf-m-control {
    --pf-v5-c-button--m-control--BackgroundColor: var(--jz-surface);
    --pf-v5-c-button--m-control--hover--BackgroundColor: var(
        --jz-surface-soft
    );
    --pf-v5-c-button--m-control--after--BorderTopColor: var(
        --jz-field-outline
    );
    --pf-v5-c-button--m-control--after--BorderRightColor: var(
        --jz-field-outline
    );
    --pf-v5-c-button--m-control--after--BorderBottomColor: var(
        --jz-field-outline
    );
    --pf-v5-c-button--m-control--after--BorderLeftColor: var(
        --jz-field-outline
    );
}

/* ------------------------------------------------------------------ forms */
/*
 * The site's fields are fully outlined rounded boxes -- Vuetify's `outlined`
 * variant. PatternFly's are underlined: `::before` draws the top, right and
 * left borders with a zero-width bottom, and `::after` draws the bottom rule
 * that thickens on focus.
 *
 * So: close `::before` into a full frame, give both pseudo elements the
 * wrapper's radius, and switch the `::after` rule off in every state. The
 * frame colour is a single local variable, so the states below only have to
 * reassign that one name.
 */
.pf-v5-c-form-control {
    --jz-field-border: var(--jz-field-outline);

    --pf-v5-c-form-control--before--BorderTopColor: var(--jz-field-border);
    --pf-v5-c-form-control--before--BorderRightColor: var(--jz-field-border);
    --pf-v5-c-form-control--before--BorderBottomColor: var(--jz-field-border);
    --pf-v5-c-form-control--before--BorderLeftColor: var(--jz-field-border);
    --pf-v5-c-form-control--before--BorderBottomWidth: var(
        --pf-v5-global--BorderWidth--sm
    );

    --pf-v5-c-form-control--after--BorderBottomWidth: 0;
    --pf-v5-c-form-control--focus--after--BorderBottomWidth: 0;
    --pf-v5-c-form-control--m-expanded--after--BorderBottomWidth: 0;
    --pf-v5-c-form-control--m-success--after--BorderBottomWidth: 0;
    --pf-v5-c-form-control--m-warning--after--BorderBottomWidth: 0;
    --pf-v5-c-form-control--m-error--after--BorderBottomWidth: 0;
    --pf-v5-c-form-control--m-readonly--focus--after--BorderBottomWidth: 0;

    --pf-v5-c-form-control--BackgroundColor: var(--jz-field-bg);
    --pf-v5-c-form-control--m-placeholder--Color: var(--jz-muted);

    /* The site's controls are 50px tall; PatternFly ships 32px. Meeting it
       most of the way, with the text a step below body size. */
    --pf-v5-c-form-control--FontSize: 0.875rem;
    --pf-v5-c-form-control--inset--base: 11px;
    --pf-v5-global--spacer--form-element: 9px;

    border-radius: var(--jz-radius-field);
}

.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after {
    border-radius: inherit;
}

.pf-v5-c-form-control:hover {
    --jz-field-border: var(--jz-field-hover-border);
}

/*
 * The focus ring belongs on the wrapper, not the inner control. PatternFly's
 * .pf-v5-c-form-control is a <span> holding the real input, so an outline on
 * the input is drawn inside it and the wrapper's own frame covers its edges.
 */
.pf-v5-c-form-control:focus-within {
    --jz-field-border: var(--jz-field-focus-border);

    box-shadow: var(--jz-field-focus-ring);
}

.pf-v5-c-form-control.pf-m-error {
    --jz-field-border: var(--jz-danger);
}

.pf-v5-c-form-control > input:focus-visible,
.pf-v5-c-form-control > select:focus-visible,
.pf-v5-c-form-control > textarea:focus-visible {
    outline: none;
}

.pf-v5-c-form {
    --pf-v5-c-form__label-text--FontWeight: 600;
    --pf-v5-c-form__label-required--Color: var(--jz-danger);
    /* PatternFly gives the label column 9.375rem, which Czech labels overrun. */
    --pf-v5-c-form--m-horizontal__group-label--md--GridColumnWidth: 10rem;
}

.pf-v5-c-form__label-text {
    font-family: var(--jz-font-head);
    font-size: 0.875rem;
    text-transform: none;
}

/* --------------------------------------------------- cards, tabs, panels */
.pf-v5-c-card {
    --pf-v5-c-card--BackgroundColor: var(--jz-surface);
    --pf-v5-c-card--BoxShadow: var(--jz-shadow-card);

    border: 1px solid var(--jz-card-border);
    border-top: var(--jz-card-accent);
    border-radius: var(--jz-radius-card);
}

.pf-v5-c-tabs {
    --pf-v5-c-tabs__link--Color: var(--jz-muted);
    --pf-v5-c-tabs__item--m-current__link--Color: var(--jz-ink);
    --pf-v5-c-tabs__link--before--border-color--base: transparent;
    --pf-v5-c-tabs__item--m-current__link--after--BorderColor: var(
        --jz-primary
    );

    font-family: var(--jz-font-head);
}

/* No weight tokens on tabs either. */
.pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link {
    font-weight: 600;
}

.pf-v5-c-jump-links {
    --pf-v5-c-jump-links__link-text--Color: var(--jz-muted);
    --pf-v5-c-jump-links__link--hover__link-text--Color: var(--jz-ink);
    --pf-v5-c-jump-links__item--m-current__link-text--Color: var(--jz-ink);
    --pf-v5-c-jump-links__list--before--BorderColor: var(--jz-border);
    --pf-v5-c-jump-links__item--m-current__link--before--BorderColor: var(
        --jz-primary
    );
}

.pf-v5-c-switch {
    --pf-v5-c-switch__input--checked__toggle--BackgroundColor: var(
        --jz-primary
    );
}

.pf-v5-c-label {
    --pf-v5-c-label--BorderRadius: var(--jz-radius-pill);
}

/* Dropdown panels are surfaces like a card, not bare boxes. */
.pf-v5-c-menu {
    --pf-v5-c-menu--BoxShadow: var(--jz-shadow-card);

    border-radius: var(--jz-radius-control);
}

.pf-v5-c-menu__content {
    border-radius: inherit;
}

/* Neither the alert nor the modal box has a radius token. */
.pf-v5-c-alert {
    border-radius: var(--jz-radius-control);
}

.pf-v5-c-modal-box {
    --pf-v5-c-modal-box--BoxShadow: var(--jz-shadow-card-hover);

    border-radius: var(--jz-radius-card);
}

/* -------------------------------------------------------------- tables */
/*
 * PAST -- PatternFly aligns table cells on the text baseline
 * (`td { vertical-align: baseline }`), which only looks centred while the type
 * scale is PatternFly's own. With the site's scale a row's checkbox, its text
 * and its kebab menu end up on three different lines. A data row is a single
 * line of related things, so centre them.
 */
.pf-v5-c-table > thead > tr > *,
.pf-v5-c-table > tbody > tr > * {
    vertical-align: middle;
}

/*
 * PAST -- in a data grid the link IS the navigation, and the brand's "links do
 * not underline" rule takes away its only affordance. Colour alone is not
 * enough when the accent sits close to the body colour, so a table link always
 * underlines on hover, and a brand whose accent is too close to its ink says so
 * with --jz-table-link-decoration.
 */
.pf-v5-c-table a,
.pf-v5-c-data-list a:not(.pf-v5-c-button) {
    text-decoration: var(--jz-table-link-decoration);
    text-underline-offset: 0.2em;
}

.pf-v5-c-table a:hover,
.pf-v5-c-table a:focus-visible,
.pf-v5-c-data-list a:not(.pf-v5-c-button):hover,
.pf-v5-c-data-list a:not(.pf-v5-c-button):focus-visible {
    text-decoration: underline;
}

/* --------------------------------------------------- lists and statuses */
/*
 * The account console lists sessions and credentials in a data list rather
 * than a table, and without help it has none of the site's list treatment --
 * so the same information looks like two different products depending on
 * which console you opened.
 */
.pf-v5-c-data-list {
    --pf-v5-c-data-list--BorderTopColor: var(--jz-border);
    --pf-v5-c-data-list__item--BorderBottomColor: var(--jz-border);
}

/*
 * The unit to paint is the ROW, not the item. Device activity renders every
 * session as a .pf-v5-c-data-list__item-row inside ONE
 * .pf-v5-c-data-list__item, so colouring the item paints the whole list as a
 * single slab with no boundary anywhere.
 */
.pf-v5-c-data-list > .pf-v5-c-data-list__item {
    background-color: transparent;
    border-block-end-color: var(--jz-border);
}

/*
 * Two shapes to cover. A list of sessions is one item holding many rows, and
 * there the row is the unit. A single-row item (a credential, an "is not set
 * up" notice) is the panel itself -- its row shrinks to its content and can
 * sit centred, so filling the row there paints a band floating mid-page.
 */
.pf-v5-c-data-list__item-row:not(:only-child):nth-of-type(odd) {
    background-color: var(--jz-zebra);
}

.pf-v5-c-data-list__item-row + .pf-v5-c-data-list__item-row {
    border-block-start: 1px solid var(--jz-border);
}

.pf-v5-c-data-list__item-row:not(:only-child):hover {
    background-color: var(--jz-row-hover);
}

.pf-v5-c-data-list
    > .pf-v5-c-data-list__item:has(> .pf-v5-c-data-list__item-row:only-child) {
    background-color: var(--jz-surface-soft);
}

/*
 * Inside a row PatternFly gives the label and the value the same ink and 24px
 * of gap, so a session reads as a wall of equally weighted text. Demote the
 * label the way the site's table header is demoted against its cells, and pull
 * the grid together so one session is a block you can take in at a glance.
 */
.pf-v5-c-data-list .pf-v5-c-description-list {
    --pf-v5-c-description-list--RowGap: 14px;
    --pf-v5-c-description-list__group--RowGap: 2px;
}

.pf-v5-c-data-list .pf-v5-c-description-list__term {
    font-family: var(--jz-font-head);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--jz-muted);
    text-transform: var(--jz-eyebrow-transform);
    letter-spacing: var(--jz-eyebrow-spacing);
}

.pf-v5-c-data-list .pf-v5-c-description-list__description {
    font-size: var(--pf-v5-global--FontSize--sm);
}

/*
 * Status pills. PatternFly ships them in its own semantic palette -- the
 * "current session" marker is pale green, the realm marker pale blue -- and
 * both fight a page built from one accent. Danger keeps its red, because that
 * one carries meaning the brand cannot replace.
 */
.pf-v5-c-page__main .pf-v5-c-label.pf-m-green,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-blue,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-cyan,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-purple {
    background-color: var(--jz-accent-soft);
}

.pf-v5-c-page__main .pf-v5-c-label.pf-m-green .pf-v5-c-label__content,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-blue .pf-v5-c-label__content,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-cyan .pf-v5-c-label__content,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-purple .pf-v5-c-label__content {
    color: var(--jz-accent-strong);
}

.pf-v5-c-page__main .pf-v5-c-label.pf-m-green .pf-v5-c-label__content::before,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-blue .pf-v5-c-label__content::before,
.pf-v5-c-page__main .pf-v5-c-label.pf-m-cyan .pf-v5-c-label__content::before,
.pf-v5-c-page__main
    .pf-v5-c-label.pf-m-purple
    .pf-v5-c-label__content::before {
    border-color: transparent;
}

/* ---------------------------------------------------------------- misc */
::selection {
    background: var(--jz-primary-soft-md);
    color: var(--jz-ink);
}

/*
 * Safety net. theme.properties sets darkMode=false so index.ftl never adds
 * this class, but a page cached from an earlier build still carries it and
 * would otherwise get PatternFly's dark palette on our light surfaces.
 * `:where` keeps the specificity at zero so nothing above is disturbed.
 */
:where(.pf-v5-theme-dark) {
    --pf-v5-global--BackgroundColor--100: var(--jz-surface);
    --pf-v5-global--BackgroundColor--200: var(--jz-surface-soft);
    --pf-v5-global--Color--100: var(--jz-ink);
    --pf-v5-global--Color--200: var(--jz-muted);
}

/* Visible focus and selection on the festival's black chrome. */
.pf-v5-c-masthead :focus-visible, .pf-v5-c-page__sidebar :focus-visible {
    outline-color: var(--jz-chrome-link);
}
.pf-v5-c-nav { --pf-v5-c-nav__link--after--BorderColor: var(--jz-chrome-link); }
.pf-v5-c-masthead__brand img {
    height: 70px;
    max-height: none;
    max-width: none;
    width: auto;
}

/* A two-row masthead keeps the full account menu reachable on narrow phones. */
@media (max-width: 600px) {
    .pf-v5-c-masthead {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding-block: 0 8px;
    }
    .pf-v5-c-masthead__main,
    .pf-v5-c-masthead__content {
        flex: 1 1 100%;
        min-width: 0;
        margin-inline: 0;
    }
    .pf-v5-c-masthead .pf-v5-c-toolbar,
    .pf-v5-c-masthead .pf-v5-c-toolbar__content {
        width: 100%;
        min-width: 0;
    }
    .pf-v5-c-masthead .pf-v5-c-toolbar__content-section {
        flex-wrap: wrap;
        min-width: 0;
    }
}
