/*
  Peikko look for the Keycloak admin console (PatternFly 5).
  Brand book colors and the REM font, in a quiet, minimal style like Vercel and Resend:
  white surfaces, thin grey borders, small text, dark buttons, orange only as an accent.
  Most rules change PatternFly's CSS variables, so Keycloak upgrades rarely break them.
  Some Keycloak chunks (DropdownPanel, DatePicker, ToggleGroup, CodeEditor) load after this file,
  so their overrides carry an extra "html" or parent class for specificity.
*/

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

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

:root {
  /* Brand book colors */
  --peikko-orange: #ff8200; /* Forerunner Orange: accents only, too light for text on white */
  --peikko-dark: #333a47; /* Structure Dark: text and primary buttons */
  --peikko-light: #e8ecef; /* Clarity Light: borders, active items */
  --peikko-turquoise: #30c2dd; /* Precision Turquoise */
  --peikko-green: #a2c73a; /* Circular Green */
  --peikko-mist: #f7f9fa; /* Blueprint Mist: soft surfaces */
  /* Steel Grey #6f7a83 is 4.4:1 on white, just under AA for small text.
     Text uses a slightly darker steel (5.5:1); icons keep the brand value. */
  --peikko-steel: #5f6a74;
  --peikko-icon-muted: #6f7a83;

  --peikko-dark-hover: #252a34;
  --peikko-hover: #eef1f3;
  --peikko-border-strong: #cfd6dc;
  --peikko-disabled-text: #8a939b;
  --peikko-ring: 0 0 0 3px rgba(51, 58, 71, 0.15);
  /* Keyboard focus on buttons, toggles, tabs and links: white gap plus a 2px ring (3:1 on white). */
  --peikko-ring-strong: 0 0 0 2px #ffffff, 0 0 0 4px rgba(51, 58, 71, 0.6);
  --peikko-shadow-sm: 0 1px 2px rgba(51, 58, 71, 0.06);
  --peikko-shadow-md: 0 8px 24px rgba(51, 58, 71, 0.1);
  --peikko-radius: 8px;
  --peikko-radius-lg: 12px;
  --peikko-font: "REM", system-ui, -apple-system, "Segoe UI", sans-serif;
  --peikko-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  /* One left and right edge for breadcrumb, title, tabs, toolbars, lists and form cards. */
  --peikko-gutter: 32px;

  /* Font and smaller, denser type scale */
  --pf-v5-global--FontFamily--text: var(--peikko-font);
  --pf-v5-global--FontFamily--heading: var(--peikko-font);
  --pf-v5-global--FontFamily--redhat-updated--text: var(--peikko-font);
  --pf-v5-global--FontFamily--redhat-updated--heading: var(--peikko-font);
  --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: 1rem;
  --pf-v5-global--FontSize--xl: 1.125rem;
  --pf-v5-global--FontSize--2xl: 1.375rem;
  --pf-v5-global--FontSize--3xl: 1.625rem;
  --pf-v5-global--FontSize--4xl: 2rem;

  /* Colors */
  --pf-v5-global--Color--100: var(--peikko-dark);
  --pf-v5-global--Color--200: var(--peikko-steel);
  /* Menus, tables, inputs, alerts, chips and data lists switch to these "dark" tokens. */
  --pf-v5-global--Color--dark-100: var(--peikko-dark);
  --pf-v5-global--Color--dark-200: var(--peikko-steel);
  --pf-v5-global--BorderColor--dark-100: var(--peikko-light);
  --pf-v5-global--icon--Color--light: var(--peikko-icon-muted);
  --pf-v5-global--icon--Color--dark: var(--peikko-dark);
  --pf-v5-global--BackgroundColor--100: #ffffff;
  --pf-v5-global--BackgroundColor--200: #ffffff;
  --pf-v5-global--BorderColor--100: var(--peikko-light);
  --pf-v5-global--BorderColor--300: var(--peikko-light);
  --pf-v5-global--primary-color--100: var(--peikko-dark);
  --pf-v5-global--primary-color--200: var(--peikko-dark-hover);
  --pf-v5-global--primary-color--dark-100: var(--peikko-dark);
  --pf-v5-global--link--Color: var(--peikko-dark);
  --pf-v5-global--link--Color--hover: var(--peikko-dark);
  --pf-v5-global--link--Color--dark: var(--peikko-dark);
  --pf-v5-global--link--Color--dark--hover: var(--peikko-dark);
  --pf-v5-global--active-color--100: var(--peikko-dark);

  /* Disabled states in brand greys instead of PatternFly's #6a6e73 / #d2d2d2 / #f0f0f0 */
  --pf-v5-global--disabled-color--100: var(--peikko-disabled-text);
  --pf-v5-global--disabled-color--200: var(--peikko-border-strong);
  --pf-v5-global--disabled-color--300: var(--peikko-mist);

  /* Status colors: warning icons in a darker Forerunner Orange (3.3:1 on white) instead of gold,
     info icons in a deeper Precision Turquoise instead of PatternFly blue. */
  --pf-v5-global--warning-color--100: #d97000;
  --pf-v5-global--warning-color--200: #7a4300;
  --pf-v5-global--info-color--100: #1fa8c4;
  --pf-v5-global--info-color--200: var(--peikko-dark);

  --pf-v5-global--BorderRadius--sm: var(--peikko-radius);
  --pf-v5-global--BorderRadius--lg: var(--peikko-radius-lg);
  --pf-v5-global--BoxShadow--sm: var(--peikko-shadow-sm);
  --pf-v5-global--BoxShadow--md: var(--peikko-shadow-md);
  --pf-v5-global--BoxShadow--lg: 0 12px 32px rgba(51, 58, 71, 0.12);

  /* Outline icons (Lucide style). A glyph is swapped by masking the existing svg with one of these. */
  --peikko-i-chevron-down: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  --peikko-i-chevron-left: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m15 18-6-6 6-6'/></svg>");
  --peikko-i-chevron-right: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>");
  --peikko-i-search: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  --peikko-i-arrow-right: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/><path d='m12 5 7 7-7 7'/></svg>");
  --peikko-i-refresh: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/><path d='M21 3v5h-5'/><path d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/><path d='M8 16H3v5'/></svg>");
  --peikko-i-external: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 7h10v10'/><path d='M7 17 17 7'/></svg>");
  --peikko-i-ellipsis-v: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='1'/><circle cx='12' cy='5' r='1'/><circle cx='12' cy='19' r='1'/></svg>");
  --peikko-i-help: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/><path d='M12 17h.01'/></svg>");
  --peikko-i-panel-left: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='18' height='18' x='3' y='3' rx='2'/><path d='M9 3v18'/></svg>");
  --peikko-i-copy: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='14' height='14' x='8' y='8' rx='2'/><path d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/></svg>");
  --peikko-i-database: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='5' rx='9' ry='3'/><path d='M3 5v14a9 3 0 0 0 18 0V5'/><path d='M3 12a9 3 0 0 0 18 0'/></svg>");
  --peikko-i-x: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18'/><path d='m6 6 12 12'/></svg>");
  --peikko-i-table: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2'/><path d='M3 9h18'/><path d='M3 15h18'/><path d='M9 3v18'/></svg>");
  --peikko-i-diagram: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='8' height='8' rx='2'/><path d='M7 11v4a2 2 0 0 0 2 2h4'/><rect x='13' y='13' width='8' height='8' rx='2'/></svg>");
  --peikko-i-filter: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h18'/><path d='M7 12h10'/><path d='M10 18h4'/></svg>");
  --peikko-i-check: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
  --peikko-i-minus: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'><path d='M6 12h12'/></svg>");
  --peikko-i-check-line: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
  --peikko-i-plus: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/><path d='M12 5v14'/></svg>");
  --peikko-i-circle-plus: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M8 12h8'/><path d='M12 8v8'/></svg>");
  --peikko-i-trash: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h18'/><path d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/><path d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/></svg>");
  --peikko-i-inbox: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-6l-2 3h-4l-2-3H2'/><path d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/></svg>");
  --peikko-i-settings: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/><circle cx='12' cy='12' r='3'/></svg>");
  --peikko-i-eye: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.06 12.35a1 1 0 0 1 0-.7 10.75 10.75 0 0 1 19.88 0 1 1 0 0 1 0 .7 10.75 10.75 0 0 1-19.88 0'/><circle cx='12' cy='12' r='3'/></svg>");
  --peikko-i-eye-off: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68'/><path d='M6.61 6.61A13.53 13.53 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61'/><path d='m2 2 20 20'/><path d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/></svg>");
  --peikko-i-calendar: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='18' height='18' x='3' y='4' rx='2'/><path d='M16 2v4'/><path d='M8 2v4'/><path d='M3 10h18'/></svg>");
  --peikko-i-grip: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='12' r='1'/><circle cx='9' cy='5' r='1'/><circle cx='9' cy='19' r='1'/><circle cx='15' cy='12' r='1'/><circle cx='15' cy='5' r='1'/><circle cx='15' cy='19' r='1'/></svg>");
  --peikko-i-pencil: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z'/><path d='m15 5 4 4'/></svg>");
  --peikko-i-chevrons-up-down: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m7 15 5 5 5-5'/><path d='m7 9 5-5 5 5'/></svg>");
  --peikko-i-user: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
  --peikko-i-info: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 16v-4'/><path d='M12 8h.01'/></svg>");
  --peikko-i-log-out: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><path d='m16 17 5-5-5-5'/><path d='M21 12H9'/></svg>");
  --peikko-i-clock: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>");
  --peikko-i-activity: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>");
  --peikko-i-workflow: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='8' height='8' rx='2'/><path d='M7 11v4a2 2 0 0 0 2 2h4'/><rect x='13' y='13' width='8' height='8' rx='2'/></svg>");
  --peikko-i-zap: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z'/></svg>");
  --peikko-i-git-branch: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='6' x2='6' y1='3' y2='15'/><circle cx='18' cy='6' r='3'/><circle cx='6' cy='18' r='3'/><path d='M18 9a9 9 0 0 1-9 9'/></svg>");
  --peikko-i-diamond: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z'/></svg>");
  --peikko-i-map-pin: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0'/><circle cx='12' cy='10' r='3'/></svg>");
  --peikko-i-circle-check: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m9 12 2 2 4-4'/></svg>");
  --peikko-i-box: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/><path d='m3.3 7 8.7 5 8.7-5'/><path d='M12 22V12'/></svg>");
  --peikko-i-key: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z'/><circle cx='16.5' cy='7.5' r='.5' fill='black'/></svg>");
}

/* Selected text in a Precision Turquoise tint instead of the browser blue. */
::selection {
  color: var(--peikko-dark);
  background-color: rgba(48, 194, 221, 0.25);
}

@media (max-width: 767.98px) {
  :root {
    --peikko-gutter: 16px;
  }
}

body {
  font-family: var(--peikko-font);
  font-size: 15px;
  color: var(--peikko-dark);
  -webkit-font-smoothing: antialiased;
}

/* Links: brand dark, orange underline on hover. */
a:not(.pf-v5-c-button):not(.pf-v5-c-nav__link):not(.pf-v5-c-tabs__link) {
  color: var(--peikko-dark);
}

a:hover,
.pf-v5-c-button.pf-m-link:hover {
  text-decoration-color: var(--peikko-orange);
  text-underline-offset: 3px;
}

.pf-v5-c-table tbody a {
  font-weight: 500;
}

/* One keyboard focus ring for buttons, toggles, tabs and links. Inputs keep a dark border plus a soft ring. */
:is(.pf-v5-c-button, .pf-v5-c-menu-toggle, .pf-v5-c-tabs__link, a):focus-visible {
  outline: none;
  box-shadow: var(--peikko-ring-strong);
  border-radius: var(--peikko-radius);
}

/* Short color transitions, like Vercel and shadcn. */
:is(.pf-v5-c-button, .pf-v5-c-menu-toggle, .pf-v5-c-nav__link, .pf-v5-c-tabs__link, .pf-v5-c-menu__list-item, .pf-v5-c-table td, .pf-v5-c-switch__toggle, a),
:is(.pf-v5-c-form-control, .pf-v5-c-menu-toggle)::before {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    text-decoration-color 0.15s ease;
}

/* ---------- Loading screen (before the console starts) ---------- */

/* Keycloak's inline splash also has a dark-scheme rule; same specificity, this file loads later. */
.keycloak__loading-container {
  gap: 20px;
  color: var(--peikko-dark);
  background-color: #ffffff;
}

.keycloak__loading-container::before {
  content: "";
  width: 40px;
  height: 42px;
  background: url("../img/pd-logomark.svg") center / contain no-repeat;
}

.keycloak__loading-container .pf-v5-c-spinner {
  --pf-v5-c-spinner--m-xl--diameter: 28px;
  --pf-v5-c-spinner--diameter: 28px;
  --pf-v5-c-spinner--Color: var(--peikko-icon-muted);
}

.keycloak__loading-container #loading-text {
  padding-top: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--peikko-steel);
}

/* Keycloak's second loading step puts a bare spinner straight in #app.
   It keeps the splash look, so the loader doesn't jump to the corner. */
#app:has(> .pf-v5-c-spinner:only-child) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 100vh;
  background-color: #ffffff;
}

#app:has(> .pf-v5-c-spinner:only-child)::before {
  content: "";
  width: 40px;
  height: 42px;
  background: url("../img/pd-logomark.svg") center / contain no-repeat;
}

#app:has(> .pf-v5-c-spinner:only-child)::after {
  content: "Loading the Administration Console";
  font-size: 14px;
  color: var(--peikko-steel);
}

#app > .pf-v5-c-spinner:only-child {
  --pf-v5-c-spinner--diameter: 28px;
  --pf-v5-c-spinner--m-xl--diameter: 28px;
  --pf-v5-c-spinner--Color: var(--peikko-icon-muted);
}

/* ---------- Top bar ---------- */

.pf-v5-c-masthead {
  --pf-v5-c-masthead--BackgroundColor: #ffffff;
  --pf-v5-global--Color--100: var(--peikko-dark);
  --pf-v5-global--Color--200: var(--peikko-steel);
  --pf-v5-c-button--m-plain--Color: var(--peikko-icon-muted);
  --pf-v5-c-button--m-plain--hover--Color: var(--peikko-dark);
  --pf-v5-c-menu-toggle--Color: var(--peikko-dark);
  --pf-v5-c-menu-toggle--m-plain--Color: var(--peikko-icon-muted);
  --pf-v5-c-menu-toggle--m-plain--hover--Color: var(--peikko-dark);
  --pf-v5-c-masthead--c-toolbar--BackgroundColor: transparent;
  --pf-v5-c-masthead--m-display-inline__main--MinHeight: 60px;
  --pf-v5-c-masthead--m-display-inline__content--MinHeight: 60px;
  --pf-v5-c-masthead--m-display-stack__main--MinHeight: 60px;
  --pf-v5-c-masthead--m-display-stack__content--MinHeight: 60px;
  --pf-v5-c-masthead__main--MinHeight: 60px;
  --pf-v5-c-masthead__content--MinHeight: 60px;
  --pf-v5-c-masthead__toggle--MarginLeft: -6px;
  --pf-v5-c-masthead__toggle--MarginRight: 10px;
  /* 16px at every width, so the panel toggle sits over the sidebar icon column. */
  --pf-v5-c-masthead--xl--inset: 16px;
  color: var(--peikko-dark);
  border-bottom: 1px solid var(--peikko-light);
  box-shadow: none;
}

/* PatternFly's dark-masthead rule sets light colors on the plain buttons themselves,
   which made the sidebar toggle almost white on white. */
.pf-v5-c-masthead .pf-v5-c-button.pf-m-plain {
  --pf-v5-global--Color--100: var(--peikko-dark);
  --pf-v5-global--Color--200: var(--peikko-steel);
  --pf-v5-c-button--m-plain--Color: var(--peikko-icon-muted);
  --pf-v5-c-button--m-plain--hover--Color: var(--peikko-dark);
  --pf-v5-c-button--m-plain--focus--Color: var(--peikko-dark);
  --pf-v5-c-button--m-plain--active--Color: var(--peikko-dark);
}

.pf-v5-c-masthead .pf-v5-c-toolbar {
  --pf-v5-c-toolbar--PaddingTop: 0;
  --pf-v5-c-toolbar--PaddingBottom: 0;
}

.pf-v5-c-masthead .pf-v5-c-brand,
.pf-v5-c-masthead__brand img {
  height: 26px;
  width: auto;
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle::before,
.pf-v5-c-masthead .pf-v5-c-menu-toggle::after {
  border: none;
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle,
.pf-v5-c-masthead .pf-v5-c-button.pf-m-plain {
  border-radius: var(--peikko-radius);
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle:hover,
.pf-v5-c-masthead .pf-v5-c-button.pf-m-plain:hover {
  background-color: var(--peikko-hover);
}

/* PatternFly sets the plain toggle color on the toggle itself, so the masthead token above never reaches it. */
.pf-v5-c-masthead .pf-v5-c-menu-toggle.pf-m-plain {
  color: var(--peikko-icon-muted);
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle.pf-m-plain:hover {
  color: var(--peikko-dark);
}

/* The trigger of an open menu stays pressed while the pointer is in the menu.
   Keycloak never marks #help as expanded; its menu is the next sibling while open. */
.pf-v5-c-masthead .pf-v5-c-menu-toggle.pf-m-expanded,
.pf-v5-c-masthead #help:has(+ .pf-v5-c-menu) {
  color: var(--peikko-dark);
  background-color: var(--peikko-hover);
}

/* Square 36px icon buttons */
.pf-v5-c-masthead #nav-toggle,
.pf-v5-c-masthead .pf-v5-c-menu-toggle.pf-m-plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle:not(.pf-m-plain) {
  height: 36px;
  padding: 0 8px 0 10px;
  gap: 6px;
  font-weight: 500;
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle__toggle-icon {
  color: var(--peikko-icon-muted);
}

.pf-v5-c-masthead .pf-v5-c-menu-toggle:not(.pf-m-plain) .pf-v5-c-menu-toggle__controls {
  padding-left: 0;
}

/* Room around the logo so the focus ring doesn't touch it; the negative margin keeps the layout. */
.pf-v5-c-masthead__brand {
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: var(--peikko-radius);
}

.pf-v5-c-masthead__brand:focus-visible {
  outline: none;
  box-shadow: var(--peikko-ring-strong);
  border-radius: var(--peikko-radius);
}

/* Right cluster flush right at every width: help, avatar, then the user name. */
.pf-v5-c-masthead .pf-v5-c-toolbar__content-section {
  justify-content: flex-end;
  gap: 4px;
}

.pf-v5-c-masthead .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item {
  margin-inline-start: 0;
  margin-inline-end: 0;
}

.pf-v5-c-masthead .pf-v5-c-toolbar__item.pf-m-overflow-menu {
  order: 1;
}

.pf-v5-c-masthead .pf-v5-c-toolbar__item:has(> [data-testid="options-toggle"]),
.pf-v5-c-masthead .pf-v5-c-toolbar__item:has(> [data-testid="options-kebab-toggle"]) {
  order: 2;
}

/* Avatar, name and chevron form one account button: the avatar sits on the toggle's left padding
   and lets clicks through to it. Only where the name toggle is shown (768px and up). */
@media (min-width: 768px) {
  .pf-v5-c-masthead .pf-v5-c-toolbar__item.pf-m-overflow-menu:has(> .pf-v5-c-avatar) {
    position: relative;
    z-index: 1;
    pointer-events: none;
  }

  .pf-v5-c-masthead .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:has(#help) {
    margin-inline-end: 8px;
  }

  .pf-v5-c-masthead .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:has(> [data-testid="options-toggle"]) {
    margin-inline-start: -36px;
  }

  .pf-v5-c-masthead .pf-v5-c-menu-toggle:not(.pf-m-plain)[data-testid="options-toggle"] {
    padding-left: 40px;
  }
}

/* Phones: the avatar sits on the kebab and becomes its face, so the account menu opens from the avatar
   (one tap target, like Vercel's mobile header). Clicks pass through to the kebab. */
@media (max-width: 767.98px) {
  .pf-v5-c-masthead .pf-v5-c-toolbar__item.pf-m-overflow-menu:has(> .pf-v5-c-avatar) {
    position: relative;
    z-index: 1;
    order: 3;
    margin-inline-start: -32px !important; /* PatternFly's toolbar spacer */
    margin-inline-end: 4px !important;
    pointer-events: none;
  }

  .pf-v5-c-masthead [data-testid="options-kebab-toggle"] > svg {
    visibility: hidden;
  }
}

/* Avatar: a small brand gradient circle instead of PatternFly's grey silhouette. */
.pf-v5-c-masthead .pf-v5-c-avatar {
  --pf-v5-c-avatar--Width: 28px;
  --pf-v5-c-avatar--Height: 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 50%),
    linear-gradient(135deg, var(--peikko-turquoise), var(--peikko-green));
  box-shadow: inset 0 0 0 1px rgba(51, 58, 71, 0.08);
}

.pf-v5-c-masthead .pf-v5-c-avatar > * {
  display: none;
}

/* Help and user menus: a small gap under the trigger, and wrapped descriptions. */
.pf-v5-c-masthead .pf-v5-c-menu {
  margin-top: 6px;
  max-width: 320px;
}

.pf-v5-c-masthead .pf-v5-c-menu .pf-v5-c-menu__item-description {
  white-space: normal;
}

/* 'Enable help mode': the switch has an empty on/off label, so drop the gap before it and the toggle
   ends on the menu's text edge. */
.pf-v5-c-menu .keycloak_help-header-switch {
  --pf-v5-c-switch--ColumnGap: 0px;
}

/* Account menu (desktop and the phone kebab): wider than Popper's toggle-width minimum, an outline icon
   per row, and Sign out set apart below a divider. */
.pf-v5-c-masthead .pf-v5-c-menu:has(#manage-account) {
  min-width: 200px !important; /* Popper sets an inline min-width */
}

.pf-v5-c-masthead .pf-v5-c-menu:has(#manage-account) .pf-v5-c-menu__item {
  --peikko-menu-i: var(--peikko-i-log-out);
}

.pf-v5-c-masthead .pf-v5-c-menu:has(#manage-account) #manage-account {
  --peikko-menu-i: var(--peikko-i-user);
}

.pf-v5-c-masthead .pf-v5-c-menu:has(#manage-account) a.pf-v5-c-menu__item[href] {
  --peikko-menu-i: var(--peikko-i-info);
}

.pf-v5-c-masthead .pf-v5-c-menu:has(#manage-account) .pf-v5-c-menu__item:not(:has(.pf-v5-c-menu__item-icon)) .pf-v5-c-menu__item-main::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  background-color: var(--peikko-icon-muted);
  -webkit-mask: var(--peikko-menu-i) center / contain no-repeat;
  mask: var(--peikko-menu-i) center / contain no-repeat;
}

.pf-v5-c-masthead .pf-v5-c-menu:has(#manage-account) .pf-v5-c-menu__item:hover .pf-v5-c-menu__item-main::before {
  background-color: var(--peikko-dark);
}

.pf-v5-c-masthead .pf-v5-c-menu__list:has(> li > #manage-account) > .pf-v5-c-menu__list-item:last-child:not(:first-child) {
  position: relative;
  margin-top: 9px;
}

.pf-v5-c-masthead .pf-v5-c-menu__list:has(> li > #manage-account) > .pf-v5-c-menu__list-item:last-child:not(:first-child)::before {
  content: "";
  position: absolute;
  inset-inline: -4px;
  top: -5px;
  height: 1px;
  background: var(--peikko-light);
}

/* Phones: keep toggle, logo and actions on one row. */
.pf-v5-c-masthead:not([class*="pf-m-display-inline"]) {
  --pf-v5-c-masthead--GridTemplateColumns: max-content minmax(0, max-content) 1fr;
}

.pf-v5-c-masthead:not([class*="pf-m-display-inline"]) .pf-v5-c-masthead__content {
  grid-column: 3 / -1;
  grid-row: 1;
  margin-inline-start: 8px;
}

/* ---------- Sidebar ---------- */

.pf-v5-c-page {
  --pf-v5-c-page__sidebar--Width: 256px;
  --pf-v5-c-page__sidebar--xl--Width: 256px;
}

.pf-v5-c-page__sidebar {
  --pf-v5-c-page__sidebar--BackgroundColor: #ffffff;
  --pf-v5-global--Color--100: var(--peikko-dark);
  --pf-v5-global--Color--200: var(--peikko-steel);
  border-right: 1px solid var(--peikko-light);
  box-shadow: none;
}

.pf-v5-c-page__sidebar.pf-m-collapsed {
  border-right-width: 0;
}

.pf-v5-c-page__sidebar.pf-m-expanded {
  box-shadow: none;
}

/* Below 1200px the sidebar opens over the content. */
@media (max-width: 1199.98px) {
  .pf-v5-c-page__sidebar.pf-m-expanded {
    box-shadow: 8px 0 24px rgba(51, 58, 71, 0.08);
  }
}

.pf-v5-c-page__sidebar-body {
  overflow-x: hidden;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav {
  --pf-v5-c-nav__link--Color: var(--peikko-steel);
  --pf-v5-c-nav__link--BackgroundColor: transparent;
  --pf-v5-c-nav__link--hover--Color: var(--peikko-dark);
  /* Lighter than the current item's pill, so a hovered item doesn't look selected. */
  --pf-v5-c-nav__link--hover--BackgroundColor: #f2f4f6;
  --pf-v5-c-nav__link--m-current--Color: var(--peikko-dark);
  --pf-v5-c-nav__link--m-current--BackgroundColor: var(--peikko-light);
  /* PatternFly's dark sidebar turns a clicked or focused item black; keep it light. */
  --pf-v5-c-nav__link--focus--Color: var(--peikko-dark);
  --pf-v5-c-nav__link--focus--BackgroundColor: #f2f4f6;
  --pf-v5-c-nav__link--active--Color: var(--peikko-dark);
  --pf-v5-c-nav__link--active--BackgroundColor: var(--peikko-light);
  --pf-v5-c-nav__link--before--BorderColor: transparent;
  --pf-v5-c-nav__link--after--BorderColor: transparent;
  --pf-v5-c-nav__link--hover--after--BorderColor: transparent;
  --pf-v5-c-nav__link--m-current--after--BorderColor: transparent;
  --pf-v5-c-nav__section-title--Color: var(--peikko-steel);
  --pf-v5-c-nav__section-title--BorderBottomColor: transparent;
  --pf-v5-c-nav__section--section--before--BorderColor: transparent;
  padding-bottom: 16px;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link {
  width: calc(100% - 16px);
  margin: 1px 8px;
  padding: 8px 12px;
  border-radius: var(--peikko-radius);
  font-size: 15px;
  font-weight: 400;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link.pf-m-current {
  font-weight: 500;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link:focus {
  outline: none;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link:focus-visible {
  box-shadow: var(--peikko-ring-strong);
}

/* PatternFly marks the current item with a blue bar; the grey pill is enough. */
.pf-v5-c-page__sidebar .pf-v5-c-nav__link::before,
.pf-v5-c-page__sidebar .pf-v5-c-nav__link::after {
  border: none;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__section {
  margin-top: 12px;
}

/* 20px: the same line as the item icons (8px link margin plus 12px padding). */
.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title {
  padding: 4px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Realm at the top of the sidebar, shown like a workspace switcher card:
   name on line 1, muted "Current realm" on line 2, orange mark spanning both. */
.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title:has(.pf-v5-c-label) {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  margin: 12px 8px 4px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
  color: var(--peikko-dark);
  font-size: 14px;
  font-weight: 600;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title:has(.pf-v5-c-label)::before {
  content: "";
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border-radius: var(--peikko-radius);
  background: linear-gradient(135deg, var(--peikko-orange), #ffa64d);
}

/* The card opens Manage realms: that link (the row under the card) is stretched over it,
   and the card shows switcher chevrons. Hovering either one tints both, which shows where the click goes. */
.pf-v5-c-page__sidebar .pf-v5-c-nav__section:has(> .pf-v5-c-nav__list > li > #nav-item-realms) > .pf-v5-c-nav__list,
.pf-v5-c-page__sidebar .pf-v5-c-nav__section:has(> .pf-v5-c-nav__list > li > #nav-item-realms) > .pf-v5-c-nav__list > li,
.pf-v5-c-page__sidebar #nav-item-realms {
  position: static;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav:has(> .pf-v5-c-nav__section-title .pf-v5-c-label) {
  position: relative;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav:has(> .pf-v5-c-nav__section-title .pf-v5-c-label) #nav-item-realms::after {
  content: "";
  position: absolute;
  inset: 0 8px auto; /* the card's top margin collapses through the nav, so the nav starts at the card */
  height: 56px;
  border: 0;
  border-radius: var(--peikko-radius);
  cursor: pointer;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title:has(.pf-v5-c-label) {
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title:has(.pf-v5-c-label)::after {
  content: "";
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  background-color: var(--peikko-icon-muted);
  -webkit-mask: var(--peikko-i-chevrons-up-down) center / contain no-repeat;
  mask: var(--peikko-i-chevrons-up-down) center / contain no-repeat;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav:has(#nav-item-realms:hover) > .pf-v5-c-nav__section-title:has(.pf-v5-c-label) {
  border-color: var(--peikko-border-strong);
  background-color: var(--peikko-mist);
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title [data-testid="currentRealm"] {
  grid-column: 2;
  min-width: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__section-title .pf-v5-c-label {
  --pf-v5-c-label--BackgroundColor: transparent;
  --pf-v5-c-label--PaddingTop: 0;
  --pf-v5-c-label--PaddingRight: 0;
  --pf-v5-c-label--PaddingBottom: 0;
  --pf-v5-c-label--PaddingLeft: 0;
  --pf-v5-c-label__content--before--BorderWidth: 0;
  --pf-v5-c-label__content--Color: var(--peikko-steel);
  grid-column: 2;
  justify-self: start;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}

/* Menu icons (outline icons in the style of Lucide), drawn in the text color. */
.pf-v5-c-page__sidebar .pf-v5-c-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link[href]::before {
  content: "";
  position: static;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-icon) center / contain no-repeat;
  mask: var(--peikko-icon) center / contain no-repeat;
  opacity: 0.85;
}

.pf-v5-c-page__sidebar .pf-v5-c-nav__link.pf-m-current[href]::before {
  opacity: 1;
}

.pf-v5-c-nav__link[href$="/realms"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z'/><path d='m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65'/><path d='m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65'/></svg>"); }
.pf-v5-c-nav__link[href$="/clients"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='4' width='20' height='16' rx='2'/><path d='M2 8h20'/><path d='M6 4v4'/><path d='M10 4v4'/></svg>"); }
.pf-v5-c-nav__link[href$="/client-scopes"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.59 2.59A2 2 0 0 0 11.17 2H4a2 2 0 0 0-2 2v7.17a2 2 0 0 0 .59 1.42l8.7 8.7a2.43 2.43 0 0 0 3.42 0l6.58-6.58a2.43 2.43 0 0 0 0-3.42Z'/><circle cx='7.5' cy='7.5' r='1'/></svg>"); }
.pf-v5-c-nav__link[href$="/roles"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1Z'/></svg>"); }
.pf-v5-c-nav__link[href$="/users"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>"); }
.pf-v5-c-nav__link[href$="/groups"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87'/><path d='M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
.pf-v5-c-nav__link[href$="/sessions"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>"); }
.pf-v5-c-nav__link[href$="/events"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>"); }
.pf-v5-c-nav__link[href$="/realm-settings"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 4h-7'/><path d='M10 4H3'/><path d='M21 12h-9'/><path d='M8 12H3'/><path d='M21 20h-5'/><path d='M12 20H3'/><path d='M14 2v4'/><path d='M8 10v4'/><path d='M16 18v4'/></svg>"); }
.pf-v5-c-nav__link[href$="/authentication"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/></svg>"); }
.pf-v5-c-nav__link[href$="/identity-providers"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/><path d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/></svg>"); }
.pf-v5-c-nav__link[href$="/user-federation"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='5' rx='9' ry='3'/><path d='M3 5v14a9 3 0 0 0 18 0V5'/><path d='M3 12a9 3 0 0 0 18 0'/></svg>"); }
.pf-v5-c-nav__link[href$="/workflows"] { --peikko-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='8' height='8' rx='2'/><path d='M7 11v4a2 2 0 0 0 2 2h4'/><rect x='13' y='13' width='8' height='8' rx='2'/></svg>"); }

/* Realm selector and other toggles in the sidebar */
.pf-v5-c-page__sidebar .pf-v5-c-menu-toggle,
.pf-v5-c-page__sidebar .pf-v5-c-dropdown__toggle {
  color: var(--peikko-dark);
  background-color: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-page__sidebar .pf-v5-c-menu-toggle::before,
.pf-v5-c-page__sidebar .pf-v5-c-dropdown__toggle::before {
  border: none;
}

/* ---------- Page ---------- */

.pf-v5-c-page {
  --pf-v5-c-page--BackgroundColor: #ffffff;
  background-color: #ffffff;
  --pf-v5-c-page__main-section--BackgroundColor: #ffffff;
  --pf-v5-c-page__main-section--m-light--BackgroundColor: #ffffff;
}

.pf-v5-c-page__main-section {
  --pf-v5-c-page__main-section--PaddingLeft: var(--peikko-gutter);
  --pf-v5-c-page__main-section--PaddingRight: var(--peikko-gutter);
  --pf-v5-c-page__main-section--xl--PaddingLeft: var(--peikko-gutter);
  --pf-v5-c-page__main-section--xl--PaddingRight: var(--peikko-gutter);
}

.pf-v5-c-page__main-breadcrumb {
  --pf-v5-c-page__main-breadcrumb--PaddingLeft: var(--peikko-gutter);
  --pf-v5-c-page__main-breadcrumb--PaddingRight: var(--peikko-gutter);
  --pf-v5-c-page__main-breadcrumb--xl--PaddingLeft: var(--peikko-gutter);
  --pf-v5-c-page__main-breadcrumb--xl--PaddingRight: var(--peikko-gutter);
}

/* Keep lines readable on very wide screens. */
.pf-v5-c-page__main > section,
.pf-v5-c-page__main-section,
.pf-v5-c-page__main-tabs {
  max-width: 1440px;
}

/* On wide screens the line under page tabs runs the full width, like the header divider on list pages;
   the tab content stays capped. */
.pf-v5-c-page__main > .pf-v5-c-page__main-section:has(> .pf-v5-c-tabs:not(.pf-m-vertical) + .pf-v5-c-tab-content) {
  max-width: none;
}

.pf-v5-c-page__main > .pf-v5-c-page__main-section:has(> .pf-v5-c-tabs:not(.pf-m-vertical) + .pf-v5-c-tab-content) > .pf-v5-c-tab-content {
  max-width: 1440px;
}

/* A tab bar with a single tab (Users) carries no navigation; a plain line under the header instead. */
.pf-v5-c-page__main-section > .pf-v5-c-tabs:has(> .pf-v5-c-tabs__list > .pf-v5-c-tabs__item:only-child) {
  display: none;
}

.pf-v5-c-page__main-section > .pf-v5-c-tabs:has(> .pf-v5-c-tabs__list > .pf-v5-c-tabs__item:only-child) ~ .pf-v5-c-tab-content:not([hidden]) {
  border-top: 1px solid var(--peikko-light);
}

/* Manage realms is the only list without a line between the header and the toolbar. */
.pf-v5-c-page__main-section.pf-m-light:not(.pf-v5-u-p-0) + .pf-v5-c-page__main-section.pf-v5-u-p-0:not(:has(> .pf-v5-c-tabs)) {
  border-top: 1px solid var(--peikko-light);
}

/* Realm settings and Clients (registration sub-tabs): the tabs already show where you are. Sub-tab routes
   add a breadcrumb that pushes the page down when you switch. The row keeps its 16px like on other
   top-level pages, so the title stays on the same line everywhere; only its content is hidden. */
.pf-v5-c-page__main:has(.pf-v5-c-tabs [data-testid="rs-general-tab"]) > .pf-v5-c-page__main-breadcrumb {
  height: 16px;
  padding-bottom: 0;
  overflow: hidden;
  visibility: hidden;
}

.pf-v5-c-page__main:has(.pf-v5-c-tabs [data-testid="initialAccessToken"]) > .pf-v5-c-page__main-breadcrumb > .pf-v5-c-breadcrumb {
  display: none;
}

/* Groups: no empty breadcrumb row above the tree, so the splitter meets the masthead. */
.pf-v5-c-page__main-breadcrumb:empty:has(+ .keycloak-admin--groups__section) {
  display: none;
}

/* Section forms with a jump list (client settings, Tokens) sit on the page gutter.
   Overrides the pf-v5-u-px-lg utility, which uses !important. */
.pf-v5-c-tab-content > .pf-v5-l-grid.pf-v5-u-px-lg {
  padding-inline: var(--peikko-gutter) !important;
}

/* Tabs that end a long page get some room under the last card. */
.pf-v5-c-page__main-section > .pf-v5-c-tab-content {
  padding-bottom: 32px;
}

.pf-v5-c-title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Page heading: big and bold, with a muted description under it. */
.pf-v5-c-page__main-section .pf-v5-c-title.pf-m-4xl,
.pf-v5-c-page__main-section .pf-v5-c-title.pf-m-3xl,
.pf-v5-c-page__main-section .pf-v5-c-title.pf-m-2xl,
.pf-v5-c-page__main-section .pf-v5-c-content > h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Header actions (Action, Enabled switch) don't make the title row taller than the 34px title,
   so titles and descriptions sit on the same lines with or without them. */
@media (min-width: 576px) {
  .pf-v5-c-page__main-section > .pf-v5-l-level > div:has(> .pf-v5-c-toolbar) {
    margin-block: -4px;
  }
}

/* One small, constant gap between title and description */
.pf-v5-c-page__main-section > #view-header-subkey {
  margin-top: 4px;
}

/* Section headings inside a page ("General settings", "Capability config") */
.pf-v5-c-page__main-section .pf-v5-c-title.pf-m-xl {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

/* Headings inside a tab stay below the page title (master realm "Welcome to Keycloak"). */
.pf-v5-c-tab-content .pf-v5-c-title.pf-m-3xl {
  font-size: 20px;
  line-height: 1.3;
}

/* Its pf-v5-u-font-weight-bold utility uses !important. */
.pf-v5-c-tab-content .pf-v5-c-title.pf-m-3xl[data-testid="welcomeTitle"] {
  font-weight: 600 !important;
}

.pf-v5-c-tab-content .pf-v5-l-grid.pf-v5-u-ml-lg:has([data-testid="welcomeTitle"]) {
  margin-left: 0 !important;
}

.keycloak__dashboard_welcome_tab h3 {
  max-width: 560px;
  font-size: 15px;
  font-weight: 400;
  color: var(--peikko-steel);
}

/* Welcome tab: title and intro full width, then one row of buttons that wraps on phones.
   Keycloak caps the intro at 38% and keeps the action list on one line. */
.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
}

/* The same welcome card as a realm's home page. */
.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) {
  max-width: 760px;
  padding: 28px 32px 32px;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(255, 130, 0, 0.08), transparent 60%),
    radial-gradient(70% 120% at 0% 100%, rgba(48, 194, 221, 0.07), transparent 60%),
    #ffffff;
  box-shadow: var(--peikko-shadow-sm);
}

@media (max-width: 575.98px) {
  .pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) {
    padding: 20px;
  }
}

.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) > .pf-v5-l-grid__item:not(.pf-m-10-col) {
  flex: 0 0 100%;
  max-width: none;
}

.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) > .keycloak__dashboard_welcome_tab {
  margin-top: 12px;
}

.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) > .pf-v5-l-grid__item.pf-m-10-col {
  flex: none;
  margin-top: 20px !important; /* spacing utility */
}

.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) > .pf-v5-c-action-list {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px !important; /* spacing utility */
}

.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) > .pf-v5-c-action-list > .pf-v5-c-action-list__item {
  margin: 0;
}

/* pf-v5-u-px-lg and pf-v5-u-py-sm are !important utilities. */
.pf-v5-c-tab-content .pf-v5-l-grid:has([data-testid="welcomeTitle"]) a.pf-v5-c-button.pf-m-primary {
  padding-inline: 16px !important;
  padding-block: 8px !important;
}

/* Server info: compact cards with section dividers, quiet terms under bolder titles.
   Keycloak's Dashboard chunk (loaded after this file) stretches the card to the Profile card's height. */
html .keycloak__dashboard_card {
  align-self: start;
  height: auto;
}

.keycloak__dashboard_card > .pf-v5-c-card__body {
  flex: 0 0 auto;
}

.keycloak__dashboard_card > .pf-v5-c-card__body + .pf-v5-c-card__title {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--peikko-light);
}

.keycloak__dashboard_card .pf-v5-c-card__title-text {
  font-size: 16px;
  font-weight: 600;
}

.keycloak__dashboard_card .pf-v5-c-description-list__term {
  font-size: 13px;
  font-weight: 400;
  color: var(--peikko-steel);
}

/* Breadcrumbs: muted links, current page dark.
   Keycloak renders plain router links without the PatternFly link class. */
.pf-v5-c-breadcrumb {
  --pf-v5-c-breadcrumb__item--FontSize: 13px;
  --pf-v5-c-breadcrumb__item-divider--Color: #b8c0c7;
}

.pf-v5-c-breadcrumb .pf-v5-c-breadcrumb__item > a:not(.pf-v5-c-button) {
  color: var(--peikko-steel);
  text-decoration: none;
}

.pf-v5-c-breadcrumb .pf-v5-c-breadcrumb__item > a:not(.pf-v5-c-button):hover {
  color: var(--peikko-dark);
  text-decoration: underline;
  text-decoration-color: var(--peikko-orange);
  text-underline-offset: 3px;
}

.pf-v5-c-page__main-breadcrumb .pf-v5-c-breadcrumb__item:last-child {
  color: var(--peikko-dark);
  font-weight: 500;
}

.pf-v5-c-breadcrumb .pf-v5-c-button.pf-m-link {
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--peikko-steel);
}

/* Plain lines */
hr {
  border: 0;
  border-top: 1px solid var(--peikko-light);
}

.pf-v5-c-divider {
  --pf-v5-c-divider--BackgroundColor: var(--peikko-light);
}

.pf-v5-c-page__main-section .pf-v5-c-content p,
.pf-v5-c-page__main-section .pf-v5-c-title + p {
  color: var(--peikko-steel);
}

/* In-app links inside a description ("go to Event configs") need more than a color change to read as links. */
.pf-v5-c-page__main-section .pf-v5-c-content p a:not([target="_blank"]) {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--peikko-border-strong);
  text-underline-offset: 3px;
}

.pf-v5-c-page__main-section .pf-v5-c-content p a:not([target="_blank"]):hover {
  text-decoration-color: var(--peikko-orange);
}

/* "Learn more" in page headers: stays on one line with its icon, quiet underline, orange on hover.
   The link carries an inline "underline transparent" style, so !important is needed. */
.pf-v5-c-page__main-section .pf-v5-c-content a[target="_blank"] {
  white-space: nowrap;
  font-weight: 500;
  text-decoration-color: var(--peikko-light) !important;
  text-underline-offset: 3px;
}

.pf-v5-c-page__main-section .pf-v5-c-content a[target="_blank"]:hover {
  text-decoration-color: var(--peikko-orange) !important;
}

/* Keycloak puts no space before the link, so the nowrap link glues to the last word.
   A zero-width space gives the line a break opportunity there. */
.pf-v5-c-page__main-section .pf-v5-c-content a[target="_blank"]::before {
  content: "\200B";
  white-space: normal;
}

/* Jump links ("Jump to section"): a compact "On this page" list, orange marker on the current one */
.pf-v5-c-jump-links {
  --pf-v5-c-jump-links__item--m-current__link--before--BorderColor: var(--peikko-orange);
  --pf-v5-c-jump-links__link--Color: var(--peikko-steel);
  --pf-v5-c-jump-links__item--m-current__link--Color: var(--peikko-dark);
  --pf-v5-c-jump-links__list--before--BorderColor: var(--peikko-light);
  --pf-v5-c-jump-links__link--PaddingTop: 6px;
  --pf-v5-c-jump-links__link--PaddingBottom: 6px;
  --pf-v5-c-jump-links--m-vertical__list--PaddingTop: 4px;
  --pf-v5-c-jump-links--m-vertical__list--PaddingBottom: 4px;
  --pf-v5-c-jump-links__label--MarginBottom: 8px;
}

.pf-v5-c-jump-links__link {
  font-size: 14px;
}

.pf-v5-c-jump-links__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--peikko-steel);
}

/* A jump list with a single entry only steals width from the form next to it. */
.pf-v5-l-grid__item:has(> .pf-v5-c-page__main-section > .pf-v5-c-jump-links .pf-v5-c-jump-links__item:only-child) {
  display: none;
}

.pf-v5-l-grid:has(> .pf-v5-l-grid__item > .pf-v5-c-page__main-section > .pf-v5-c-jump-links .pf-v5-c-jump-links__item:only-child) > .pf-v5-l-grid__item {
  grid-column: 1 / -1;
}

/* The scrollspy measures offsetTop against the offset parent; make that the scroll container
   (it was the body, so the last section could never become current). */
.pf-v5-c-page__main:has(.pf-v5-c-jump-links) {
  position: relative;
}

/* Wide screens: the list stays a fixed 48px from the 760px cards instead of floating in a 4/12 column. */
@media (min-width: 1200px) {
  .pf-v5-c-tab-content > .pf-v5-l-grid:has(> .pf-v5-l-grid__item > .pf-v5-c-page__main-section > .pf-v5-c-jump-links .pf-v5-c-jump-links__item + .pf-v5-c-jump-links__item) {
    grid-template-columns: minmax(0, 760px) minmax(200px, 240px);
    column-gap: 48px;
    justify-content: start;
  }

  .pf-v5-c-tab-content > .pf-v5-l-grid:has(> .pf-v5-l-grid__item > .pf-v5-c-page__main-section > .pf-v5-c-jump-links .pf-v5-c-jump-links__item + .pf-v5-c-jump-links__item) > .pf-v5-l-grid__item {
    grid-column: auto;
  }
}

/* ---------- Realm home ---------- */

/* A welcome card on the page grid instead of Keycloak's centred empty state. */
.pf-v5-c-page__main-section > .pf-v5-c-empty-state:has(.keycloak__dashboard_icon) {
  justify-content: flex-start;
  max-width: 760px;
  margin: 8px 0 0;
  padding: 32px;
  text-align: left;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(255, 130, 0, 0.08), transparent 60%),
    radial-gradient(70% 120% at 0% 100%, rgba(48, 194, 221, 0.07), transparent 60%),
    #ffffff;
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-empty-state:has(.keycloak__dashboard_icon) .pf-v5-c-empty-state__content {
  max-width: none;
}

/* The masthead already shows the logo; the card shows the realm mark from the sidebar switcher instead. */
.pf-v5-c-empty-state .keycloak__dashboard_icon {
  display: none;
}

/* The card's mark is the Peikko Designer logomark on a white tile, and a faint dot grid fades in from the right. */
.pf-v5-c-empty-state:has(.keycloak__dashboard_icon) .pf-v5-c-empty-state__content::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border-radius: 10px;
  background: #ffffff url("../img/pd-logomark.svg") center / 24px auto no-repeat;
  box-shadow: 0 1px 2px rgba(51, 58, 71, 0.12), 0 4px 12px rgba(51, 58, 71, 0.08);
}

.pf-v5-c-page__main-section > .pf-v5-c-empty-state:has(.keycloak__dashboard_icon) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.pf-v5-c-page__main-section > .pf-v5-c-empty-state:has(.keycloak__dashboard_icon)::after {
  content: "";
  position: absolute;
  inset: 0 0 0 45%;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(51, 58, 71, 0.14) 1px, transparent 1.5px);
  background-size: 16px 16px;
  background-position: right 8px top 8px;
  -webkit-mask-image: linear-gradient(to left, #000 10%, transparent 90%);
  mask-image: linear-gradient(to left, #000 10%, transparent 90%);
}

.pf-v5-c-empty-state:has(.keycloak__dashboard_icon) .pf-v5-c-empty-state__title {
  justify-content: flex-start;
  text-align: left;
}

.pf-v5-c-empty-state:has(.keycloak__dashboard_icon) h2.pf-v5-c-empty-state__title-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--peikko-steel);
}

.pf-v5-c-empty-state:has(.keycloak__dashboard_icon) h1.pf-v5-c-empty-state__title-text {
  margin-top: 2px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pf-v5-c-empty-state:has(.keycloak__dashboard_icon) .pf-v5-c-empty-state__body {
  max-width: 520px;
  margin-top: 12px;
  margin-inline: 0;
  color: var(--peikko-steel);
}

/* ---------- Forms as cards ---------- */

.pf-v5-c-form {
  --pf-v5-c-form__label--FontSize: 15px;
}

/* Labels above the inputs instead of beside them, on pages and in dialogs. */
:is(.pf-v5-c-page, .pf-v5-c-modal-box) .pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group {
  grid-template-columns: 1fr;
  --pf-v5-c-form--m-horizontal__group-label--md--PaddingTop: 0;
  --pf-v5-c-form--m-horizontal__group-label--md--GridColumnWidth: 1fr;
  --pf-v5-c-form--m-horizontal__group-control--md--GridColumnWidth: 1fr;
}

:is(.pf-v5-c-page, .pf-v5-c-modal-box) .pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group-label {
  grid-column: 1 / -1;
  padding-top: 0;
  padding-bottom: 6px;
}

/* PatternFly pins the control to column 2, which brings the label column back. */
:is(.pf-v5-c-page, .pf-v5-c-modal-box) .pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group-control {
  grid-column: 1 / -1;
}

/* The form becomes a rounded card. */
.pf-v5-c-page__main-section .pf-v5-c-form.pf-m-horizontal {
  max-width: 760px;
  padding: 24px 24px 0;
  background: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  overflow: hidden;
}

/* A card without the grey footer needs its own bottom padding.
   :where keeps the specificity below the nested-form reset just after. */
.pf-v5-c-page__main-section .pf-v5-c-form.pf-m-horizontal:where(:not(:has(> .pf-v5-c-form__group.pf-m-action:last-child, > .pf-v5-c-form__actions:last-child))) {
  padding-bottom: 24px;
}

/* A form inside a form card doesn't get a second card. */
.pf-v5-c-form.pf-m-horizontal .pf-v5-c-form.pf-m-horizontal {
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* Inline forms in table cells (credential user label) and dropdown panels are not cards either. */
.pf-v5-c-page__main-section :is(.pf-v5-c-table, .kc-dropdown-panel-content) .pf-v5-c-form.pf-m-horizontal,
.pf-v5-c-modal-box .pf-v5-c-page__main-section .pf-v5-c-form.pf-m-horizontal {
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

/* Add identity provider mapper: the header section is nested in a padded section. Put the title on the
   breadcrumb line, the divider across the full width and the card 24px under it, like Create role. */
.pf-v5-c-page__main > .pf-v5-c-page__main-section > .pf-v5-c-page__main-section.pf-m-light:first-child:has(+ .pf-v5-c-divider) {
  padding: 0 0 24px;
}

.pf-v5-c-page__main > .pf-v5-c-page__main-section > .pf-v5-c-page__main-section.pf-m-light:first-child + .pf-v5-c-divider {
  width: calc(100% + 2 * var(--peikko-gutter));
  margin-inline: calc(-1 * var(--peikko-gutter));
}

.pf-v5-c-page__main-section > .pf-v5-c-divider + .pf-v5-c-form.pf-m-horizontal.pf-v5-u-mt-lg {
  margin-top: 24px !important; /* beats the mt-lg reset below, which has one class less */
}

/* Role and Admin details: Keycloak's margin utility puts these cards 24px lower than their siblings. */
.pf-v5-c-page__main-section > .pf-v5-c-form.pf-m-horizontal.pf-v5-u-mt-lg {
  margin-top: 0 !important;
}

.pf-v5-c-tab-content > .pf-v5-c-form.pf-m-horizontal.pf-v5-u-ml-md {
  margin-left: var(--peikko-gutter) !important;
}

.pf-v5-c-form__label-text {
  font-weight: 400;
  color: var(--peikko-dark);
}

.pf-v5-c-form__helper-text,
.pf-v5-c-helper-text {
  --pf-v5-c-helper-text__item-text--Color: var(--peikko-steel);
  color: var(--peikko-steel);
}

/* Help (?) icons next to labels: muted until hovered. */
.pf-v5-c-form__group-label-help {
  color: var(--peikko-icon-muted);
}

.pf-v5-c-form__group-label-help:hover {
  color: var(--peikko-dark);
}

/* Not a .pf-v5-c-button, so the shared ring misses it and Chrome draws its black square. */
.pf-v5-c-form__group-label-help:focus-visible {
  outline: none;
  border-radius: 999px;
  box-shadow: var(--peikko-ring-strong);
  color: var(--peikko-dark);
}

/* Partial import: the helper text sat right on the editor's bottom border. */
.pf-v5-c-form__group-control > .pf-v5-c-file-upload + .pf-v5-c-form__helper-text {
  margin-top: 8px;
}

/* Realm endpoints: Keycloak sets an inline transparent underline. */
.pf-v5-c-form .pf-v5-l-stack a[target="_blank"] {
  font-weight: 500;
  text-decoration-line: underline !important;
  text-decoration-color: var(--peikko-light) !important;
  text-underline-offset: 3px;
}

.pf-v5-c-form .pf-v5-l-stack a[target="_blank"]:hover {
  text-decoration-color: var(--peikko-orange) !important;
}

/* Read-only descriptions are prose, not code (client profile details). */
.pf-v5-c-form-control > textarea#description[readonly] {
  font-family: var(--peikko-font);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
}

/* PatternFly puts 'resize: both' on the textarea's wrapper. Textareas grow downward only, so they never
   run past the card; disabled and read-only ones don't resize at all. */
.pf-v5-c-form-control.pf-m-resize-both {
  resize: vertical;
  max-width: 100%;
}

.pf-v5-c-form-control.pf-m-disabled,
.pf-v5-c-form-control:has(> textarea[readonly]) {
  resize: none;
}

/* Disabled fields don't react to hover, and say so with the cursor. */
.pf-v5-c-form-control.pf-m-disabled:hover::before {
  border-color: var(--peikko-light);
}

.pf-v5-c-form-control.pf-m-disabled > :is(input, textarea) {
  cursor: not-allowed;
}

/* Keycloak puts the 'General' heading (a jump target) in the tab order; no browser box around the card. */
.pf-v5-c-form h1.pf-v5-c-title:focus {
  outline: none;
}

.pf-v5-c-form h1.pf-v5-c-title:focus-visible {
  border-radius: 6px;
  box-shadow: var(--peikko-ring-strong);
}

/* Stacked checkboxes and radios (Email encryption, Authentication type) get the 8px gap of shadcn groups. */
.pf-v5-c-form__group-control > :is(.pf-v5-c-check, .pf-v5-c-radio):not(.pf-v5-u-mb-md) + :is(.pf-v5-c-check, .pf-v5-c-radio) {
  margin-top: 8px;
}

/* Set password dialog: the Temporary switch's utility margin left a gap above the footer. */
.pf-v5-c-modal-box .pf-v5-c-form__group-control > .pf-v5-c-switch.pf-v5-u-mb-md {
  margin-bottom: 0 !important;
}

/* Checkbox plus its help icon in one input group (Capability config). */
.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-check) {
  align-items: center;
  column-gap: 6px;
}

/* In-card sub-section titles ("Passkeys", "OpenID Connect settings"): 16px semibold, below the 20px
   section headings outside the cards. */
.pf-v5-c-form > h2.pf-v5-c-title.pf-m-lg {
  font-weight: 600;
}

.pf-v5-c-form.pf-m-horizontal > h2.pf-v5-c-title.kc-form-panel__title {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* A divider between in-card sub-sections: 32px each side together with the form gap. */
.pf-v5-c-form.pf-m-horizontal > hr.pf-v5-c-divider.pf-v5-u-mt-lg.pf-v5-u-mb-lg {
  margin-block: 8px !important; /* spacing utilities */
}

/* Tokens > Action tokens: 'Override Action Tokens' starts a group of its own. */
.pf-v5-c-form.pf-m-horizontal > h1.kc-override-action-tokens-subtitle {
  margin: 8px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--peikko-light);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Annotations: the section heading already names it, so the field label inside the card goes.
   On Create attributes group the in-card title becomes a sub-section header. */
.pf-v5-c-form__group.kc-annotations-label > .pf-v5-c-form__group-label,
.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-content:has(> h2) + .pf-v5-c-form__group:has([data-testid="annotations-add-row"]) > .pf-v5-c-form__group-label {
  display: none;
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-content:has(+ .pf-v5-c-form__group [data-testid="annotations-add-row"]) > h2 {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--peikko-light);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* "+ Add ..." under multi-value fields */
.pf-v5-c-button.pf-m-link[data-testid$="addValue"] {
  margin-top: 6px;
  padding-left: 0;
  padding-right: 0;
  font-size: 14px;
}

/* Remove buttons beside multi-value rows, attributes and annotations: a muted trash icon tile. */
.pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-link[data-testid^="remove"],
.pf-v5-c-button.pf-m-link:is([data-testid="attributes-remove"], [data-testid="annotations-remove"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

.pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-link[data-testid^="remove"] {
  margin-left: 4px;
}

.pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-link[data-testid^="remove"]:not(:disabled):hover,
.pf-v5-c-button.pf-m-link:is([data-testid="attributes-remove"], [data-testid="annotations-remove"]):hover {
  color: var(--pf-v5-global--danger-color--100);
  background-color: var(--peikko-hover);
}

.pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-link[data-testid^="remove"]:disabled {
  color: var(--peikko-border-strong);
  background: transparent;
}

/* Attribute editors (roles, groups, users): key and value fill the card, the remove button is a 40px column. */
form.keycloak__form > .pf-v5-l-grid.pf-m-gutter:has([data-testid="attributes-key"]) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  gap: 8px 12px;
}

form.keycloak__form > .pf-v5-l-grid.pf-m-gutter:has([data-testid="attributes-key"]) > .pf-v5-l-grid__item {
  grid-column: auto / span 1;
}

form.keycloak__form > .pf-v5-l-grid.pf-m-gutter:has([data-testid="attributes-key"]) > .pf-v5-l-grid__item.pf-v5-c-form__label {
  margin-bottom: -2px;
}

form.keycloak__form > .pf-v5-l-grid.pf-m-gutter:has([data-testid="attributes-key"]) > .pf-v5-l-grid__item.pf-v5-c-form__label.pf-m-7-col {
  grid-column: auto / span 2;
}

.pf-v5-c-button[data-testid="attributes-add-row"] {
  font-size: 14px;
}

/* ACR to LoA mapping: the same key/value layout, filling the card, with small muted column captions. */
.pf-v5-c-form__group-control > .pf-v5-l-grid.pf-m-gutter:has(input[aria-label="LoA"]) {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) 40px;
  gap: 6px 12px;
}

.pf-v5-c-form__group-control > .pf-v5-l-grid.pf-m-gutter:has(input[aria-label="LoA"]) > .pf-v5-l-grid__item {
  grid-column: auto / span 1;
}

.pf-v5-c-form__group-control > .pf-v5-l-grid.pf-m-gutter:has(input[aria-label="LoA"]) > .pf-v5-c-form__label.pf-m-2-col {
  grid-column: auto / span 2;
}

.pf-v5-c-form__group-control > .pf-v5-l-grid.pf-m-gutter:has(input[aria-label="LoA"]) > .pf-v5-c-form__label .pf-v5-c-form__label-text {
  font-size: 13px;
  color: var(--peikko-steel);
}

.pf-v5-l-grid__item > .pf-v5-c-button.pf-m-link[data-testid$="-remove"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

.pf-v5-l-grid__item > .pf-v5-c-button.pf-m-link[data-testid$="-remove"]:hover {
  color: var(--pf-v5-global--danger-color--100);
  background-color: var(--peikko-hover);
}

/* Taller inputs */
.pf-v5-c-form-control > input,
.pf-v5-c-form-control > select,
.pf-v5-c-form-control > textarea {
  min-height: 40px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 15px;
}

/* Save and Revert sit in a grey footer at the bottom of the card, on the right.
   Keycloak pins this bar to the bottom of the window; here it goes back into the card. */
.pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group.pf-m-action,
.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-form__actions {
  position: static;
  width: auto;
  margin: 8px -24px 0;
  padding: 12px 24px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
}

.pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group.pf-m-action .pf-v5-c-form__actions,
.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-form__actions {
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
}

.pf-v5-c-form__actions > .pf-v5-c-button,
.pf-v5-c-form__actions > .pf-v5-c-action-list__item {
  margin: 0;
}

/* A footer in the middle of a card (events settings) closes off both sides;
   the divider Keycloak adds after it is then redundant. */
.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-form__group.pf-m-action:not(:last-child) {
  border-bottom: 1px solid var(--peikko-light);
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-form__group.pf-m-action + hr.pf-v5-c-divider {
  display: none;
}

/* Read-only global profiles render an empty footer. */
.pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group.pf-m-action:has(.pf-v5-c-form__actions:empty) {
  display: none;
}

/* Revert and Cancel are link buttons in Keycloak; show them outlined.
   The outline is drawn inside, so they stay as tall as Save. */
.pf-v5-c-form__actions .pf-v5-c-button.pf-m-link {
  color: var(--peikko-dark);
  background: #ffffff;
  border: 0;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

.pf-v5-c-form__actions .pf-v5-c-button.pf-m-link:hover {
  background: var(--peikko-mist);
  text-decoration: none;
}

/* Advanced tab: Keycloak renders Save as a secondary button next to the outlined Revert. */
.pf-v5-c-form__actions > .pf-v5-c-button.pf-m-secondary:is([data-testid$="Save"], [data-testid$="save"]) {
  --pf-v5-c-button--m-secondary--BackgroundColor: var(--peikko-dark);
  --pf-v5-c-button--m-secondary--hover--BackgroundColor: var(--peikko-dark-hover);
  --pf-v5-c-button--m-secondary--focus--BackgroundColor: var(--peikko-dark-hover);
  --pf-v5-c-button--m-secondary--Color: #ffffff;
  --pf-v5-c-button--m-secondary--hover--Color: #ffffff;
  --pf-v5-c-button--m-secondary--focus--Color: #ffffff;
  --pf-v5-c-button--m-secondary--after--BorderColor: transparent;
  --pf-v5-c-button--m-secondary--hover--after--BorderColor: transparent;
  --pf-v5-c-button--m-secondary--focus--after--BorderColor: transparent;
}

/* Keycloak's fixed bottom bar (Create attribute, LDAP, Kerberos, attribute editors) goes back into the flow,
   right-aligned with Cancel before the action, like every other footer. */
.pf-v5-c-form:not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action {
  position: static;
  width: auto;
  max-width: 760px;
  margin: 24px 0 0;
  padding: 20px 0 0;
  background: transparent;
  border-top: 1px solid var(--peikko-light);
}

.pf-v5-c-form:not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action .pf-v5-c-form__actions {
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
}

.pf-v5-c-form:not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action .pf-v5-c-form__actions > * {
  margin: 0;
}

/* Next to a jump list the cards sit in an 8 of 12 grid column; the footer ends with them. */
@media (min-width: 768px) {
  :is(.pf-v5-c-form:has(> .pf-v5-l-grid .pf-v5-c-jump-links), .pf-v5-c-page__main-section:has(> .pf-v5-l-grid .pf-v5-c-jump-links) > .pf-v5-c-form):not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action {
    max-width: min(760px, calc((100% + 16px) * 2 / 3 - 16px)); /* the grid gap is 16px */
  }
}

/* LDAP, Kerberos and Create attribute: the footer is alone in its form, under the cards.
   No line of its own, which would sit on the last card's border. */
.pf-v5-c-page__main-section > .pf-v5-c-form:not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action:only-child {
  margin-top: 24px;
  padding-top: 0;
  border-top: 0;
}

/* Kerberos puts every section in its own page section, which doubles the gap between them. */
.pf-v5-c-page__main-section:has(> .kc-wizard-section-header__title) + .pf-v5-c-page__main-section:has(> .kc-wizard-section-header__title) {
  padding-top: 0;
}

/* Section forms with a jump list (Tokens, Create attribute): the same rhythm as the form panels. */
.pf-v5-l-grid > .pf-v5-l-grid__item > section > h1.pf-v5-c-title.pf-m-xl {
  margin-bottom: 16px;
}

.pf-v5-l-grid > .pf-v5-l-grid__item > section > h1.pf-v5-c-title.pf-m-xl ~ .pf-v5-c-form.pf-v5-u-mt-lg {
  margin-top: 0 !important; /* spacing utility */
}

.pf-v5-l-grid > .pf-v5-l-grid__item > section + section {
  margin-top: 32px !important; /* Keycloak sets the margin inline; 32px matches the Sessions and Login panels */
}

/* LDAP, Create attribute: the section's own inline 24px is the gap under the header line, so the page
   section drops its top padding (the sticky jump list moves up with the first heading). */
.pf-v5-c-page__main-section:not(.pf-v5-u-p-0):has(> .pf-v5-l-grid > .pf-v5-l-grid__item > .pf-v5-c-page__main-section > .pf-v5-c-jump-links) {
  padding-top: 0;
}

/* 'Enabled when' and 'Required when' radios: a 12px gap, none after the last one. The scopes select
   that 'Scopes are requested' reveals sits indented under its radio. */
.pf-v5-l-grid__item > section .pf-v5-c-form__group-control > .pf-v5-c-radio.pf-v5-u-mb-md {
  margin-bottom: 12px !important; /* spacing utility */
}

.pf-v5-l-grid__item > section .pf-v5-c-form__group-control > .pf-v5-c-radio.pf-v5-u-mb-md:last-child {
  margin-bottom: 0 !important;
}

.pf-v5-l-grid__item > section .pf-v5-c-form__group:has(> .pf-v5-c-form__group-control > .pf-v5-c-radio) + .pf-v5-c-form__group:not(:has(> .pf-v5-c-form__group-label)) {
  margin-top: -12px;
  padding-inline-start: 24px;
}

/* Durations (Tokens, Sessions, Brute force): amount and unit as one 320px control. */
.pf-v5-l-split.pf-m-gutter:has(> .pf-v5-l-split__item > .pf-v5-c-menu-toggle[aria-label="Select a time unit"]) {
  gap: 0;
  width: 320px;
  max-width: 100%;
}

.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:first-child > .pf-v5-c-form-control {
  width: 100%;
}

.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:first-child > .pf-v5-c-form-control,
.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:first-child > .pf-v5-c-form-control::before {
  border-radius: var(--peikko-radius) 0 0 var(--peikko-radius);
}

.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:last-child {
  flex: 0 0 128px;
  margin-left: -1px;
}

.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:last-child > .pf-v5-c-menu-toggle {
  justify-content: space-between;
}

.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:last-child > .pf-v5-c-menu-toggle,
.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item:last-child > .pf-v5-c-menu-toggle::before {
  border-radius: 0 var(--peikko-radius) var(--peikko-radius) 0;
}

/* The hovered or focused half paints its border and ring on top. The z-index goes on the controls
   (already positioned), not the split item, so the menu's offset parent stays the same. */
.pf-v5-l-split:has(> .pf-v5-l-split__item > [aria-label="Select a time unit"]) > .pf-v5-l-split__item > :is(.pf-v5-c-form-control, .pf-v5-c-menu-toggle):is(:hover, :focus-within, .pf-m-expanded) {
  z-index: 1;
}

.pf-v5-c-form__actions > a.kc-attributeCancel {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
  color: var(--peikko-dark);
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

.pf-v5-c-form__actions > a.kc-attributeCancel:hover {
  background: var(--peikko-mist);
}

/* Attributes tabs (roles, groups): the key/value form becomes a card with the usual grey footer. */
:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.pf-v5-c-form.keycloak__form:not(.pf-m-horizontal):has(> .pf-v5-c-form__group.pf-m-action) {
  max-width: 760px;
  padding: 24px 24px 0;
  background: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  overflow: hidden;
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.pf-v5-c-form.keycloak__form:not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action {
  max-width: none;
  margin: 8px -24px 0;
  padding: 12px 24px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.keycloak__form:not(.pf-m-horizontal) .pf-v5-c-empty-state {
  --pf-v5-c-empty-state--PaddingTop: 0;
  text-align: left;
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.keycloak__form:not(.pf-m-horizontal) .pf-v5-c-empty-state__content {
  max-width: none;
  margin: 0;
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.keycloak__form:not(.pf-m-horizontal) .pf-v5-c-empty-state__footer {
  align-items: flex-start;
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.keycloak__form:not(.pf-m-horizontal) .pf-v5-c-empty-state__footer .pf-v5-c-button.pf-m-link {
  --pf-v5-c-button--PaddingLeft: 0;
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.keycloak__form:not(.pf-m-horizontal) .pf-v5-c-empty-state__body {
  margin-top: 0;
  font-size: 14px;
}

:is(section.kc-attributes-tab, .pf-v5-c-tab-content .pf-v5-c-page__main-section) > form.keycloak__form:not(.pf-m-horizontal) .pf-v5-c-empty-state__footer {
  margin-top: 12px;
}

/* Create attribute > Annotations when empty: the same dashed placeholder as Validations above it. */
.kc-annotations > .pf-v5-l-grid__item > .pf-v5-c-empty-state.pf-m-xs {
  padding: 20px !important; /* the pf-v5-u-p-0 utility */
  background: var(--peikko-mist);
  border: 1px dashed var(--peikko-border-strong);
  border-radius: var(--peikko-radius);
}

/* Client Credentials: the cards start right under the tabs like on Settings and Keys,
   with the usual 24px between fields and no empty spacer above the footer. */
.pf-v5-c-tab-content > .pf-v5-c-page__main-section > .pf-v5-c-form.pf-m-horizontal.pf-v5-u-mt-md:has(> .pf-v5-c-card) {
  margin-top: 0 !important; /* spacing utility */
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-card > .pf-v5-c-card__body > .pf-v5-c-form__group.pf-v5-u-my-md {
  margin-top: 24px !important; /* spacing utility */
  margin-bottom: 0 !important;
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-card .pf-v5-c-form__group-control > .pf-v5-u-my-md:empty {
  display: none;
}

/* JSON editors (client policies, user profile): editor box with an attached grey footer, actions on the right. */
.pf-v5-c-form__group-control > .pf-v5-u-ml-lg > div:has(> .w-tc-editor),
.pf-v5-c-page__main-section > div:has(> .w-tc-editor):has(+ .pf-v5-c-form),
.pf-v5-c-tab-content > .pf-v5-u-ml-lg > div:has(> .w-tc-editor) {
  border-radius: var(--peikko-radius-lg) var(--peikko-radius-lg) 0 0;
}

.pf-v5-c-form__group-control:has(> .pf-v5-u-ml-lg > div > .w-tc-editor) > .pf-v5-c-form__group.pf-m-action,
.pf-v5-c-page__main-section > div:has(> .w-tc-editor) + .pf-v5-c-form:not(.pf-m-horizontal) > .pf-v5-c-form__group.pf-m-action,
.pf-v5-c-tab-content > .pf-v5-u-ml-lg:has(> div > .w-tc-editor) + .pf-v5-u-mt-md {
  max-width: none;
  margin: 0 0 32px;
  padding: 12px 16px;
  background: var(--peikko-mist);
  border: 1px solid var(--peikko-light);
  border-top: 0;
  border-radius: 0 0 var(--peikko-radius-lg) var(--peikko-radius-lg);
}

.pf-v5-c-form__group-control:has(> .pf-v5-u-ml-lg > div > .w-tc-editor) > .pf-v5-c-form__group.pf-m-action {
  margin-inline: 24px 0;
}

.pf-v5-c-form__group-control:has(> .pf-v5-u-ml-lg > div > .w-tc-editor) > .pf-v5-c-form__group.pf-m-action .pf-v5-c-form__actions > .pf-v5-u-mt-md,
.pf-v5-c-tab-content > .pf-v5-u-ml-lg:has(> div > .w-tc-editor) + .pf-v5-u-mt-md {
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
}

.pf-v5-c-form__group-control:has(> .pf-v5-u-ml-lg > div > .w-tc-editor) > .pf-v5-c-form__group.pf-m-action .pf-v5-c-form__actions > .pf-v5-u-mt-md {
  margin: 0 0 0 auto !important; /* spacing utility */
}

/* Client policies > Policies JSON view has no form group around the editor. */
.pf-v5-c-tab-content > .pf-v5-u-ml-lg:has(> div > .w-tc-editor) {
  margin: 16px var(--peikko-gutter) 0 !important; /* pf-v5-u-mt-md and pf-v5-u-ml-lg */
}

.pf-v5-c-tab-content > .pf-v5-u-ml-lg:has(> div > .w-tc-editor) + .pf-v5-u-mt-md {
  margin: 0 var(--peikko-gutter) 32px !important; /* spacing utility */
}

[data-testid^="jsonEditor-"][data-testid$="saveBtn"] {
  margin: 0 !important; /* pf-v5-u-ml-lg */
}

.pf-v5-c-button.pf-m-link[data-testid="jsonEditor-reloadBtn"] {
  color: var(--peikko-dark);
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
  text-decoration: none;
}

.pf-v5-c-button.pf-m-link[data-testid="jsonEditor-reloadBtn"]:hover {
  background: var(--peikko-mist);
}

/* ---------- Buttons ---------- */

.pf-v5-c-button {
  --pf-v5-c-button--BorderRadius: var(--peikko-radius);
  --pf-v5-c-button--FontSize: 15px;
  --pf-v5-c-button--FontWeight: 500;
  --pf-v5-c-button--PaddingTop: 8px;
  --pf-v5-c-button--PaddingBottom: 8px;
  --pf-v5-c-button--PaddingLeft: 16px;
  --pf-v5-c-button--PaddingRight: 16px;
  --pf-v5-c-button--m-primary--BackgroundColor: var(--peikko-dark);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--peikko-dark-hover);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--peikko-dark-hover);
  --pf-v5-c-button--m-primary--active--BackgroundColor: var(--peikko-dark-hover);
  --pf-v5-c-button--m-secondary--Color: var(--peikko-dark);
  --pf-v5-c-button--m-secondary--hover--Color: var(--peikko-dark);
  --pf-v5-c-button--m-secondary--BackgroundColor: #ffffff;
  --pf-v5-c-button--m-secondary--hover--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--m-secondary--after--BorderColor: var(--peikko-light);
  --pf-v5-c-button--m-secondary--hover--after--BorderColor: var(--peikko-light);
  --pf-v5-c-button--m-secondary--focus--after--BorderColor: var(--peikko-light);
  --pf-v5-c-button--m-tertiary--Color: var(--peikko-dark);
  --pf-v5-c-button--m-tertiary--after--BorderColor: var(--peikko-light);
  --pf-v5-c-button--m-link--Color: var(--peikko-dark);
  --pf-v5-c-button--m-link--hover--Color: var(--peikko-dark);
  --pf-v5-c-button--disabled--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--disabled--Color: var(--peikko-disabled-text);
}

/* 40px, the same height as inputs and selects */
.pf-v5-c-button:is(.pf-m-primary, .pf-m-secondary, .pf-m-tertiary, .pf-m-control, .pf-m-link, .pf-m-danger, .pf-m-warning):not(.pf-m-small):not(.pf-m-inline):not(.pf-m-plain) {
  --pf-v5-c-button--LineHeight: 24px;
}

.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-tertiary {
  box-shadow: var(--peikko-shadow-sm);
}

/* Disabled: a soft outlined surface instead of PatternFly's solid grey block.
   Split buttons (Add client scope dialog) are primary menu toggles. */
.pf-v5-c-button:is(.pf-m-primary, .pf-m-secondary, .pf-m-tertiary):is(:disabled, .pf-m-disabled, .pf-m-aria-disabled),
.pf-v5-c-menu-toggle:is(.pf-m-primary, .pf-m-secondary):is(:disabled, .pf-m-disabled) {
  color: var(--peikko-disabled-text);
  background-color: var(--peikko-mist);
  box-shadow: inset 0 0 0 1px var(--peikko-light);
}

/* "Test connection" carries the progress modifier even when idle, which adds spinner padding. */
.pf-v5-c-button.pf-m-progress:not(.pf-m-in-progress) {
  --pf-v5-c-button--m-progress--PaddingLeft: 16px;
  --pf-v5-c-button--m-progress--PaddingRight: 16px;
}

.pf-v5-c-button.pf-m-plain::after {
  border: none;
}

/* Icon buttons in rows (kebabs, expand chevrons): muted, with a soft hover tile */
:is(.pf-v5-c-table__action, .pf-v5-c-tree-view__action) .pf-v5-c-menu-toggle.pf-m-plain,
.pf-v5-c-table__toggle .pf-v5-c-button.pf-m-plain {
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

:is(.pf-v5-c-table__action, .pf-v5-c-tree-view__action) .pf-v5-c-menu-toggle.pf-m-plain:hover,
.pf-v5-c-table__toggle .pf-v5-c-button.pf-m-plain:hover,
.pf-v5-c-table td .pf-v5-c-button.pf-m-plain[aria-label="Settings"]:hover {
  color: var(--peikko-dark);
  background-color: var(--peikko-hover);
}

/* Square 32px ghost icon buttons, so hover tiles and focus rings are squares around the glyph. */
:is(.pf-v5-c-table__action, .pf-v5-c-tree-view__action) .pf-v5-c-menu-toggle.pf-m-plain,
.pf-v5-c-table__toggle .pf-v5-c-button.pf-m-plain,
.pf-v5-c-table td .pf-v5-c-button.pf-m-plain[aria-label="Settings"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.pf-v5-c-table td .pf-v5-c-button.pf-m-plain[aria-label="Settings"] {
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

/* An open menu keeps its trigger tinted. */
:is(.pf-v5-c-table__action, .pf-v5-c-tree-view__action, .pf-v5-c-toolbar) .pf-v5-c-menu-toggle.pf-m-plain.pf-m-expanded {
  color: var(--peikko-dark);
  background-color: var(--peikko-hover);
}

/* Drag grips stay small, so draggable rows keep the 53px height. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table .pf-v5-c-table__draggable > .pf-v5-c-button.pf-m-plain {
  --pf-v5-c-button--PaddingTop: 6px;
  --pf-v5-c-button--PaddingBottom: 6px;
}

/* Secondary toolbar actions (Import client, Refresh, Manage display order, Delete user) as outlined
   buttons next to the dark primary, like Vercel and shadcn toolbars. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar__item > .pf-v5-c-button.pf-m-link:not(.pf-m-inline) {
  --pf-v5-c-button--PaddingLeft: 14px;
  --pf-v5-c-button--PaddingRight: 14px;
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
  text-decoration: none;
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar__item > .pf-v5-c-button.pf-m-link:not(.pf-m-inline):hover {
  background: var(--peikko-mist);
  text-decoration: none;
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar__item > .pf-v5-c-button.pf-m-link:not(.pf-m-inline):is(:disabled, .pf-m-disabled, .pf-m-aria-disabled) {
  background: var(--peikko-mist);
  box-shadow: inset 0 0 0 1px var(--peikko-light);
}

/* Bulk-action kebab in list toolbars: a 40px outlined icon button. */
.pf-v5-c-page__main .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain:not(.pf-m-text) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--peikko-icon-muted);
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

.pf-v5-c-page__main .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain:not(.pf-m-text):is(:hover, .pf-m-expanded):not(:disabled) {
  color: var(--peikko-dark);
  background: var(--peikko-mist);
}

.pf-v5-c-page__main .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain:not(.pf-m-text):is(:disabled, .pf-m-disabled) {
  color: var(--peikko-border-strong);
  background: var(--peikko-mist);
  box-shadow: inset 0 0 0 1px var(--peikko-light);
}

/* ---------- Inputs ---------- */

.pf-v5-c-form-control {
  --pf-v5-c-form-control--BorderRadius: var(--peikko-radius);
  --pf-v5-c-form-control--before--BorderColor: var(--peikko-light);
  /* PatternFly draws the bottom edge with ::after (hidden below); draw it with ::before like the others. */
  --pf-v5-c-form-control--before--BorderBottomWidth: 1px;
  --pf-v5-c-form-control--before--BorderBottomColor: var(--peikko-light);
  --pf-v5-c-form-control--after--BorderColor: transparent;
  --pf-v5-c-form-control--hover--after--BorderColor: transparent;
  --pf-v5-c-form-control--focus--after--BorderColor: transparent;
  --pf-v5-c-form-control--m-readonly--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-form-control--m-disabled--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-form-control--m-disabled--Color: var(--peikko-steel);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-form-control:hover {
  --pf-v5-c-form-control--before--BorderColor: var(--peikko-border-strong);
}

.pf-v5-c-form-control:focus-within {
  --pf-v5-c-form-control--before--BorderColor: var(--peikko-dark);
  box-shadow: var(--peikko-ring);
}

/* The wrapper already shows the dark border and ring; the browser outline would double it. */
.pf-v5-c-form-control > :is(input, select, textarea):focus,
.pf-v5-c-text-input-group__text-input:focus {
  outline: none;
}

/* Read-only fields (Keycloak sets readOnly without PatternFly's modifier) look read-only. */
.pf-v5-c-form-control:has(> :is(input, textarea)[readonly]),
.pf-v5-c-form-control.pf-m-readonly,
.pf-v5-c-form-control.pf-m-disabled {
  background-color: var(--peikko-mist);
  box-shadow: none;
}

.pf-v5-c-form__group:has(.pf-v5-c-form-control > input[readonly]) .pf-v5-c-form__label-required {
  display: none;
}

.pf-v5-c-form-control.pf-m-disabled::before {
  border: 1px solid var(--peikko-light);
}

/* Read-only code (adapter config, JSON) in a monospace face */
.pf-v5-c-form-control > textarea[readonly] {
  font-family: var(--peikko-mono);
  font-size: 13px;
  line-height: 1.6;
}

/* No native number spinners; arrow keys still step the value. */
.pf-v5-c-form-control > input[type="number"] {
  -moz-appearance: textfield;
}

.pf-v5-c-form-control > input[type="number"]::-webkit-inner-spin-button,
.pf-v5-c-form-control > input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Chrome's native search clear is navy; use the thin muted x of the other search fields. */
.pf-v5-c-form-control > input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-inline-start: 6px;
  background-color: var(--peikko-icon-muted);
  -webkit-mask: var(--peikko-i-x) center / contain no-repeat;
  mask: var(--peikko-i-x) center / contain no-repeat;
  cursor: pointer;
}

.pf-v5-c-form-control > input[type="search"]::-webkit-search-cancel-button:hover {
  background-color: var(--peikko-dark);
}

.pf-v5-c-menu-toggle {
  --pf-v5-c-menu-toggle--BorderRadius: var(--peikko-radius);
  --pf-v5-c-menu-toggle--before--BorderBottomWidth: 1px;
  --pf-v5-c-menu-toggle--disabled--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-menu-toggle--disabled--Color: var(--peikko-disabled-text);
}

/* Inputs, selects, search boxes and toggles: one light border all round, no dark underline. */
.pf-v5-c-form-control::before,
.pf-v5-c-text-input-group__text::before,
.pf-v5-c-menu-toggle:not(.pf-m-plain)::before,
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control::before {
  border-color: var(--peikko-light);
  border-radius: var(--peikko-radius);
}

.pf-v5-c-form-control::after,
.pf-v5-c-text-input-group__text::after,
.pf-v5-c-menu-toggle:not(.pf-m-plain)::after,
.pf-v5-c-button.pf-m-control::after {
  border-bottom-color: transparent;
}

.pf-v5-c-form-control:hover::before {
  border-color: var(--peikko-border-strong);
}

.pf-v5-c-form-control:focus-within::before {
  border-color: var(--peikko-dark);
}

.pf-v5-c-text-input-group__text:focus-within::before {
  border-color: var(--peikko-dark);
}

.pf-v5-c-text-input-group__text:focus-within {
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-ring);
}

/* Errors: PatternFly marks them on ::after, which is hidden above. */
.pf-v5-c-form-control.pf-m-error::before,
.pf-v5-c-form-control.pf-m-error:hover::before,
.pf-v5-c-form-control.pf-m-error:focus-within::before,
.pf-v5-c-menu-toggle.pf-m-danger:not(.pf-m-plain)::before {
  border-color: var(--pf-v5-global--danger-color--100);
}

.pf-v5-c-form-control.pf-m-error:focus-within {
  box-shadow: 0 0 0 3px rgba(201, 25, 11, 0.15);
}

/* Selects and dropdown toggles in the content: 40px like inputs, white, with the same states. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-typeahead) {
  --pf-v5-c-menu-toggle--PaddingTop: 8px;
  --pf-v5-c-menu-toggle--PaddingBottom: 8px;
  --pf-v5-c-menu-toggle--PaddingLeft: 12px;
  --pf-v5-c-menu-toggle--PaddingRight: 12px;
  --pf-v5-c-menu-toggle--LineHeight: 24px;
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(:disabled):not(.pf-m-disabled):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle) {
  background-color: #ffffff;
  box-shadow: var(--peikko-shadow-sm);
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle):hover::before {
  border-color: var(--peikko-border-strong);
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle):is(.pf-m-expanded, :focus-visible, :has(input:focus), :has(+ .pf-v5-c-menu))::before {
  border-color: var(--peikko-dark);
}

/* Same :not() chain as the resting rule above, so the ring outranks its small shadow. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(:disabled):not(.pf-m-disabled):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle):is(.pf-m-expanded, :focus-visible, :has(input:focus), :has(+ .pf-v5-c-menu)) {
  box-shadow: var(--peikko-ring);
}

/* Disabled selects keep a light outline, like disabled inputs (PatternFly drops the border). */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle):is(:disabled, .pf-m-disabled)::before {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
}

/* Errors stay red on hover and focus; the content hover and focus rules above are more specific. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle.pf-m-danger:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle):is(:hover, .pf-m-expanded, :focus-visible, :has(input:focus), :has(+ .pf-v5-c-menu))::before {
  border-color: var(--pf-v5-global--danger-color--100);
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle.pf-m-danger:not(.pf-m-plain):not(.pf-m-primary):not(.pf-m-secondary):not(:disabled):not(.pf-m-disabled):not(.pf-v5-c-input-group .pf-v5-c-menu-toggle):is(.pf-m-expanded, :has(input:focus), :has(+ .pf-v5-c-menu)) {
  box-shadow: 0 0 0 3px rgba(201, 25, 11, 0.15);
}

/* Chevrons 12px from the right edge, the same as typeaheads in the same form column. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-typeahead) .pf-v5-c-menu-toggle__toggle-icon {
  margin-right: 0;
}

.pf-v5-c-menu-toggle.pf-m-primary {
  --pf-v5-c-menu-toggle--PaddingLeft: 16px;
  font-weight: 500;
}

/* Typeahead selects (required actions, event listeners, locales): the outer box is the control. */
.pf-v5-c-menu-toggle.pf-m-typeahead {
  min-height: 40px;
}

.pf-v5-c-menu-toggle.pf-m-typeahead:focus-within {
  box-shadow: var(--peikko-ring);
}

.pf-v5-c-menu-toggle.pf-m-typeahead:focus-within::before {
  border-color: var(--peikko-dark);
}

.pf-v5-c-menu-toggle.pf-m-typeahead .pf-v5-c-text-input-group__text:focus-within {
  box-shadow: none;
}

.pf-v5-c-menu-toggle.pf-m-typeahead .pf-v5-c-text-input-group__text::before {
  border: none;
}

/* Text on the same 12px line as other fields while there are no chips; chevron 12px from the edge. */
.pf-v5-c-menu-toggle.pf-m-typeahead .pf-v5-c-text-input-group__main:not(:has(.pf-v5-c-chip-group)) .pf-v5-c-text-input-group__text-input {
  padding-inline-start: 12px;
}

.pf-v5-c-menu-toggle.pf-m-typeahead .pf-v5-c-menu-toggle__button {
  padding-inline-end: 4px;
}

/* The clear button only shows when there is something to clear. Some typeaheads have no placeholder,
   so the empty value attribute (React keeps it in sync) counts too. */
.pf-v5-c-menu-toggle.pf-m-typeahead:not(:has(.pf-v5-c-chip)):has(.pf-v5-c-text-input-group__text-input:is(:placeholder-shown, [value=""])) .pf-v5-c-text-input-group__utilities {
  display: none;
}

/* Multi-selects with chips: no placeholder once there is a value, and the caret flows after the chips
   instead of wrapping to a line of its own. */
.pf-v5-c-menu-toggle.pf-m-typeahead .pf-v5-c-text-input-group__main:has(.pf-v5-c-chip) .pf-v5-c-text-input-group__text-input {
  min-width: 6ch;
}

.pf-v5-c-menu-toggle.pf-m-typeahead .pf-v5-c-text-input-group__main:has(.pf-v5-c-chip) .pf-v5-c-text-input-group__text-input::placeholder {
  color: transparent;
}

/* Lighter placeholders, so a label used as placeholder doesn't read as a filled-in value. */
.pf-v5-c-form-control,
.pf-v5-c-text-input-group {
  --pf-v5-c-form-control--placeholder--Color: var(--peikko-disabled-text);
  --pf-v5-c-text-input-group__text-input--placeholder--Color: var(--peikko-disabled-text);
}

.pf-v5-c-form-control > :is(input, textarea)::placeholder,
.pf-v5-c-text-input-group__text-input::placeholder {
  color: var(--peikko-disabled-text);
  opacity: 1;
}

/* Selects inside table rows stay compact, so rows keep their height. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-table td .pf-v5-c-menu-toggle:not(.pf-m-plain):not(.pf-m-typeahead) {
  --pf-v5-c-menu-toggle--PaddingTop: 4px;
  --pf-v5-c-menu-toggle--PaddingBottom: 4px;
  --pf-v5-c-menu-toggle--PaddingLeft: 10px;
  --pf-v5-c-menu-toggle--PaddingRight: 10px;
  min-width: 120px;
  justify-content: space-between;
  font-size: 14px;
}

/* ---------- Input groups ---------- */

/* Search with its arrow button (and the filter dropdown on Users) as one control:
   one rounded border around the outermost group, thin dividers inside, one focus ring.
   On Users the search group sits inside the filter's group, so only the outer one is outlined. */
.pf-v5-c-input-group:has(.pf-v5-c-text-input-group, .kc-dropdown-panel):not(.pf-v5-c-input-group .pf-v5-c-input-group) {
  position: relative;
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-input-group:has(.pf-v5-c-text-input-group, .kc-dropdown-panel):not(.pf-v5-c-input-group .pf-v5-c-input-group)::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  pointer-events: none;
}

.pf-v5-c-input-group:has(.pf-v5-c-text-input-group, .kc-dropdown-panel):not(.pf-v5-c-input-group .pf-v5-c-input-group):focus-within {
  box-shadow: var(--peikko-ring);
}

.pf-v5-c-input-group:has(.pf-v5-c-text-input-group, .kc-dropdown-panel):not(.pf-v5-c-input-group .pf-v5-c-input-group):focus-within::after {
  border-color: var(--peikko-dark);
}

/* The inner group and its toolbar item add no border, shadow or spacing of their own. */
.pf-v5-c-input-group .pf-v5-c-input-group {
  box-shadow: none;
  background: transparent;
}

.pf-v5-c-input-group .pf-v5-c-toolbar__item {
  margin: 0;
  padding: 0;
}

.pf-v5-c-input-group .pf-v5-c-text-input-group__text::before,
.pf-v5-c-input-group .pf-v5-c-text-input-group__text::after,
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control::before,
.pf-v5-c-input-group .pf-v5-c-button.pf-m-control::after,
.pf-v5-c-input-group .pf-v5-c-menu-toggle::before,
.pf-v5-c-input-group .pf-v5-c-menu-toggle::after {
  border: none;
}

.pf-v5-c-input-group .pf-v5-c-text-input-group__text:focus-within {
  box-shadow: none;
}

.pf-v5-c-input-group .pf-v5-c-button.pf-m-control {
  border-left: 1px solid var(--peikko-light);
  border-radius: 0 var(--peikko-radius) var(--peikko-radius) 0;
  background: transparent;
  box-shadow: none;
}

.pf-v5-c-input-group .pf-v5-c-button.pf-m-control:hover {
  background: var(--peikko-mist);
}

.pf-v5-c-input-group .pf-v5-c-menu-toggle {
  border-right: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius) 0 0 var(--peikko-radius);
  box-shadow: none;
}

.pf-v5-c-input-group .pf-v5-c-button:focus-visible,
.pf-v5-c-input-group .pf-v5-c-menu-toggle:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.5);
}

/* Search clear (x): drawn over the end of the field, so typing doesn't widen the search
   and push the toolbar buttons to the right. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar .pf-v5-c-text-input-group {
  position: relative;
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar .pf-v5-c-text-input-group:has(> .pf-v5-c-text-input-group__utilities) .pf-v5-c-text-input-group__text-input {
  padding-inline-end: 36px;
  margin-inline-end: -28px; /* gives back the extra padding, so the field keeps its width */
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar .pf-v5-c-text-input-group > .pf-v5-c-text-input-group__utilities {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 4px;
  z-index: 1;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* Clear buttons in search fields, typeaheads and chips: small muted icon tiles. */
.pf-v5-c-text-input-group__utilities .pf-v5-c-button.pf-m-plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--peikko-icon-muted);
  border-radius: 6px;
}

:is(.pf-v5-c-text-input-group__utilities, .pf-v5-c-chip__actions, .pf-v5-c-alert__action) .pf-v5-c-button.pf-m-plain {
  color: var(--peikko-icon-muted);
}

:is(.pf-v5-c-text-input-group__utilities, .pf-v5-c-chip__actions, .pf-v5-c-alert__action) .pf-v5-c-button.pf-m-plain:hover {
  color: var(--peikko-dark);
}

.pf-v5-c-text-input-group__utilities .pf-v5-c-button.pf-m-plain:hover {
  background-color: var(--peikko-hover);
}

/* Keyboard focus on the search arrow (and copy, show password, calendar, steppers) shows on that segment.
   The no-shadow rule for control buttons below is more specific than the generic ring. */
.pf-v5-c-input-group :is(.pf-v5-c-input-group__item, .pf-v5-c-input-group) > .pf-v5-c-button.pf-m-control:focus-visible,
.pf-v5-c-input-group > .pf-v5-c-button.pf-m-control:focus-visible,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control:focus-visible {
  color: var(--peikko-dark);
  background: var(--peikko-mist);
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.6);
}

/* A field with buttons attached (copy, show password, calendar, Browse/Clear, number steppers):
   the group draws one outline, the field loses its own, and the buttons get thin dividers. */
.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-form-control, > .pf-v5-c-form-control, > .pf-v5-c-input-group__item > .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control):has(.pf-v5-c-button.pf-m-control):not(:has(.pf-v5-c-text-input-group, .kc-dropdown-panel)):not(.pf-v5-c-input-group__item > .pf-v5-c-input-group),
.pf-v5-c-clipboard-copy__group {
  position: relative;
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-form-control, > .pf-v5-c-form-control, > .pf-v5-c-input-group__item > .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control):has(.pf-v5-c-button.pf-m-control):not(:has(.pf-v5-c-text-input-group, .kc-dropdown-panel)):not(.pf-v5-c-input-group__item > .pf-v5-c-input-group)::after,
.pf-v5-c-clipboard-copy__group::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  pointer-events: none;
}

.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-form-control, > .pf-v5-c-form-control, > .pf-v5-c-input-group__item > .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control):has(.pf-v5-c-button.pf-m-control):not(:has(.pf-v5-c-text-input-group, .kc-dropdown-panel)):not(.pf-v5-c-input-group__item > .pf-v5-c-input-group):hover::after,
.pf-v5-c-clipboard-copy__group:hover::after {
  border-color: var(--peikko-border-strong);
}

.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-form-control, > .pf-v5-c-form-control, > .pf-v5-c-input-group__item > .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control):has(.pf-v5-c-button.pf-m-control):not(:has(.pf-v5-c-text-input-group, .kc-dropdown-panel)):not(.pf-v5-c-input-group__item > .pf-v5-c-input-group):has(:is(input, textarea):focus, :focus-visible),
.pf-v5-c-clipboard-copy__group:has(:is(input, textarea):focus, :focus-visible) {
  box-shadow: var(--peikko-ring);
}

.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-form-control, > .pf-v5-c-form-control, > .pf-v5-c-input-group__item > .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control):has(.pf-v5-c-button.pf-m-control):not(:has(.pf-v5-c-text-input-group, .kc-dropdown-panel)):not(.pf-v5-c-input-group__item > .pf-v5-c-input-group):has(:is(input, textarea):focus, :focus-visible)::after,
.pf-v5-c-clipboard-copy__group:has(:is(input, textarea):focus, :focus-visible)::after {
  border-color: var(--peikko-dark);
}

.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-input-group__item > .pf-v5-c-form-control,
.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-form-control,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-form-control {
  border-radius: 0;
  box-shadow: none;
}

.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-input-group__item:first-child > .pf-v5-c-form-control,
.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-form-control:first-child,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-form-control:first-child {
  border-radius: var(--peikko-radius) 0 0 var(--peikko-radius);
}

.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-input-group__item > .pf-v5-c-form-control::before,
.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-form-control::before,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-form-control::before {
  border: none;
}

.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-input-group__item > .pf-v5-c-form-control:focus-within,
.pf-v5-c-input-group:has(.pf-v5-c-button.pf-m-control) > .pf-v5-c-form-control:focus-within,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-form-control:focus-within {
  box-shadow: none;
}

.pf-v5-c-input-group :is(.pf-v5-c-input-group__item, .pf-v5-c-input-group) > .pf-v5-c-button.pf-m-control,
.pf-v5-c-input-group > .pf-v5-c-button.pf-m-control,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control {
  min-width: 40px;
  color: var(--peikko-icon-muted);
  background: transparent;
  border-left: 1px solid var(--peikko-light);
  border-radius: 0;
  box-shadow: none;
}

.pf-v5-c-input-group > .pf-v5-c-input-group__item:last-child > .pf-v5-c-button.pf-m-control,
.pf-v5-c-input-group > .pf-v5-c-button.pf-m-control:last-child,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control:last-child {
  border-radius: 0 var(--peikko-radius) var(--peikko-radius) 0;
}

.pf-v5-c-input-group :is(.pf-v5-c-input-group__item, .pf-v5-c-input-group) > .pf-v5-c-button.pf-m-control:hover,
.pf-v5-c-input-group > .pf-v5-c-button.pf-m-control:hover,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control:hover {
  color: var(--peikko-dark);
  background: var(--peikko-mist);
}

.pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control::before,
.pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control::after {
  border: none;
}

/* Client secret: the show-password group sits inside the copy group; only the outer one is outlined. */
.pf-v5-c-input-group__item:not(:last-child) > .pf-v5-c-input-group > .pf-v5-c-button.pf-m-control:last-child {
  border-radius: 0;
}

/* Number stepper: minus | value | plus */
.pf-v5-c-number-input {
  --pf-v5-c-number-input--c-form-control--width-base: 26px;
}

.pf-v5-c-number-input .pf-v5-c-input-group {
  width: max-content;
}

.pf-v5-c-number-input .pf-v5-c-input-group > .pf-v5-c-input-group__item:first-child > .pf-v5-c-button.pf-m-control {
  border-left: none;
  border-right: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius) 0 0 var(--peikko-radius);
}

.pf-v5-c-number-input .pf-v5-c-button.pf-m-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pf-v5-c-number-input .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control {
  border-radius: 0;
}

/* The value sits centred between minus and plus (PatternFly right-aligns it). */
.pf-v5-c-number-input .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-form-control > input {
  text-align: center;
  padding-inline: 8px;
}

/* At the minimum the minus button looks unavailable. */
.pf-v5-c-number-input .pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-control:disabled {
  color: var(--peikko-border-strong);
  background: transparent;
  cursor: not-allowed;
}

/* Date picker: the field fills the column, the calendar button is part of it. */
.pf-v5-c-date-picker.pf-v5-u-w-100 .pf-v5-c-date-picker__input,
.pf-v5-c-date-picker.pf-v5-u-w-100 .pf-v5-c-input-group__item:first-child {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.pf-v5-c-date-picker.pf-v5-u-w-100 .pf-v5-c-form-control {
  width: 100%;
  max-width: none;
}

/* File upload (Import client, Partial import, Create realm): one outlined picker,
   then the editor in a soft bordered box. */
.pf-v5-c-file-upload__file-select .pf-v5-c-button.pf-m-control {
  font-weight: 500;
  color: var(--peikko-dark);
}

.pf-v5-c-file-upload__file-select .pf-v5-c-button.pf-m-control:disabled {
  color: var(--peikko-disabled-text);
}

/* The muted control-button color in input groups is more specific than the rule above. */
.pf-v5-c-file-upload__file-select .pf-v5-c-input-group > .pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-control:not(:disabled) {
  color: var(--peikko-dark);
}

.pf-v5-c-file-upload > div:has(> .w-tc-editor) {
  margin-top: 8px;
}

/* Users toolbar in attribute-search mode: the filter panel button is a segment of the outlined group.
   'Select attributes' is a prompt, so it is muted like the search placeholder. */
html .pf-v5-c-input-group .kc-dropdown-panel {
  min-height: 39px;
  color: var(--peikko-steel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Segments in the users search group: a Mist tile on hover and while open, like the arrow button.
   The group already draws the ring, so the segment doesn't add its own (only a keyboard inset). */
.pf-v5-c-input-group [data-testid="user-search-toggle"]:is(:hover, .pf-m-expanded),
html .pf-v5-c-input-group .kc-dropdown-panel:is(:hover, :has(+ .kc-dropdown-panel-content)) {
  background-color: var(--peikko-mist);
}

html .pf-v5-c-input-group .kc-dropdown-panel:is(:focus, :active, :has(+ .kc-dropdown-panel-content)) {
  box-shadow: none;
}

html .pf-v5-c-input-group .kc-dropdown-panel:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.5);
}

/* Fields inside a dropdown panel that sits inside the users input group keep their own outline. */
.pf-v5-c-input-group .kc-dropdown-panel-content .pf-v5-c-menu-toggle {
  border-right: 0;
  border-radius: var(--peikko-radius);
  background: #ffffff;
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-input-group .kc-dropdown-panel-content .pf-v5-c-menu-toggle::before {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
}

.pf-v5-c-input-group .kc-dropdown-panel-content .pf-v5-c-menu-toggle:is(:focus-within, .pf-m-expanded)::before {
  border-color: var(--peikko-dark);
}

.pf-v5-c-input-group .kc-dropdown-panel-content .pf-v5-c-menu-toggle:is(:focus-within, .pf-m-expanded) {
  box-shadow: var(--peikko-ring);
}

/* Attribute search mode: the same thin arrow and width as the plain search button. */
.pf-v5-c-input-group button[aria-label="Search attributes"] {
  min-width: 48px;
  padding-inline: 16px;
  color: var(--peikko-icon-muted);
}

.pf-v5-c-input-group button[aria-label="Search attributes"] > .pf-v5-c-button__icon {
  margin: 0;
}

/* Users 'Select attributes' panel: one padding, Key and Value apart, the Value field fills its column,
   and the buttons in a grey footer on the right like the Events search panel. */
html .kc-dropdown-panel-content:has(> .user-attribute-search-form) {
  padding: 0;
}

.kc-dropdown-panel-content > form.user-attribute-search-form {
  padding: 20px 20px 0;
}

.user-attribute-search-form > .user-attribute-search-form-left {
  padding-inline-end: 12px;
}

.user-attribute-search-form-right .pf-v5-c-input-group > .pf-v5-c-input-group__item:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.user-attribute-search-form-right .pf-v5-c-input-group .pf-v5-c-form-control {
  width: 100%;
}

.user-attribute-search-form > .pf-v5-u-pt-lg {
  padding-top: 16px !important; /* spacing utility */
}

.user-attribute-search-form > .pf-v5-c-form__group.pf-m-action.user-attribute-search-form-action-group {
  margin: 20px -20px 0;
  padding: 12px 20px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
  border-radius: 0 0 11px 11px; /* the panel can't clip with overflow, or the Key menu gets cut off */
}

.user-attribute-search-form-action-group .pf-v5-c-form__actions {
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
}

/* ---------- Dropdown panels (event search, attribute search, message bundles) ---------- */

html .kc-dropdown-panel {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 240px;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 15px;
  color: var(--peikko-dark);
  background: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

html .kc-dropdown-panel:hover {
  border-color: var(--peikko-border-strong);
}

/* The ring shows for keyboard focus and while the panel is open (its content is the next sibling),
   not after a mouse click has closed it again. */
html .kc-dropdown-panel:focus {
  outline: none;
}

html .kc-dropdown-panel:is(:focus-visible, :has(+ .kc-dropdown-panel-content)) {
  border-color: var(--peikko-dark);
  border-bottom-width: 1px;
  box-shadow: var(--peikko-ring);
  outline: none;
}

html .kc-dropdown-panel .kc-dropdown-panel-icon {
  float: none;
  margin: 0 0 0 auto;
  color: var(--peikko-icon-muted);
}

html .kc-dropdown-panel-content {
  margin-top: 6px;
  padding: 16px;
  min-width: 380px;
  background: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  box-shadow: var(--peikko-shadow-md);
}

/* A form in the panel: two-column dates, grey footer at the bottom of the panel */
.kc-dropdown-panel-content > .pf-v5-c-form.pf-m-horizontal {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.kc-dropdown-panel-content > .pf-v5-c-form.pf-m-horizontal > .pf-v5-c-form__group {
  grid-column: 1 / -1;
}

.kc-dropdown-panel-content > .pf-v5-c-form.pf-m-horizontal > .pf-v5-c-form__group:has(.pf-v5-c-date-picker) {
  grid-column: auto;
}

.kc-dropdown-panel-content .pf-v5-c-form.pf-m-horizontal .pf-v5-c-form__group.pf-m-action {
  margin: 4px -16px -16px;
  padding: 12px 16px;
  border-radius: 0 0 11px 11px;
}

.kc-dropdown-panel-content .pf-v5-c-form__actions {
  gap: 8px;
}

/* Admin events search: two columns, so the panel and its buttons fit in the window. */
.kc-dropdown-panel-content > .keycloak__events_search__form:has([aria-label="select-resourceTypes"]) > .pf-v5-c-form__group:not(.pf-m-action) {
  grid-column: auto;
}

/* The text field right before the dates (IP address) keeps the full width. */
.kc-dropdown-panel-content > .keycloak__events_search__form:has([aria-label="select-resourceTypes"]) > .pf-v5-c-form__group:not(.keycloak__events_search__form_label):has(+ .keycloak__events_search__form_label) {
  grid-column: 1 / -1;
}

/* Only when it is alone in its row (odd position). The group version has no Resource path, so there
   it is even and pairs with User ID. */
.kc-dropdown-panel-content > .keycloak__events_search__form:has([aria-label="select-resourceTypes"]) > .pf-v5-c-form__group:not(.keycloak__events_search__form_label):has(+ .keycloak__events_search__form_label):nth-child(even) {
  grid-column: auto;
}

/* Event search triggers carry an inline 40px right margin; toolbars use 8px gaps. */
html .pf-v5-c-toolbar .kc-dropdown-panel[style*="margin-right"] {
  margin-right: 8px !important;
}

.user-attribute-search-form-headline h2 {
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Code editor (JSON views) ---------- */

div:has(> .w-tc-editor) {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  background: var(--peikko-mist);
}

div:has(> .w-tc-editor):focus-within {
  border-color: var(--peikko-dark);
  box-shadow: var(--peikko-ring);
}

/* Beats the editor's own [data-color-mode] rules and its dark-scheme palette. */
:is(.pf-v5-c-modal-box, .pf-v5-c-page) div.w-tc-editor {
  --color-canvas-subtle: var(--peikko-mist);
  --color-fg-default: var(--peikko-dark);
  --color-prettylights-syntax-constant: var(--peikko-dark);
  --color-prettylights-syntax-entity-tag: #4f6b12; /* booleans and numbers: Circular Green shade */
  --color-prettylights-syntax-keyword: #4f6b12;
  --color-prettylights-syntax-sublimelinter-gutter-mark: #9aa3ab;
  background-color: var(--peikko-mist);
  border-radius: var(--peikko-radius);
  /* overrides the inline 16px; textarea and preview both inherit it, so the caret stays aligned */
  font-size: 13px !important;
  line-height: 20px;
}

:is(.pf-v5-c-modal-box, .pf-v5-c-page) .w-tc-editor pre[class*="language-"] .token.property {
  color: var(--peikko-dark);
}

:is(.pf-v5-c-modal-box, .pf-v5-c-page) .w-tc-editor pre[class*="language-"] .token.string {
  color: var(--peikko-steel);
}

:is(.pf-v5-c-modal-box, .pf-v5-c-page) .w-tc-editor pre[class*="language-"] .token:is(.operator, .punctuation) {
  color: #9aa3ab;
}

/* Client policies JSON view: on the page gutter; the footer band under it is in the forms section. */
.pf-v5-c-tab-content .pf-v5-c-form__group-control:has(> .pf-v5-u-ml-lg > div > .w-tc-editor) {
  padding: 0 var(--peikko-gutter) 0 8px;
}

/* Admin event representation: the inline 128px scroll box shows only five lines. */
.pf-v5-c-modal-box__body > div[style*="height: 128px"] {
  height: auto !important;
  max-height: 60vh;
}

/* ---------- Tabs: plain text, thin orange line under the current tab ---------- */

.pf-v5-c-tabs {
  --pf-v5-c-tabs__link--Color: var(--peikko-steel);
  --pf-v5-c-tabs__item--m-current__link--Color: var(--peikko-dark);
  --pf-v5-c-tabs__item--m-current__link--after--BorderColor: var(--peikko-orange);
  --pf-v5-c-tabs__link--after--BorderColor: transparent;
  --pf-v5-c-tabs__link--before--BorderColor: transparent;
  --pf-v5-c-tabs--before--BorderColor: var(--peikko-light);
}

/* Scroll arrows: narrow, no separator lines. The Tabs chunk loads after this file. */
html .pf-v5-c-tabs {
  --pf-v5-c-tabs__scroll-button--Width: 32px;
  --pf-v5-c-tabs__scroll-button--xl--Width: 32px;
  --pf-v5-c-tabs__scroll-button--before--BorderColor: transparent;
}

html .pf-v5-c-tabs__scroll-button::before {
  border-width: 0;
}

html .pf-v5-c-tabs > .pf-v5-c-tabs__scroll-button:disabled {
  color: var(--peikko-border-strong);
  background: transparent;
}

/* At the start the disabled back arrow takes no room, so the first tab stays under the title. */
html .pf-v5-c-tabs.pf-m-scrollable > .pf-v5-c-tabs__scroll-button:first-child:disabled {
  margin-inline-end: calc(var(--pf-v5-c-tabs__scroll-button--Width) * -1);
  opacity: 0;
  pointer-events: none;
}

/* The cut edge fades instead of slicing a label in half. */
html .pf-v5-c-tabs.pf-m-scrollable > .pf-v5-c-tabs__scroll-button:first-child:disabled + .pf-v5-c-tabs__list:has(+ .pf-v5-c-tabs__scroll-button:not(:disabled)) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}

html .pf-v5-c-tabs.pf-m-scrollable > .pf-v5-c-tabs__scroll-button:first-child:not(:disabled) + .pf-v5-c-tabs__list:has(+ .pf-v5-c-tabs__scroll-button:not(:disabled)) {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

html .pf-v5-c-tabs.pf-m-scrollable > .pf-v5-c-tabs__scroll-button:first-child:not(:disabled) + .pf-v5-c-tabs__list:has(+ .pf-v5-c-tabs__scroll-button:disabled) {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 48px);
  mask-image: linear-gradient(to right, transparent, #000 48px);
}

.pf-v5-c-tabs .pf-v5-c-tabs__link {
  background-color: transparent;
  font-size: 15px;
}

.pf-v5-c-tabs .pf-v5-c-tabs__link:hover {
  color: var(--peikko-dark);
}

.pf-v5-c-tabs .pf-v5-c-tabs__link::before {
  border: none;
}

/* Only the current tab has a line; PatternFly's grey hover bar competes with it. */
.pf-v5-c-tabs .pf-v5-c-tabs__item:not(.pf-m-current) .pf-v5-c-tabs__link::after {
  border: none;
}

/* PatternFly's box tabs draw the line at the top; move it to the bottom. */
.pf-v5-c-tabs .pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link::after {
  inset: auto 0 0 0;
  border-top: none;
  border-bottom: 2px solid var(--peikko-orange);
}

.pf-v5-c-tabs .pf-v5-c-tabs__scroll-button {
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

.pf-v5-c-tabs .pf-v5-c-tabs__scroll-button:hover {
  color: var(--peikko-dark);
  background-color: var(--peikko-hover);
}

.pf-v5-c-tab-content:focus-visible {
  outline: 2px solid rgba(51, 58, 71, 0.15);
  outline-offset: -2px;
}

/* Page tabs (Geist style): 14px labels on the page gutter, the line just under the label.
   The link has 8px of padding so the focus ring fits inside the scrolling list. */
:is(.pf-v5-c-page__main-section, .pf-v5-c-drawer__body) > .pf-v5-c-tabs.pf-v5-c-tabs:not(.pf-m-vertical) {
  --pf-v5-c-tabs--inset: calc(var(--peikko-gutter) - 8px);
}

:is(.pf-v5-c-page__main-section, .pf-v5-c-drawer__body) > .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__link {
  padding-inline: 8px;
  font-size: 14px;
}

/* A gap rather than a start margin, so a wrapped row (Realm settings below 1366px) starts on the gutter. */
:is(.pf-v5-c-page__main-section, .pf-v5-c-drawer__body) > .pf-v5-c-tabs:not(.pf-m-vertical) > .pf-v5-c-tabs__list {
  column-gap: 4px;
}

:is(.pf-v5-c-page__main-section, .pf-v5-c-drawer__body) > .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link::after {
  inset: auto 6px 0 6px;
}

:is(.pf-v5-c-page__main-section, .pf-v5-c-drawer__body) > .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__link:focus-visible {
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.5);
}

/* Realm settings has 13 tabs. They fit from 1366px; below that they wrap, so the current tab
   is never scrolled out of sight (PatternFly doesn't scroll it into view). */
@media (max-width: 1365.98px) {
  .pf-v5-c-page__main-section > .pf-v5-c-tabs:has([data-testid="rs-general-tab"]) > .pf-v5-c-tabs__list {
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* Tabs inside a tab become a quiet segmented control, so the two levels don't compete. */
.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) {
  --pf-v5-c-tabs--before--BorderColor: transparent;
  --pf-v5-c-tabs--inset: 0px;
  padding: 20px var(--peikko-gutter) 4px;
}

.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__list {
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  background: var(--peikko-mist);
  border: 1px solid var(--peikko-light);
  border-radius: 10px;
}

.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__item + .pf-v5-c-tabs__item {
  margin-inline-start: 0;
}

/* One weight for all segments, so their widths don't change when you switch. */
.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__link {
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 7px;
}

/* The track has 3px of padding, so the ring goes inside the segment. */
.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__item .pf-v5-c-tabs__link:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.55), 0 1px 2px rgba(51, 58, 71, 0.1);
}

.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__link:hover {
  background-color: var(--peikko-hover);
}

.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link {
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(51, 58, 71, 0.1), 0 0 0 1px var(--peikko-light);
  font-weight: 500;
}

.pf-v5-c-tab-content .pf-v5-c-tabs:not(.pf-m-vertical) .pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link::after {
  border: none;
}

/* Vertical tabs (Client scopes > Evaluate): orange marker on the left, like the jump links. */
.pf-v5-c-tabs.pf-m-vertical {
  --pf-v5-c-tabs--m-vertical__link--PaddingTop: 8px;
  --pf-v5-c-tabs--m-vertical__link--PaddingBottom: 8px;
}

.pf-v5-c-tabs.pf-m-vertical .pf-v5-c-tabs__link {
  font-size: 14px;
}

.pf-v5-c-tabs.pf-m-vertical .pf-v5-c-tabs__item.pf-m-current .pf-v5-c-tabs__link::after {
  inset: 0 auto 0 0;
  border-bottom: none;
  border-left: 2px solid var(--peikko-orange);
}

.pf-v5-c-tabs.pf-m-vertical .pf-v5-c-tabs__item-text .pf-v5-c-icon {
  margin-left: 4px;
  color: var(--peikko-icon-muted);
}

/* Client scopes > Evaluate: Keycloak puts 48px above the results. */
html .keycloak__scopes_evaluate__tabs {
  padding-top: 8px;
}

/* One rhythm: the intro line sits as close under Setup/Evaluate as the form card sits under it,
   and the token panels start where the mapper list's toolbar starts. */
html .pf-v5-c-tab-content:has(.keycloak__scopes_evaluate__tabs) .keycloak__section_intro__help {
  padding-top: 0;
}

.keycloak__scopes_evaluate__tabs > .pf-v5-l-grid__item > section.pf-v5-c-tab-content {
  margin-top: 0;
}

.keycloak__scopes_evaluate__tabs > .pf-v5-l-grid__item > section.pf-v5-c-tab-content > .pf-v5-c-empty-state {
  margin-top: 16px;
}

.keycloak__scopes_evaluate__clipboard-copy .pf-v5-c-clipboard-copy__group > .pf-v5-c-form-control {
  display: none; /* Keycloak hides the input but not its wrapper */
}

.keycloak__scopes_evaluate__clipboard-copy .pf-v5-c-clipboard-copy__group > .pf-v5-c-button.pf-m-control {
  border-left: 0;
  border-radius: var(--peikko-radius);
}

/* ---------- Cards ---------- */

/* The outline is an overlay, because card content can paint over a normal border. */
.pf-v5-c-card {
  --pf-v5-c-card--BoxShadow: none;
  position: relative;
  border: none;
  border-radius: var(--peikko-radius-lg);
  background: #ffffff;
}

/* PatternFly's flat card adds a real border under the overlay. */
.pf-v5-c-card.pf-m-flat {
  border: 0;
}

.pf-v5-c-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  pointer-events: none;
}

/* Clickable cards (for example identity providers): lift on hover */
.pf-v5-c-card.pf-m-clickable {
  --pf-v5-c-card--m-selectable--hover--BackgroundColor: transparent;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pf-v5-c-card.pf-m-clickable:hover {
  box-shadow: var(--peikko-shadow-md);
  transform: translateY(-1px);
}

.pf-v5-c-card.pf-m-clickable:hover::after {
  border-color: var(--peikko-border-strong);
}

.pf-v5-c-card.pf-m-clickable .pf-v5-c-card__title,
.pf-v5-c-card.pf-m-clickable .pf-v5-c-card__header {
  font-weight: 500;
}

.pf-v5-c-card .pf-v5-c-card__selectable-actions :is(.pf-v5-c-radio__label, .pf-v5-c-check__label)::before {
  border-radius: var(--peikko-radius-lg);
}

/* Provider cards: outline icon in a soft tile, same glyph as the sidebar. */
.pf-v5-c-card.pf-m-clickable .pf-v5-c-card__title .pf-v5-c-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--peikko-dark);
  background: var(--peikko-mist);
  border: 1px solid var(--peikko-light);
  border-radius: 10px;
}

.pf-v5-c-card.pf-m-clickable .pf-v5-c-card__title .pf-v5-l-split {
  align-items: center;
}

/* User federation: wide enough that both provider titles stay on one line. */
.pf-v5-l-gallery:has(> [data-testid="kerberos-card"], > [data-testid="ldap-card"]) {
  --pf-v5-l-gallery--GridTemplateColumns--min: 300px;
}

:is([data-testid="kerberos-card"], [data-testid="ldap-card"]) .pf-v5-c-card__title .pf-v5-c-icon__content > svg {
  --peikko-i: var(--peikko-i-database);
  width: 18px;
  height: 18px;
}

/* Kerberos is ticket based: a key, so the two choices don't share a glyph. */
[data-testid="kerberos-card"] .pf-v5-c-card__title .pf-v5-c-icon__content > svg {
  --peikko-i: var(--peikko-i-key);
}

/* Generic identity providers (OIDC, SAML, OAuth, ...): an outline box instead of FontAwesome's solid cube.
   Brand logos (Google, GitHub and so on) stay as they are. */
.pf-v5-c-card.pf-m-clickable .pf-v5-c-card__title .pf-v5-c-icon__content > svg:has(> path[d^="M239.1 6.3l-208 78"]) {
  --peikko-i: var(--peikko-i-box);
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-card.pf-m-clickable .pf-v5-c-card__title .pf-v5-c-icon__content > svg:has(> path[d^="M239.1 6.3l-208 78"]) > * {
  display: none;
}

/* Keycloak's form panels (Login, Email, Sessions, client Advanced) and cards that only wrap a form card
   are section wrappers: heading above, then the form card, like the Settings tab. */
/* Static: PatternFly's jump-link scrollspy measures offsetTop, which a positioned card resets to 0,
   so the last section was always marked current. The outline overlay is hidden on these anyway. */
.pf-v5-c-card:is(:has(> .kc-form-panel__header), :has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal)) {
  position: static;
  background: transparent;
}

.pf-v5-c-card:is(:has(> .kc-form-panel__header), :has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal))::after {
  display: none;
}

.pf-v5-c-card:is(:has(> .kc-form-panel__header), :has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal)) > .pf-v5-c-card__header {
  padding: 0 0 16px;
}

.pf-v5-c-card:is(:has(> .kc-form-panel__header), :has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal)) > .pf-v5-c-card__header .pf-v5-c-title {
  margin: 0;
}

.pf-v5-c-card:is(:has(> .kc-form-panel__header), :has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal)) > .pf-v5-c-card__body {
  padding: 0;
}

.pf-v5-c-card:is(:has(> .kc-form-panel__header), :has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal)) {
  margin-bottom: 32px;
}

.pf-v5-c-card:has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal) .pf-v5-c-card__title-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pf-v5-c-card:has(> .pf-v5-c-card__body > .pf-v5-c-form.pf-m-horizontal) > .pf-v5-c-card__body > :is(p, .pf-v5-c-content) {
  max-width: 760px;
  padding-bottom: 16px;
  color: var(--peikko-steel);
}

.kc-form-panel__body > .pf-v5-c-form.pf-v5-u-mt-lg {
  margin-top: 0 !important;
}

/* A form card that only wraps cards (client Credentials) steps aside; the inner cards are the cards. */
.pf-v5-c-page__main-section .pf-v5-c-form.pf-m-horizontal:has(> .pf-v5-c-card) {
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-card > .pf-v5-c-card__body:has(> .pf-v5-c-form__group.pf-m-action:last-child) {
  padding-bottom: 0;
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-card .pf-v5-c-form__group.pf-m-action {
  margin-top: 32px; /* the same space above the footer as the other form cards */
  border-radius: 0 0 11px 11px;
}

.pf-v5-c-form.pf-m-horizontal > .pf-v5-c-card > .pf-v5-c-card__body > .pf-v5-c-form__group:not(:first-child):not(.pf-m-action) {
  margin-top: 24px;
}

/* ---------- Menus ---------- */

.pf-v5-c-menu,
.pf-v5-c-dropdown__menu,
.pf-v5-c-select__menu {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  box-shadow: var(--peikko-shadow-md);
}

/* Rows inset with rounded corners; BackgroundColor--200 is white here, so hover needs its own color. */
.pf-v5-c-menu {
  --pf-v5-c-menu__list-item--hover--BackgroundColor: var(--peikko-hover);
  /* Only the keyboard-focused row is highlighted (below), so a mouse user never sees two grey rows. */
  --pf-v5-c-menu__list-item--focus-within--BackgroundColor: transparent;
  --pf-v5-c-menu__header--c-menu__item--hover--BackgroundColor: var(--peikko-hover);
  --pf-v5-c-menu__header--c-menu__item--focus--BackgroundColor: var(--peikko-hover);
  --pf-v5-c-menu__list--PaddingTop: 4px;
  --pf-v5-c-menu__list--PaddingBottom: 4px;
  --pf-v5-c-menu__item--PaddingTop: 7px;
  --pf-v5-c-menu__item--PaddingBottom: 7px;
  --pf-v5-c-menu__item--PaddingLeft: 10px;
  --pf-v5-c-menu__item--PaddingRight: 10px;
  --pf-v5-c-menu__item--FontSize: 14px;
  animation: peikko-pop-in 0.12s ease-out;
}

.pf-v5-c-menu__list {
  padding-inline: 4px;
}

.pf-v5-c-menu__list-item {
  border-radius: 6px;
}

.pf-v5-c-menu__item:focus-visible {
  outline: none;
}

.pf-v5-c-menu__list-item:has(> .pf-v5-c-menu__item:focus-visible),
.pf-v5-c-menu__list-item.pf-m-focus {
  background-color: var(--peikko-hover);
}

/* PatternFly focuses the first item when a menu opens, and its :focus-within rule (transparent here)
   comes after :hover. The hovered row must still show hover. */
.pf-v5-c-menu .pf-v5-c-menu__list-item:hover:not(.pf-m-disabled):not(.pf-m-aria-disabled) {
  --pf-v5-c-menu__list-item--BackgroundColor: var(--peikko-hover);
}

/* While the pointer is in the menu, only the hovered row is highlighted (typeaheads mark their first option). */
.pf-v5-c-menu:hover .pf-v5-c-menu__list-item.pf-m-focus:not(:hover),
.pf-v5-c-menu:hover .pf-v5-c-menu__list-item:has(> .pf-v5-c-menu__item:focus-visible):not(:hover) {
  background-color: transparent;
}

/* Content menus sit 4px from their toggle, like Radix and Geist (the masthead menus use 6px).
   An upward menu is anchored with bottom: 0, where only a bottom margin moves it. */
.pf-v5-c-menu[data-popper-placement^="bottom"]:not(.pf-v5-c-masthead .pf-v5-c-menu) {
  margin-top: 4px;
}

.pf-v5-c-menu[data-popper-placement^="top"]:not(.pf-v5-c-masthead .pf-v5-c-menu) {
  margin-top: 0;
  margin-bottom: 4px;
}

/* Menus with descriptions (adapter format, validators, provider pickers) keep a readable width;
   appended to the body they otherwise grow to the full window. */
.pf-v5-c-menu:has(.pf-v5-c-menu__item-description):not(.pf-v5-c-masthead .pf-v5-c-menu) {
  max-width: min(480px, calc(100vw - 32px));
}

/* Inline select menus in dialogs: as wide as the field (the body has 24px side padding). */
.pf-v5-c-modal-box .pf-v5-c-form__group-control > .pf-v5-c-menu {
  max-width: calc(100% - 48px);
}

/* Destructive items read as destructive: red text and a red-tinted hover.
   Covers client and group Delete (data-testid), the realm Action menu, and the client scope, role
   and group row menus, whose Delete is the last item. */
.pf-v5-c-menu__list-item[data-testid^="delete"]:not(.pf-m-disabled):not(.pf-m-aria-disabled) > .pf-v5-c-menu__item:not(:disabled),
.pf-v5-c-menu__list:has(> [data-testid="openPartialExportModal"]) > .pf-v5-c-menu__list-item:last-child > .pf-v5-c-menu__item,
:is(table[aria-label="Client scopes"], table[aria-label="Role list"], table[aria-label="Clients"], table[aria-label="Users"], table[aria-label="Select realm"], table[aria-label="Client registration"], table[aria-label="Identity providers"], table[aria-label="Sessions"], table[aria-label="Draggable table"], table[aria-label="Attributes groups"], table[aria-label="User events registered"], table.kc-draggable-table) .pf-v5-c-table__action > .pf-v5-c-menu-toggle + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child > .pf-v5-c-menu__item:not(:disabled):not([aria-disabled="true"]),
.pf-v5-c-page__main-section > .pf-v5-l-level [data-testid="action-dropdown"] + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child > .pf-v5-c-menu__item:not(:disabled),
.keycloak-admin--groups__section .pf-v5-c-menu__list > .pf-v5-c-divider + .pf-v5-c-menu__list-item:last-child > .pf-v5-c-menu__item,
.keycloak-admin--groups__section .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child > .pf-v5-c-menu__item:not(:disabled) {
  color: var(--pf-v5-global--danger-color--100);
}

.pf-v5-c-menu .pf-v5-c-menu__list-item[data-testid^="delete"]:hover:not(.pf-m-disabled):not(.pf-m-aria-disabled),
.pf-v5-c-menu__list:has(> [data-testid="openPartialExportModal"]) > .pf-v5-c-menu__list-item:last-child:hover:not(.pf-m-disabled),
:is(table[aria-label="Client scopes"], table[aria-label="Role list"], table[aria-label="Clients"], table[aria-label="Users"], table[aria-label="Select realm"], table[aria-label="Client registration"], table[aria-label="Identity providers"], table[aria-label="Sessions"], table[aria-label="Draggable table"], table[aria-label="Attributes groups"], table[aria-label="User events registered"], table.kc-draggable-table) .pf-v5-c-table__action > .pf-v5-c-menu-toggle + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child:hover:not(.pf-m-disabled):not(:has(> :disabled)),
.pf-v5-c-page__main-section > .pf-v5-l-level [data-testid="action-dropdown"] + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child:hover:not(:has(> :disabled)),
.keycloak-admin--groups__section .pf-v5-c-menu__list > .pf-v5-c-divider + .pf-v5-c-menu__list-item:last-child:hover:not(.pf-m-disabled),
.keycloak-admin--groups__section .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child:hover:not(:has(> :disabled)) {
  --pf-v5-c-menu__list-item--BackgroundColor: rgba(201, 25, 11, 0.06);
}

/* Disabled items never read as destructive. */
.pf-v5-c-menu__list-item:is(.pf-m-disabled, .pf-m-aria-disabled) > .pf-v5-c-menu__item,
.pf-v5-c-menu__list-item > .pf-v5-c-menu__item:disabled {
  color: var(--peikko-disabled-text);
}

/* Built-in authentication flows have no Delete: their Action menu holds one or two items (Bind flow,
   Duplicate). Custom flows have three or more, with Delete last. */
.pf-v5-c-page__main:has(.pf-v5-c-toggle-group__button[aria-label="Diagram view"]) .pf-v5-c-page__main-section > .pf-v5-l-level [data-testid="action-dropdown"] + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child:nth-child(-n+2) > .pf-v5-c-menu__item:not(:disabled) {
  color: var(--peikko-dark);
}

.pf-v5-c-page__main:has(.pf-v5-c-toggle-group__button[aria-label="Diagram view"]) .pf-v5-c-page__main-section > .pf-v5-l-level [data-testid="action-dropdown"] + .pf-v5-c-menu .pf-v5-c-menu__list-item:last-child:nth-child(-n+2):hover {
  --pf-v5-c-menu__list-item--BackgroundColor: var(--peikko-hover);
}

.pf-v5-c-menu__list > .pf-v5-c-divider {
  margin-block: 4px;
}

.pf-v5-c-menu__item-description {
  font-size: 13px;
  line-height: 1.4;
}

/* Long menus (Add policy, Add provider) scroll inside instead of running off the page. */
.pf-v5-c-menu:not(.pf-m-flyout):not(.pf-m-drilldown):not(.pf-m-nav) > .pf-v5-c-menu__content {
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

/* Popper sets an inline min-width of 50px on row and toolbar kebab menus (and the per-page menu).
   Only those: select menus keep Popper's min-width, which is their trigger's width. */
.pf-v5-c-table__action .pf-v5-c-menu,
:is(.pf-v5-c-page__main .pf-v5-c-toolbar__item, .pf-v5-c-pagination) > .pf-v5-c-menu-toggle.pf-m-plain + .pf-v5-c-menu {
  min-width: 160px !important;
}

/* While a dialog is open, a page menu left open behind it would show through the blur. */
body:has(.pf-v5-c-backdrop) .pf-v5-c-page .pf-v5-c-menu {
  visibility: hidden;
}

@keyframes peikko-pop-in {
  from {
    opacity: 0;
    translate: 0 -4px;
  }
}

@keyframes peikko-dialog-in {
  from {
    opacity: 0;
    translate: 0 8px;
    scale: 0.98;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-v5-c-menu,
  .pf-v5-c-modal-box {
    animation: none;
  }
}

/* ---------- Popovers and tooltips ---------- */

.pf-v5-c-popover {
  --pf-v5-c-popover--BoxShadow: var(--peikko-shadow-md);
  border-radius: var(--peikko-radius-lg);
}

.pf-v5-c-popover__content {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
}

.pf-v5-c-popover__arrow {
  display: none;
}

/* The arrow is hidden, so pull the card in by most of the arrow's 25px distance (about 9px stays).
   'translate' composes with Popper's inline transform. */
.pf-v5-c-popover[data-popper-placement^="top"] {
  translate: 0 16px;
}

.pf-v5-c-popover[data-popper-placement^="bottom"] {
  translate: 0 -16px;
}

.pf-v5-c-popover[data-popper-placement^="left"] {
  translate: 16px 0;
}

.pf-v5-c-popover[data-popper-placement^="right"] {
  translate: -16px 0;
}

/* Close: a 28px tile with a hover tint, like the dialog close. */
.pf-v5-c-popover__close {
  top: 10px;
  right: 10px;
}

.pf-v5-c-popover__close .pf-v5-c-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--peikko-icon-muted);
  border-radius: 6px;
}

.pf-v5-c-popover__close .pf-v5-c-button:hover {
  color: var(--peikko-dark);
  background: var(--peikko-hover);
}

/* The date picker's calendar fills the popover; round it, so it doesn't paint square corners over the frame.
   No overflow clip: the month menu has to reach past the popover. */
html .pf-v5-c-popover .pf-v5-c-calendar-month {
  background-color: transparent;
  border-radius: var(--peikko-radius-lg);
}

.pf-v5-c-tooltip {
  --pf-v5-c-tooltip__content--BackgroundColor: var(--peikko-dark);
  --pf-v5-c-tooltip__arrow--BackgroundColor: var(--peikko-dark);
  --pf-v5-c-tooltip__content--FontSize: 13px;
  --pf-v5-c-tooltip__content--PaddingTop: 6px;
  --pf-v5-c-tooltip__content--PaddingBottom: 6px;
  --pf-v5-c-tooltip__content--PaddingLeft: 10px;
  --pf-v5-c-tooltip__content--PaddingRight: 10px;
  --pf-v5-c-tooltip--BoxShadow: 0 4px 12px rgba(51, 58, 71, 0.16);
  --pf-v5-c-tooltip__arrow--BoxShadow: none;
  border-radius: 6px;
}

.pf-v5-c-tooltip__content {
  border-radius: 6px;
}

/* Keycloak gives the copy tooltip an inline 100px width, so "Copy to clipboard" wraps. */
.pf-v5-c-tooltip[style*="max-width: 100px"] {
  max-width: 18.75rem !important;
}

/* Date picker calendar: neutral hover and today instead of PatternFly blue tints.
   The DatePicker chunk loads after this file. */
html .pf-v5-c-calendar-month {
  --pf-v5-global--Color--100: var(--peikko-dark);
  --pf-v5-global--Color--200: var(--peikko-steel);
  --pf-v5-global--primary-color--100: var(--peikko-dark);
  --pf-v5-global--link--Color: var(--peikko-dark);
  --pf-v5-global--link--Color--hover: var(--peikko-dark);
  --pf-v5-c-calendar-month__date--hover--BackgroundColor: var(--peikko-hover);
  --pf-v5-c-calendar-month__date--focus--BackgroundColor: var(--peikko-hover);
  --pf-v5-c-calendar-month__date--focus--after--BorderColor: transparent;
  --pf-v5-c-calendar-month__dates-cell--m-current__date--BackgroundColor: transparent;
  --pf-v5-c-calendar-month__dates-cell--m-in-range--before--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-calendar-month__dates-cell--m-in-range__date--hover--BackgroundColor: var(--peikko-light);
  --pf-v5-c-calendar-month__dates-cell--m-in-range__date--focus--BackgroundColor: var(--peikko-light);
  --pf-v5-c-calendar-month__dates-cell--m-selected__date--focus--BoxShadow: var(--peikko-ring);
  --pf-v5-c-calendar-month__date--BorderRadius: var(--peikko-radius);
  --pf-v5-c-calendar-month__dates-cell--m-adjacent-month__date--Color: #9aa3ab;
}

/* Month select and year field as two matching outlined controls. The search-group rule
   that removes toggle borders also matches the calendar header's input group. */
html .pf-v5-c-calendar-month__header .pf-v5-c-input-group {
  gap: 6px;
}

html .pf-v5-c-calendar-month__header .pf-v5-c-menu-toggle {
  border-right: 0;
  border-radius: var(--peikko-radius);
}

html .pf-v5-c-calendar-month__header .pf-v5-c-menu-toggle::before {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
}

html .pf-v5-c-calendar-month__day {
  font-size: 12px;
  font-weight: 500;
  color: var(--peikko-steel);
}

/* Today: a bold number in a hairline ring, so it never looks like the hovered day. */
html .pf-v5-c-calendar-month__dates-cell.pf-m-current:not(.pf-m-selected) .pf-v5-c-calendar-month__date {
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--peikko-border-strong);
}

/* Groups tree: the tooltip only repeats the visible name and covers the row above. */
body:has(.keycloak_groups_treeview .pf-v5-c-tree-view__node:hover) > .pf-v5-c-tooltip {
  display: none;
}

/* ---------- Dialogs ---------- */

.pf-v5-c-modal-box {
  --pf-v5-c-modal-box__close--Top: 20px;
  --pf-v5-c-modal-box__close--Right: 16px;
  /* PatternFly's 8px end margin on footer buttons pushed the main action off the content edge. */
  --pf-v5-c-modal-box__footer--c-button--MarginRight: 0px;
  border-radius: var(--peikko-radius-lg);
  box-shadow: 0 16px 48px rgba(51, 58, 71, 0.18);
  overflow: hidden;
  animation: peikko-dialog-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Inline select menus (Add validator) are positioned against the box, so it must not clip them.
   The footer then rounds its own corners. */
.pf-v5-c-modal-box:has(.pf-v5-c-menu, .pf-v5-c-select__menu) {
  overflow: visible;
}

.pf-v5-c-modal-box__footer {
  border-radius: 0 0 var(--peikko-radius-lg) var(--peikko-radius-lg);
}

.pf-v5-c-backdrop {
  --pf-v5-c-backdrop--BackgroundColor: rgba(51, 58, 71, 0.35);
  backdrop-filter: blur(2px);
}

.pf-v5-c-modal-box__title {
  font-size: 18px;
  font-weight: 600;
}

/* Dialogs that put the title in a content block (Add predefined mappers) */
.pf-v5-c-modal-box__header > .pf-v5-c-content > h1 {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pf-v5-c-modal-box__header > .pf-v5-c-content > p,
.pf-v5-c-modal-box__description {
  font-size: 14px;
  color: var(--peikko-steel);
}

.pf-v5-c-modal-box__close {
  top: 20px;
  right: 16px;
}

/* PatternFly keeps the whole header 40px clear of the close button, so a description wrapped short of
   the fields below it. Only the title row needs the room. */
.pf-v5-c-modal-box__close + .pf-v5-c-modal-box__header {
  margin-right: 0;
}

.pf-v5-c-modal-box__close + .pf-v5-c-modal-box__header > :first-child {
  padding-right: 40px;
}

.pf-v5-c-modal-box__close .pf-v5-c-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--peikko-icon-muted);
}

.pf-v5-c-modal-box__close .pf-v5-c-button:hover {
  color: var(--peikko-dark);
  background: var(--peikko-hover);
}

.pf-v5-c-modal-box__body {
  color: var(--peikko-steel);
}

/* Room under the last field, so its focus ring isn't cut off by the scroll area. */
.pf-v5-c-modal-box__body:has(+ .pf-v5-c-modal-box__footer) {
  padding-bottom: 20px;
}

.pf-v5-c-modal-box__body .keycloak__form {
  padding-bottom: 8px;
}

.pf-v5-c-modal-box__body > .pf-v5-c-content + .pf-v5-c-form {
  margin-top: 16px;
}

/* Search toolbars in dialogs line up with the title and the table, with the page toolbars' 8px gaps
   (dialogs are portaled outside the page, so the page spacer doesn't reach them). */
.pf-v5-c-modal-box .pf-v5-c-toolbar {
  --pf-v5-c-toolbar--spacer--base: 8px;
}

.pf-v5-c-modal-box__body > .pf-v5-c-toolbar > .pf-v5-c-toolbar__content {
  padding-left: 0;
  padding-right: 0;
}

.pf-v5-c-modal-box__body > .pf-v5-c-toolbar > .pf-v5-c-toolbar__item.pf-m-pagination {
  margin-inline-end: 0;
}

/* Group pickers: no empty breadcrumb row and no double line above the list; the list is a card. */
.pf-v5-c-modal-box__body > .pf-v5-c-breadcrumb:has(> .pf-v5-c-breadcrumb__list:empty),
.pf-v5-c-modal-box__body > .pf-v5-c-divider:has(+ .pf-v5-c-breadcrumb) {
  display: none;
}

.pf-v5-c-modal-box__body > .pf-v5-c-breadcrumb:has(li) {
  padding: 4px 0 12px;
}

/* The level you are in reads as current, like page breadcrumbs. */
.pf-v5-c-modal-box__body > .pf-v5-c-breadcrumb .pf-v5-c-breadcrumb__item:last-child {
  color: var(--peikko-dark);
  font-weight: 500;
}

/* clip keeps the rounded corners but, unlike hidden, lets a header row stick to the dialog body. */
.pf-v5-c-modal-box__body > .pf-v5-c-data-list {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  overflow: clip;
}

/* The list's own border closes the bottom; the last row's line would double it. */
.pf-v5-c-modal-box__body > .pf-v5-c-data-list > .pf-v5-c-data-list__item:last-child {
  border-bottom-width: 0;
}

/* Option lists (Add provider): the name in medium weight, the description muted. */
.pf-v5-c-modal-box .pf-v5-c-data-list__cell[data-testid^="option-"] {
  font-weight: 500;
}

.pf-v5-c-modal-box .pf-v5-c-data-list__cell[data-testid^="option-"] + .pf-v5-c-data-list__cell {
  color: var(--peikko-steel);
}

/* Move to: the group being moved can't be picked, so it looks unavailable. */
.pf-v5-c-modal-box .join-group-dialog-row-m-disabled .keycloak-groups-group-path {
  color: var(--peikko-disabled-text);
}

.pf-v5-c-modal-box .pf-v5-c-data-list__item:has(> .join-group-dialog-row-m-disabled) {
  cursor: default;
}

/* Join groups and Move to: even 44px rows, centred names, a hover tint, a quiet navigate chevron. */
.pf-v5-c-modal-box .pf-v5-c-data-list__item-row:is(.join-group-dialog-row, .join-group-dialog-row-m-disabled) {
  min-height: 44px;
  align-items: center;
}

.pf-v5-c-modal-box .pf-v5-c-data-list__item-row:is(.join-group-dialog-row, .join-group-dialog-row-m-disabled) .pf-v5-c-data-list__item-content {
  align-items: center;
}

.pf-v5-c-modal-box .pf-v5-c-data-list__item-row:is(.join-group-dialog-row, .join-group-dialog-row-m-disabled) :is(.pf-v5-c-data-list__cell, .pf-v5-c-data-list__item-content, .pf-v5-c-data-list__item-control, .pf-v5-c-data-list__item-action) {
  align-self: center;
  padding-block: 0;
}

.pf-v5-c-modal-box .join-group-dialog-row .pf-v5-c-data-list__action {
  margin-block: 0;
}

.pf-v5-c-modal-box .pf-v5-c-data-list__item:has(> .join-group-dialog-row) {
  cursor: pointer;
}

.pf-v5-c-modal-box .pf-v5-c-data-list__item:has(> .join-group-dialog-row):hover {
  background-color: var(--peikko-mist);
}

.join-group-dialog-row .pf-v5-c-data-list__action .pf-v5-c-button {
  --pf-v5-c-button--PaddingTop: 4px;
  --pf-v5-c-button--PaddingBottom: 4px;
  --pf-v5-c-button--PaddingLeft: 8px;
  --pf-v5-c-button--PaddingRight: 8px;
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

.join-group-dialog-row .pf-v5-c-data-list__action .pf-v5-c-button:hover {
  color: var(--peikko-dark);
  background: var(--peikko-hover);
}

/* Picker dialogs: the bottom pagination sits close to the list instead of 35px above the footer. */
.pf-v5-c-modal-box__body > .pf-v5-c-toolbar:last-child:has(.pf-v5-c-pagination.pf-m-bottom) {
  padding-top: 4px;
  padding-bottom: 0;
}

/* Tables in dialogs (Assign roles, Add client scope, predefined mappers) as the same card as page lists. */
.pf-v5-c-modal-box__body > table.pf-v5-c-table {
  border: 1px solid var(--peikko-light);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--peikko-radius-lg);
  background:
    linear-gradient(var(--peikko-light), var(--peikko-light)) 0 40px / 100% 1px no-repeat,
    linear-gradient(var(--peikko-mist), var(--peikko-mist)) 0 0 / 100% 40px no-repeat,
    #ffffff;
}

.pf-v5-c-modal-box__body > table.pf-v5-c-table tr,
.pf-v5-c-modal-box__body > table.pf-v5-c-table > thead th {
  border-bottom: none;
}

.pf-v5-c-modal-box__body > table.pf-v5-c-table > tbody > tr > * {
  border-top: 1px solid var(--peikko-light);
}

/* The first row's line sits exactly on the painted header line, so it survives hover and selection. */
.pf-v5-c-modal-box__body > table.pf-v5-c-table > tbody:first-of-type > tr:first-child > * {
  border-top-color: var(--peikko-light);
}

.pf-v5-c-modal-box__body > table.pf-v5-c-table > thead > tr > :first-child {
  border-top-left-radius: 11px;
}

.pf-v5-c-modal-box__body > table.pf-v5-c-table > thead > tr > :last-child {
  border-top-right-radius: 11px;
}

.pf-v5-c-modal-box__body > table.pf-v5-c-table > tbody:last-of-type > tr:last-child > :first-child {
  border-bottom-left-radius: 11px;
}

.pf-v5-c-modal-box__body > table.pf-v5-c-table > tbody:last-of-type > tr:last-child > :last-child {
  border-bottom-right-radius: 11px;
}

/* Short text cells stay on one line (OpenID Connect, mapper names); the description still wraps. */
.pf-v5-c-modal-box .pf-v5-c-table tbody td:not(:last-child):not(:has(*)),
.pf-v5-c-modal-box table.pf-v5-c-table > tbody > tr > td.pf-v5-c-table__check + td {
  white-space: nowrap;
}

/* Admin event Auth dialog: IDs in a monospace face, no rule under the last row. */
.pf-v5-c-modal-box .pf-v5-c-table[aria-label="authData"] > tbody > tr > td:nth-child(2) {
  font-family: var(--peikko-mono);
  font-size: 13px;
}

.pf-v5-c-modal-box .pf-v5-c-table[aria-label="authData"] > tbody > tr:last-child {
  border-bottom: 0;
}

/* Credential Show data: the values are machine data (JSON, algorithm names). */
.pf-v5-c-modal-box table[aria-label="Password data"] > tbody > tr > td:nth-child(2) {
  font-family: var(--peikko-mono);
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Partial export: one 20px gap under the intro, no extra padding around the switches. */
.pf-v5-c-modal-box__body > .keycloak__realm-settings__partial-import_form {
  margin-top: 20px;
  padding-block: 0;
}

/* Add execution: aligned with the search, each option a selectable row. */
.pf-v5-c-modal-box__body > .pf-v5-c-page__main-section.pf-v5-u-py-lg {
  padding: 12px 0 !important; /* spacing utility */
}

.pf-v5-c-modal-box__body > .pf-v5-c-page__main-section > .pf-v5-c-form {
  gap: 2px;
}

.pf-v5-c-modal-box__body > .pf-v5-c-page__main-section > .pf-v5-c-form > .pf-v5-c-radio {
  padding: 10px 12px;
  border-radius: var(--peikko-radius);
  cursor: pointer;
}

.pf-v5-c-modal-box__body > .pf-v5-c-page__main-section > .pf-v5-c-form > .pf-v5-c-radio:hover {
  background: var(--peikko-mist);
}

.pf-v5-c-modal-box__body > .pf-v5-c-page__main-section > .pf-v5-c-form > .pf-v5-c-radio:has(> input:checked) {
  background: var(--peikko-mist);
  box-shadow: inset 0 0 0 1px var(--peikko-light);
}

/* Data list header row in "Configure a new mapper" is a focusable li; make it read as a header. */
.pf-v5-c-modal-box .pf-v5-c-data-list > li#header {
  background: var(--peikko-mist);
  pointer-events: none;
}

/* Configure a new mapper: the header stays at the top while the long list scrolls under it,
   40px like other table headers. */
.pf-v5-c-modal-box__body > .pf-v5-c-data-list > li#header {
  position: sticky;
  top: -16px; /* the body's top padding */
  z-index: 102; /* hovered clickable rows get 101 */
}

.pf-v5-c-modal-box__body > .pf-v5-c-data-list > li#header > .pf-v5-c-data-list__item-row {
  min-height: 40px;
  align-items: center;
}

.pf-v5-c-modal-box .pf-v5-c-data-list > li#header .pf-v5-c-data-list__cell {
  font-size: 12px;
  font-weight: 500 !important; /* inline font-weight: 700 */
  color: var(--peikko-steel);
}

/* Client policy providers: the header cells get the same 2:4 split as the row cells. */
.pf-v5-c-modal-box .pf-v5-c-data-list:has(.pf-v5-c-data-list__cell.pf-m-flex-2 + .pf-v5-c-data-list__cell.pf-m-flex-4) > li#header .pf-v5-c-data-list__cell:first-child {
  flex-grow: 2;
}

.pf-v5-c-modal-box .pf-v5-c-data-list:has(.pf-v5-c-data-list__cell.pf-m-flex-2 + .pf-v5-c-data-list__cell.pf-m-flex-4) > li#header .pf-v5-c-data-list__cell:last-child {
  flex-grow: 4;
}

/* Compact data lists in dialogs use the 14px table size, not 13px. */
html .pf-v5-c-modal-box .pf-v5-c-data-list.pf-m-compact {
  --pf-v5-c-data-list--FontSize: 14px;
  font-size: 14px;
}

/* Save and Cancel inside a dialog body (flow step settings) move into a footer band
   that reaches the dialog's bottom edge (the body has 24px of bottom padding). */
.pf-v5-c-modal-box__body > .pf-v5-c-form > .pf-v5-c-form__group.pf-m-action {
  position: static;
  margin: 8px -24px -24px;
  padding: 12px 24px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
}

.pf-v5-c-modal-box__body > .pf-v5-c-form > .pf-v5-c-form__group.pf-m-action .pf-v5-l-flex > div:first-child {
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  margin-left: auto;
}

.pf-v5-c-modal-box__body > .pf-v5-c-form > .pf-v5-c-form__group.pf-m-action .pf-v5-u-mr-md {
  margin-right: 0 !important;
}

/* Required action config: Clear resets the form, so it sits apart on the left. The footer reset
   for LDAP and Kerberos is more specific, hence !important. Its solid trash goes after the text. */
.pf-v5-c-modal-box .pf-v5-c-form__actions > [data-testid="clear"] {
  margin-left: 0 !important; /* spacing utility */
  margin-right: auto !important;
}

.pf-v5-c-button[data-testid="clear"] > svg {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  vertical-align: -2px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i-trash) center / contain no-repeat;
  mask: var(--peikko-i-trash) center / contain no-repeat;
}

.pf-v5-c-button[data-testid="clear"] > svg > * {
  display: none;
}

/* Dialog buttons on the right in a grey footer: Cancel (outlined), then the action. */
.pf-v5-c-modal-box__footer {
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 0;
  padding: 12px 24px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
}

.pf-v5-c-modal-box__footer > .pf-v5-c-button {
  margin: 0;
}

.pf-v5-c-modal-box__footer .pf-v5-c-button.pf-m-link {
  color: var(--peikko-dark);
  background: #ffffff;
  border: 0;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
  text-decoration: none;
}

.pf-v5-c-modal-box__footer .pf-v5-c-button.pf-m-link:hover {
  background: var(--peikko-mist);
}

/* Tertiary buttons (Revocation: Clear, Set to now) are white like every other footer button. */
.pf-v5-c-modal-box__footer .pf-v5-c-button.pf-m-tertiary {
  --pf-v5-c-button--m-tertiary--BackgroundColor: #ffffff;
  --pf-v5-c-button--m-tertiary--hover--BackgroundColor: var(--peikko-mist);
  background-color: #ffffff;
}

.pf-v5-c-modal-box__footer .pf-v5-c-button.pf-m-tertiary:hover {
  background-color: var(--peikko-mist);
}

/* Wizard (Create client): Cancel on the left, Back and Next on the right, in a grey footer.
   The Wizard chunk loads after this file. */
html .pf-v5-c-wizard__footer {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
}

html .pf-v5-c-wizard__footer > .pf-v5-c-button {
  margin: 0;
}

html .pf-v5-c-wizard__footer-cancel {
  order: -1;
  margin: 0 auto 0 0;
}

.pf-v5-c-wizard__footer-cancel .pf-v5-c-button.pf-m-link {
  background: #ffffff;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

/* Next stays in view while a long step scrolls. */
html .pf-v5-c-wizard__footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

/* The step card fills its column, so its edges line up with Cancel and Next. */
.pf-v5-c-wizard__main .pf-v5-c-form.pf-m-horizontal {
  max-width: none;
}

/* Visited steps keep a light circle around their number (BackgroundColor--200 is white here). */
html .pf-v5-c-wizard {
  --pf-v5-c-wizard__nav-link--before--BackgroundColor: var(--peikko-light);
  --pf-v5-c-wizard__nav-link--before--Color: var(--peikko-dark);
}

html .pf-v5-c-wizard__nav-link:not(.pf-m-current):hover {
  color: var(--peikko-dark);
}

/* Desktop: the wizard is one card. Steps rail on Blueprint Mist, the step content, and the grey footer
   all sit inside the frame. Below 992px PatternFly shows the step toggle instead. */
@media (min-width: 992px) {
  html .pf-v5-c-wizard {
    border: 1px solid var(--peikko-light);
    border-radius: var(--peikko-radius-lg);
    overflow: clip; /* clip, not hidden: no scroll container, so the sticky footer keeps working */
    background: #ffffff;
  }

  html .pf-v5-c-wizard__nav {
    background: var(--peikko-mist);
  }

  .pf-v5-c-page__main-section .pf-v5-c-wizard__main .pf-v5-c-form.pf-m-horizontal {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
}

/* Tablets and phones: the step toggle as an outlined select, and the step list as a menu. */
html .pf-v5-c-wizard__toggle {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

html .pf-v5-c-wizard__toggle[aria-expanded="true"] {
  border-color: var(--peikko-dark);
  box-shadow: var(--peikko-ring);
}

.pf-v5-c-wizard__toggle-icon > svg {
  width: 16px;
  height: 16px;
  color: var(--peikko-icon-muted);
  background-color: currentColor;
  -webkit-mask: var(--peikko-i-chevron-down) center / contain no-repeat;
  mask: var(--peikko-i-chevron-down) center / contain no-repeat;
}

.pf-v5-c-wizard__toggle-icon > svg > * {
  display: none;
}

html .pf-v5-c-wizard__nav.pf-m-expanded {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  box-shadow: var(--peikko-shadow-md);
}

/* ---------- Alerts and banners ---------- */

/* Warning banners (for example "temporary admin user"): soft orange tint instead of solid gold. */
.pf-v5-c-banner.pf-m-gold {
  --pf-v5-c-banner--BackgroundColor: #fff4e6;
  --pf-v5-c-banner--Color: #7a4300;
  background-color: #fff4e6;
  color: #7a4300;
  border-bottom: 1px solid #ffd8ad;
  font-size: 13px;
}

@media (max-width: 575.98px) {
  .pf-v5-c-banner.pf-m-gold {
    font-size: 12px;
    padding-block: 6px;
  }

  /* One line on phones; the banner repeats the full text for screen readers. */
  .pf-v5-c-banner.pf-m-gold .pf-v5-l-flex {
    flex-wrap: nowrap;
    min-width: 0;
  }

  .pf-v5-c-banner.pf-m-gold .pf-v5-l-flex > div {
    overflow: hidden;
    white-space: nowrap !important; /* overrides the inline white-space: normal */
    text-overflow: ellipsis;
  }
}

.pf-v5-c-alert {
  border-radius: var(--peikko-radius-lg);
}

/* Inline alerts: light tint and a thin border, a quiet title */
.pf-v5-c-alert.pf-m-inline {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  box-shadow: none;
}

.pf-v5-c-alert.pf-m-inline .pf-v5-c-alert__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

/* A full-width alert above a card (Client scope > Scope) gets the card's radius. */
.pf-v5-c-tab-content > .pf-v5-c-page__main-section > .pf-v5-c-alert.pf-m-inline {
  border-radius: var(--peikko-radius-lg);
}

.pf-v5-c-alert.pf-m-inline.pf-m-warning {
  --pf-v5-c-alert--m-inline--BackgroundColor: #fff4e6;
  border-color: #ffd8ad;
}

.pf-v5-c-alert.pf-m-info {
  --pf-v5-c-alert--m-info__title--Color: var(--peikko-dark);
}

.pf-v5-c-alert.pf-m-inline.pf-m-info {
  --pf-v5-c-alert--m-inline--BackgroundColor: rgba(48, 194, 221, 0.08);
  border-color: rgba(48, 194, 221, 0.3);
}

/* Info alerts often carry a whole explanation in the title; read it as body text. */
.pf-v5-c-alert.pf-m-inline.pf-m-info .pf-v5-c-alert__title {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* Toasts: compact, bottom right, clear of the masthead and page actions (like Vercel and Sonner). */
.pf-v5-c-alert-group.pf-m-toast {
  --pf-v5-c-alert-group--m-toast--Top: auto;
  --pf-v5-c-alert-group--m-toast--Right: 24px;
  --pf-v5-c-alert-group--m-toast--MaxWidth: 420px;
  top: auto;
  bottom: 24px;
}

/* Toast messages: dark title, the icon carries the status */
.pf-v5-c-alert-group .pf-v5-c-alert {
  border: 1px solid var(--peikko-light);
  box-shadow: var(--peikko-shadow-md);
}

.pf-v5-c-alert-group.pf-m-toast .pf-v5-c-alert__title {
  color: var(--peikko-dark);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Tables ---------- */

.pf-v5-c-table {
  --pf-v5-c-table--BorderColor: var(--peikko-light);
  --pf-v5-c-table--cell--Color: var(--peikko-dark);
  --pf-v5-c-table--cell--FontSize: 14px;
  --pf-v5-c-table--m-compact--FontSize: 14px;
}

/* Same header height on compact and normal tables, so the grey band below always fits it.
   The authentication flow table puts its header row straight in the table. */
.pf-v5-c-table thead th,
.pf-v5-c-table.pf-m-tree-view > tr > th {
  height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--peikko-steel);
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
}

.pf-v5-c-table tbody tr:hover > :is(td, th) {
  background-color: var(--peikko-mist);
}

.pf-v5-c-table tbody td {
  vertical-align: middle;
}

/* Buttons in a table cell sit side by side (for example Public key and Certificate). */
.pf-v5-c-table tbody td > .button-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.pf-v5-c-table tbody td > .button-wrapper > .pf-v5-c-button {
  margin: 0;
}

/* Links in tables stay on one line with their icon (for example Home URL). */
.pf-v5-c-table tbody td a {
  white-space: nowrap;
}

.pf-v5-c-table tbody td a svg {
  margin-left: 4px;
  vertical-align: -2px;
}

/* Link buttons in cells ("Show data", "Link account") read as text, not headings, and are 32px tall,
   so the row keeps its 53px. */
.pf-v5-c-table td .pf-v5-c-button.pf-m-link {
  --pf-v5-c-button--PaddingTop: 4px;
  --pf-v5-c-button--PaddingBottom: 4px;
  font-size: 14px;
}

.pf-v5-c-table td .pf-v5-c-badge {
  margin-left: 6px;
}

/* The client pill before a client role name starts the cell, on the same edge as the other names. */
.pf-v5-c-table td > .pf-v5-c-badge.keycloak-admin--role-mapping__client-name {
  margin-left: 0;
}

/* Selection checkboxes centred on the row */
.pf-v5-c-table .pf-v5-c-table__check > label {
  padding-block: 0;
  align-items: center;
  vertical-align: middle;
}

/* Lists (a table on a page, a tab or the groups drawer, not in a dialog) become a rounded card. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table {
  width: calc(100% - 2 * var(--peikko-gutter));
  margin: 0 var(--peikko-gutter);
  border: 1px solid var(--peikko-light);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--peikko-radius-lg);
  /* Grey header band and the line under it are painted on the table, so they also cover the
     action column, which has no header cell. The header is 40px tall (see thead th above). */
  background:
    linear-gradient(var(--peikko-light), var(--peikko-light)) 0 40px / 100% 1px no-repeat,
    linear-gradient(var(--peikko-mist), var(--peikko-mist)) 0 0 / 100% 40px no-repeat,
    #ffffff;
}

/* In a section that already has the page padding, the card fills it. */
.pf-v5-c-page__main-section:not(.pf-v5-u-p-0):not(.pf-m-no-padding) > table.pf-v5-c-table {
  width: 100%;
  margin: 0;
}

/* Lists inside a section wrapper (user identity provider links) fill it. */
.kc-form-panel__body > table.pf-v5-c-table {
  width: 100%;
  margin: 0;
}

/* Rounded corners come from the corner cells (not clip-path), so row menus can open past the card. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table > :is(thead > tr:first-child, tr:first-child) > :first-child {
  border-top-left-radius: 11px;
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table > :is(thead > tr:first-child, tr:first-child) > :last-child {
  border-top-right-radius: 11px;
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table > tbody:last-of-type > tr:last-child > :first-child {
  border-bottom-left-radius: 11px;
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table > tbody:last-of-type > tr:last-child > :last-child {
  border-bottom-right-radius: 11px;
}

/* With separate borders, row lines have to sit on the cells. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table tr {
  border-bottom: none;
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table thead th {
  border-bottom: none;
}

/* Roomier rows, about 53px, the same with or without a kebab. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table tbody tr > * {
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--peikko-light);
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table > tbody > tr:not(.pf-v5-c-table__expandable-row) > * {
  height: 53px;
}

/* The first row's top line sits exactly on the painted header line, so it stays when the row is hovered. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table tbody tr:first-child > * {
  border-top: 1px solid var(--peikko-light);
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table tbody + tbody tr:first-child > * {
  border-top-color: transparent;
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table tbody tr:last-child > * {
  border-bottom: none;
}

/* Tables with one tbody per row (events, flows) still need a line between rows. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table > tbody:has(~ tbody > tr:not(.pf-v5-c-table__expandable-row)) > tr:last-child > * {
  border-bottom: 1px solid var(--peikko-light);
}

/* Rows without a kebab (inherited roles) still draw their line and hover under the action column. */
@media (min-width: 769px) {
  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table:has(> tbody > tr > .pf-v5-c-table__action) > tbody > tr:not(:has(> .pf-v5-c-table__action))::after {
    content: "";
    display: table-cell;
    border-bottom: 1px solid var(--peikko-light);
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table:has(> tbody > tr > .pf-v5-c-table__action) > tbody:last-of-type > tr:not(:has(> .pf-v5-c-table__action)):last-child::after {
    border-bottom: none;
    border-bottom-right-radius: 11px;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table > tbody > tr:not(:has(> .pf-v5-c-table__action)):hover::after {
    background-color: var(--peikko-mist);
  }
}

/* Selected rows get a soft tint, so a multi-select is visible at a glance. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .pf-v5-c-modal-box__body) > table.pf-v5-c-table > tbody > tr:has(> .pf-v5-c-table__check input:checked) > *,
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table > tbody > tr:has(> .pf-v5-c-table__check input:checked)::after {
  background-color: var(--peikko-mist);
}

/* Expanded details sit on a soft surface under their row, close to it. */
.pf-v5-c-table > tbody > tr.pf-v5-c-table__expandable-row.pf-m-expanded > td {
  background-color: var(--peikko-mist);
}

table.pf-v5-c-table > tbody > tr.pf-v5-c-table__expandable-row .pf-v5-c-table__expandable-row-content {
  padding-block: 8px;
}

/* Admin events have no details, but Keycloak still draws an empty expand column. */
table.pf-v5-c-table:not(:has(> tbody > tr:not(.pf-v5-c-table__expandable-row) > td:first-child:not(:empty))) > thead > tr > th:first-child:has(> .pf-v5-screen-reader),
table.pf-v5-c-table:not(:has(> tbody > tr:not(.pf-v5-c-table__expandable-row) > td:first-child:not(:empty))) > tbody > tr:not(.pf-v5-c-table__expandable-row) > td:first-child {
  display: none;
}

table.pf-v5-c-table:not(:has(> tbody > tr:not(.pf-v5-c-table__expandable-row) > td:first-child:not(:empty))) > thead > tr > th:first-child:has(> .pf-v5-screen-reader) + th,
table.pf-v5-c-table:not(:has(> tbody > tr:not(.pf-v5-c-table__expandable-row) > td:first-child:not(:empty))) > tbody > tr:not(.pf-v5-c-table__expandable-row) > td:first-child:empty + td {
  padding-left: 24px;
}

.pf-v5-c-table[aria-label="Admin events"] > tbody > tr > td:nth-child(2) {
  white-space: nowrap;
}

/* Admin events: resource path and user id truncate inside the card instead of widening it. */
.pf-v5-c-table[aria-label="Admin events"] > tbody > tr > td:is(:nth-child(3), :nth-child(6)) {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-v5-c-table[aria-label="Admin events"] > thead > tr > th:nth-child(3) {
  width: 34%;
}

.pf-v5-c-table[aria-label="Admin events"] > thead > tr > th:nth-child(6) {
  width: 22%;
}

.pf-v5-c-table[aria-label="Admin events"] > tbody > tr > td:nth-child(6) {
  font-family: var(--peikko-mono);
  font-size: 13px;
  color: var(--peikko-steel);
}

.pf-v5-c-table[aria-label="Admin events"] > tbody > tr > td:is(:nth-child(4), :nth-child(5)) {
  white-space: nowrap;
}

/* The headers of the short enum columns never truncate. */
.pf-v5-c-table[aria-label="Admin events"] > thead > tr > th:is(:nth-child(4), :nth-child(5)) {
  min-width: 7.5rem;
}

/* Resource paths are technical values: mono like the user id next to them, linked or not. */
.pf-v5-c-table[aria-label="Admin events"] > tbody > tr > td:nth-child(3),
.pf-v5-c-table[aria-label="Admin events"] > tbody > tr > td:nth-child(3) a {
  font-family: var(--peikko-mono);
  font-size: 13px;
  font-weight: 400;
}

/* User events: time and client on one line, so rows stay 53px; the user id in mono with an ellipsis.
   The details row is left out: its second cell holds the key/value list, which must wrap. */
.pf-v5-c-table[aria-label="Events"] > tbody > tr:not(.pf-v5-c-table__expandable-row) > td:is(:nth-child(2), :nth-child(6)) {
  white-space: nowrap;
}

.pf-v5-c-table[aria-label="Events"] > thead > tr > th:nth-child(3) {
  width: 30%;
}

.pf-v5-c-table[aria-label="Events"] > tbody > tr:not(.pf-v5-c-table__expandable-row) > td:nth-child(3) {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-v5-c-table[aria-label="Events"] > tbody > tr:not(.pf-v5-c-table__expandable-row) > td:nth-child(3) a {
  font-family: var(--peikko-mono);
  font-size: 13px;
  font-weight: 400;
}

/* Master realm > Provider info: the search sits 16px under the tabs like other tabbed lists, and an
   SPI name stays next to its first provider. */
.pf-v5-c-tab-content[aria-labelledby$="providers-providers"] > .pf-v5-c-page__main-section:has(> .pf-v5-c-toolbar:first-child) {
  padding-top: 0;
}

.pf-v5-c-tab-content[aria-labelledby$="providers-providers"] table td {
  vertical-align: top;
}

/* A table directly under the tab bar (Required actions) */
.pf-v5-c-tab-content > table.pf-v5-c-table:first-child {
  margin-top: 24px;
}

/* The divider between the toolbar and the card (or the empty-state card) isn't needed. */
.pf-v5-c-divider:has(+ table.pf-v5-c-table),
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > .pf-v5-c-divider:has(+ .pf-v5-c-empty-state) {
  display: none;
}

/* Draggable tables (key providers, user profile attributes): a narrow grip column, muted grips */
.pf-v5-c-table:has(td.pf-v5-c-table__draggable) > thead > tr > th:first-child,
.pf-v5-c-table td.pf-v5-c-table__draggable {
  --pf-v5-c-table--cell--Width: 1%;
  width: 1%;
  padding-right: 0;
}

.pf-v5-c-table:has(td.pf-v5-c-table__draggable) > thead th.pf-m-fit-content {
  --pf-v5-c-table--cell--Width: auto;
  width: auto;
}

.pf-v5-c-table__draggable .pf-v5-c-button.pf-m-plain {
  color: #9aa3ab;
}

.pf-v5-c-table__draggable .pf-v5-c-button.pf-m-plain:hover {
  color: var(--peikko-dark);
}

/* The grip cell is a tab stop of its own: a soft inset ring instead of Chrome's black box. The grip is
   28px wide, so its ring fits in the cell. It keeps PatternFly's display, which keeps the row's text
   baseline where it was (these rows align on the baseline). */
.pf-v5-c-table td.pf-v5-c-table__draggable:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.5);
  border-radius: 6px;
}

.pf-v5-c-table__draggable > .pf-v5-c-button.pf-m-plain {
  --pf-v5-c-button--PaddingLeft: 6px;
  --pf-v5-c-button--PaddingRight: 6px;
  border-radius: 6px;
}

/* Status in event rows: a small tinted pill with its icon */
.pf-v5-c-table td span:has(> .pf-v5-c-icon > .pf-v5-c-icon__content:is(.pf-m-warning, .pf-m-success, .pf-m-danger)) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px 1px 8px;
  border: 1px solid var(--peikko-light);
  border-radius: 999px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}

/* Only problems are tinted; success pills stay white with their green icon (Vercel style).
   Same specificity as the base rule above, so these win by coming later. */
.pf-v5-c-table td span:has(> .pf-v5-c-icon > .pf-v5-c-icon__content.pf-m-warning) {
  background: #fff4e6;
  border-color: #ffd8ad;
  color: #7a4300;
}

.pf-v5-c-table td span:has(> .pf-v5-c-icon > .pf-v5-c-icon__content.pf-m-danger) {
  background: rgba(201, 25, 11, 0.06);
  border-color: rgba(201, 25, 11, 0.25);
  color: #a30000;
}

/* Event details: compact key/value list with muted keys.
   Extra class because the events chunk that sets the 30ch width loads after this file. */
.pf-v5-c-description-list.keycloak_eventsection_details {
  --pf-v5-c-description-list--RowGap: 6px;
  --pf-v5-c-description-list__term--FontWeight: 400;
  --pf-v5-c-description-list--m-horizontal__term--width: 24ch;
  padding: 8px 0;
}

.pf-v5-c-description-list.keycloak_eventsection_details .pf-v5-c-description-list__term {
  color: var(--peikko-steel);
}

/* ---------- Toolbars and pagination ---------- */

.pf-v5-c-toolbar {
  --pf-v5-c-toolbar--BackgroundColor: transparent;
}

/* Items centred on the 40px line (checkboxes, toggles, buttons, search). */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar {
  --pf-v5-c-toolbar--AlignItems--base: center;
}

.pf-v5-c-toolbar__item:has(> .pf-v5-c-check) {
  align-self: center;
}

/* Tighter toolbar spacing; vertical dividers are noise in a minimal toolbar. */
.pf-v5-c-page__main .pf-v5-c-toolbar {
  --pf-v5-c-toolbar--spacer--base: 8px;
}

:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-toolbar .pf-v5-c-divider.pf-m-vertical {
  display: none;
}

/* List toolbars on the page gutter */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section.pf-v5-u-p-0, .pf-v5-c-page__main-section.pf-m-no-padding, .pf-v5-c-drawer__body) > .pf-v5-c-toolbar {
  --pf-v5-c-toolbar__content--PaddingLeft: var(--peikko-gutter);
  --pf-v5-c-toolbar__content--PaddingRight: var(--peikko-gutter);
  padding-inline-end: var(--peikko-gutter);
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section.pf-v5-u-p-0, .pf-v5-c-page__main-section.pf-m-no-padding, .pf-v5-c-drawer__body) > .pf-v5-c-toolbar:has(> .pf-v5-c-toolbar__content:not(.pf-m-hidden)) {
  padding-inline-end: 0;
}

/* In a section that already has the page padding */
.pf-v5-c-page__main-section:not(.pf-v5-u-p-0):not(.pf-m-no-padding) > .pf-v5-c-toolbar {
  --pf-v5-c-toolbar__content--PaddingLeft: 0;
  --pf-v5-c-toolbar__content--PaddingRight: 0;
}

/* Inside a card body the toolbar lines up with the card text. */
.pf-v5-c-card__body > .pf-v5-c-toolbar > .pf-v5-c-toolbar__content {
  padding-left: 0;
  padding-right: 0;
}

.pf-v5-c-toolbar > .pf-v5-c-toolbar__item.pf-m-pagination {
  margin-inline-end: 0;
}

/* One pagination per list, at the bottom (shadcn data tables). Keycloak repeats it in the top toolbar,
   where it often wraps onto a row of its own. Lists without a bottom pagination keep the top one. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .pf-v5-c-modal-box__body):has(> .pf-v5-c-toolbar .pf-v5-c-pagination.pf-m-bottom) > .pf-v5-c-toolbar .pf-v5-c-toolbar__item.pf-m-pagination:has(> .pf-v5-c-pagination:not(.pf-m-bottom)) {
  display: none;
}

/* A search with no results: paging nothing ('0 - 0' and two dead arrows) is noise above the empty card. */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section):has(> .pf-v5-c-empty-state) > .pf-v5-c-toolbar .pf-v5-c-toolbar__item.pf-m-pagination {
  display: none;
}

/* Buttons and toggles placed straight in the toolbar row (Create role, Add mapper) get the same 8px gap
   as toolbar items. */
.pf-v5-c-page__main .pf-v5-c-toolbar__content-section > :is(.pf-v5-c-button, .pf-v5-c-menu-toggle):not(:last-child) {
  margin-inline-end: 8px;
}

/* Create and add actions carry a thin plus, like Resend's '+ Add domain'. Every primary button in a page
   toolbar is a create or add action. */
.pf-v5-c-page__main :is(.pf-v5-c-toolbar__item, .pf-v5-c-toolbar__content-section) > .pf-v5-c-button.pf-m-primary:not(:has(> svg, > .pf-v5-c-button__icon))::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 6px 0 -4px;
  vertical-align: -3px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i-plus) center / contain no-repeat;
  mask: var(--peikko-i-plus) center / contain no-repeat;
}

/* Destructive toolbar actions (Delete user, Unassign) read as destructive once they are enabled. */
:is([data-testid="delete-user-btn"], [data-testid="unAssignRole"]).pf-v5-c-button.pf-m-link:not(:disabled):not(.pf-m-disabled):not(.pf-m-aria-disabled) {
  color: var(--pf-v5-global--danger-color--100);
}

:is([data-testid="delete-user-btn"], [data-testid="unAssignRole"]).pf-v5-c-button.pf-m-link:not(:disabled):not(.pf-m-disabled):not(.pf-m-aria-disabled):hover {
  background: rgba(201, 25, 11, 0.06);
}

/* Identity providers below 1440px: the long checkbox moves to its own row, so the action buttons stay together. */
@media (max-width: 1439.98px) {
  .pf-v5-c-page__main .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:has(> .pf-v5-c-check > #hideOrganizationLinkedIdps) {
    order: 1;
    margin-inline-start: 0;
  }
}

/* Events: once a search has chips, Search, Refresh and the pagination stay on one line and the chips
   get a row of their own on the gutter (Keycloak stacks them in one column with the search). */
.pf-v5-c-toolbar__content-section > .pf-v5-l-flex.pf-m-column:has(.keycloak__searchChips .pf-v5-c-chip-group) {
  display: contents;
}

.pf-v5-c-toolbar__content-section > .pf-v5-l-flex.pf-m-column > div:has(> .keycloak__searchChips .pf-v5-c-chip-group) {
  order: 99;
  flex: 0 0 100%;
}

.keycloak__searchChips.pf-v5-u-ml-md {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 0 !important; /* spacing utility */
}

.keycloak__searchChips > .pf-v5-c-chip-group {
  margin: 12px 0 0 !important; /* spacing utilities */
}

/* 'Hide inherited roles' sits apart from the primary button next to it. */
.pf-v5-c-page__main .pf-v5-c-toolbar__item:has(> .pf-v5-c-check) {
  margin-inline: 8px 16px;
}

/* Phones: the search fills the first toolbar row (not the Users filter group, which has its own layout). */
@media (max-width: 575.98px) {
  .pf-v5-c-page__main .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:has(> .pf-v5-c-input-group .pf-v5-c-text-input-group):not(:has(.pf-v5-c-menu-toggle)) {
    flex: 1 1 100%;
  }

  .pf-v5-c-page__main .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:has(> .pf-v5-c-input-group .pf-v5-c-text-input-group):not(:has(.pf-v5-c-menu-toggle)) > .pf-v5-c-input-group {
    width: 100%;
  }
}

/* Page header actions (Enabled switch, Action) end on the page gutter like the content below. */
.pf-v5-c-page__main-section > .pf-v5-l-level .pf-v5-c-toolbar.pf-v5-u-p-0 > .pf-v5-c-toolbar__content {
  padding-inline: 0;
}

/* The switch's utility margin pushed its help icon away from the 'Enabled' label. */
.pf-v5-c-page__main-section > .pf-v5-l-level .pf-v5-c-toolbar .pf-v5-c-switch.pf-v5-u-mr-lg {
  margin-right: 8px !important;
}

/* Bottom pagination: right edge on the same line as the top one, less dead space. */
@media (min-width: 768px) {
  .pf-v5-c-pagination.pf-m-bottom {
    padding: 8px 0 0;
  }
}

/* Pagination as small outlined controls, like shadcn's data table: a rows control and Previous/Next tiles. */
.pf-v5-c-pagination {
  --pf-v5-c-pagination--m-compact__nav-control--nav-control--MarginLeft: 6px;
}

.pf-v5-c-pagination .pf-v5-c-pagination__nav-control .pf-v5-c-button.pf-m-plain {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--peikko-dark);
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

.pf-v5-c-pagination .pf-v5-c-pagination__nav-control .pf-v5-c-button.pf-m-plain:hover:not(:disabled) {
  background: var(--peikko-mist);
}

.pf-v5-c-pagination .pf-v5-c-pagination__nav-control .pf-v5-c-button.pf-m-plain:disabled {
  color: #b8c0c7;
  background: var(--peikko-mist);
  box-shadow: inset 0 0 0 1px var(--peikko-light);
}

.pf-v5-c-pagination > .pf-v5-c-menu-toggle.pf-m-plain.pf-m-text {
  height: 32px;
  padding: 0 8px 0 12px;
  gap: 6px;
  margin-right: 8px;
  font-size: 13px;
  color: var(--peikko-steel);
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

.pf-v5-c-pagination > .pf-v5-c-menu-toggle.pf-m-plain.pf-m-text:is(:hover, .pf-m-expanded) {
  background: var(--peikko-mist);
}

.pf-v5-c-pagination > .pf-v5-c-menu-toggle b {
  font-weight: 500;
  color: var(--peikko-dark);
}

.pf-v5-c-pagination > .pf-v5-c-menu-toggle .pf-v5-c-menu-toggle__controls {
  padding-left: 0;
  color: var(--peikko-icon-muted);
}

/* ---------- Small parts ---------- */

.pf-v5-c-switch {
  --pf-v5-c-switch__input--checked__toggle--BackgroundColor: var(--peikko-dark);
  --pf-v5-c-switch__toggle--BackgroundColor: #b8c0c7;
  --pf-v5-c-switch__toggle--before--BoxShadow: 0 1px 2px rgba(51, 58, 71, 0.3);
  --pf-v5-c-switch__input--not-checked__label--Color: var(--peikko-steel);
  --pf-v5-c-switch__input--checked__label--Color: var(--peikko-dark);
  --pf-v5-c-switch__label--Color: var(--peikko-dark);
  /* Disabled switches keep their shape, just quieter. */
  --pf-v5-c-switch__input--disabled__toggle--BackgroundColor: var(--peikko-border-strong);
  --pf-v5-c-switch__input--disabled__toggle--before--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-switch__input--disabled__label--Color: var(--peikko-disabled-text);
  --pf-v5-c-switch__input--focus__toggle--OutlineColor: rgba(51, 58, 71, 0.6);
  --pf-v5-c-switch__input--focus__toggle--OutlineOffset: 2px;
}

.pf-v5-c-switch:has(> .pf-v5-c-switch__input:disabled) {
  cursor: not-allowed;
}

/* Checkboxes: 16px, brand dark when checked (Keycloak sets 20px). */
input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader) {
  appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #b8c0c7;
  border-radius: 4px;
  background: #ffffff center / 12px 12px no-repeat;
  box-shadow: var(--peikko-shadow-sm);
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader):hover {
  border-color: var(--peikko-steel);
}

input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader):is(:checked, :indeterminate) {
  background-color: var(--peikko-dark);
  border-color: var(--peikko-dark);
  background-image: var(--peikko-i-check);
}

input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader):indeterminate {
  background-image: var(--peikko-i-minus);
}

input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader):disabled {
  background-color: var(--peikko-mist);
  border-color: var(--peikko-border-strong);
  box-shadow: none;
  cursor: not-allowed;
}

input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader):checked:disabled {
  background-color: #b8c0c7;
  border-color: #b8c0c7;
}

input[type="checkbox"]:not(.pf-v5-c-switch__input):not(.pf-v5-screen-reader):focus-visible {
  outline: none;
  box-shadow: var(--peikko-ring-strong);
}

/* Radios: drawn like the checkboxes, a dark dot when checked. */
input[type="radio"]:not(.pf-v5-screen-reader) {
  appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #b8c0c7;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: var(--peikko-shadow-sm);
  cursor: pointer;
  vertical-align: middle;
}

input[type="radio"]:not(.pf-v5-screen-reader):hover {
  border-color: var(--peikko-steel);
}

input[type="radio"]:not(.pf-v5-screen-reader):checked {
  border-color: var(--peikko-dark);
  background: radial-gradient(circle, var(--peikko-dark) 0 3.5px, #ffffff 4px);
}

input[type="radio"]:not(.pf-v5-screen-reader):disabled {
  background-color: var(--peikko-mist);
  border-color: var(--peikko-border-strong);
  box-shadow: none;
  cursor: not-allowed;
}

input[type="radio"]:not(.pf-v5-screen-reader):checked:disabled {
  background: radial-gradient(circle, #b8c0c7 0 3.5px, var(--peikko-mist) 4px);
}

input[type="radio"]:not(.pf-v5-screen-reader):focus-visible {
  outline: none;
  box-shadow: var(--peikko-ring-strong);
}

.pf-v5-c-label {
  --pf-v5-c-label--BorderRadius: 999px;
  --pf-v5-c-label--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-label__content--Color: var(--peikko-dark);
  --pf-v5-c-label__content--before--BorderColor: var(--peikko-light);
  --pf-v5-c-label__icon--Color: var(--peikko-icon-muted);
}

/* Compact 22px pills in the content (not the sidebar realm card) */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-label {
  --pf-v5-c-label--FontSize: 12px;
  --pf-v5-c-label--PaddingTop: 1px;
  --pf-v5-c-label--PaddingBottom: 1px;
  --pf-v5-c-label--PaddingLeft: 8px;
  --pf-v5-c-label--PaddingRight: 8px;
  font-weight: 500;
  line-height: 20px;
}

.pf-v5-c-label.pf-m-blue,
.pf-v5-c-label.pf-m-cyan {
  --pf-v5-c-label--BackgroundColor: rgba(48, 194, 221, 0.12);
  --pf-v5-c-label__content--Color: var(--peikko-dark);
  --pf-v5-c-label__content--before--BorderColor: rgba(48, 194, 221, 0.35);
  --pf-v5-c-label__icon--Color: var(--peikko-dark);
}

.pf-v5-c-label.pf-m-green {
  --pf-v5-c-label--BackgroundColor: rgba(162, 199, 58, 0.14);
  --pf-v5-c-label__content--Color: var(--peikko-dark);
  --pf-v5-c-label__content--before--BorderColor: rgba(162, 199, 58, 0.5);
  --pf-v5-c-label__icon--Color: var(--peikko-dark);
}

.pf-v5-c-label.pf-m-purple {
  --pf-v5-c-label--BackgroundColor: rgba(51, 58, 71, 0.06);
  --pf-v5-c-label__content--Color: var(--peikko-dark);
  --pf-v5-c-label__content--before--BorderColor: rgba(51, 58, 71, 0.2);
  --pf-v5-c-label__icon--Color: var(--peikko-dark);
}

.pf-v5-c-label:is(.pf-m-orange, .pf-m-gold) {
  --pf-v5-c-label--BackgroundColor: #fff4e6;
  --pf-v5-c-label__content--Color: #7a4300;
  --pf-v5-c-label__content--before--BorderColor: #ffd8ad;
  --pf-v5-c-label__icon--Color: #d97000;
}

/* 'Disabled' on users and clients: the same soft tint as the danger status pill. */
.pf-v5-c-label.pf-m-red {
  --pf-v5-c-label--BackgroundColor: rgba(201, 25, 11, 0.06);
  --pf-v5-c-label__content--Color: #a30000;
  --pf-v5-c-label__content--before--BorderColor: rgba(201, 25, 11, 0.25);
  --pf-v5-c-label__icon--Color: #c9190b;
}

/* Badges ("Current realm", "Disabled", tab counts): BackgroundColor--200 is white here, so they need a fill. */
.pf-v5-c-badge {
  --pf-v5-c-badge--BorderRadius: 999px;
  --pf-v5-c-badge--FontWeight: 500;
  --pf-v5-c-badge--PaddingLeft: 8px;
  --pf-v5-c-badge--PaddingRight: 8px;
  --pf-v5-c-badge--m-read--BackgroundColor: var(--peikko-light);
  --pf-v5-c-badge--m-read--Color: var(--peikko-dark);
  line-height: 20px;
}

/* The protocol badge next to a client scope title */
.pf-v5-c-page__main-section .pf-v5-l-level .pf-v5-c-badge.pf-m-unread {
  --pf-v5-c-badge--m-unread--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-badge--m-unread--Color: var(--peikko-steel);
  box-shadow: inset 0 0 0 1px var(--peikko-light);
  vertical-align: middle;
}

.pf-v5-c-chip-group {
  --pf-v5-c-chip-group--m-category--BackgroundColor: var(--peikko-mist);
}

.pf-v5-c-chip {
  --pf-v5-c-chip--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-chip--BorderRadius: 6px;
  --pf-v5-c-chip__text--MaxWidth: 28ch;
}

/* The user-section chunk loads after this file and sets the chip gap to 0. */
html .pf-v5-c-chip-group__list {
  column-gap: var(--pf-v5-c-chip-group__list--ColumnGap);
}

/* Data lists: brand lines, quiet hover instead of PatternFly's raised shadow.
   The DataList chunks load after this file and set the shadows again. */
html .pf-v5-c-data-list {
  --pf-v5-c-data-list--BorderTopColor: var(--peikko-light);
  --pf-v5-c-data-list--sm--BorderTopColor: var(--peikko-light);
  --pf-v5-c-data-list--sm--BorderTopWidth: 1px;
  --pf-v5-c-data-list__item--BorderBottomColor: var(--peikko-light);
  --pf-v5-c-data-list__item--m-clickable--hover--BoxShadow: none;
  --pf-v5-c-data-list__item--m-clickable--focus--BoxShadow: none;
  --pf-v5-c-data-list__item--m-clickable--active--BoxShadow: none;
  font-size: 14px;
}

.pf-v5-c-data-list__item.pf-m-clickable:hover {
  background-color: var(--peikko-mist);
}

html .pf-v5-c-data-list__item.pf-m-clickable:focus-visible {
  outline: none;
  background-color: var(--peikko-mist);
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.45);
}

/* Client profile executors: a bordered list with names on the card's text line. */
.pf-v5-c-form .pf-v5-c-data-list[aria-label="Executors"] {
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  overflow: hidden;
}

.pf-v5-c-data-list[aria-label="Executors"] > .pf-v5-c-data-list__item:last-child {
  border-bottom: 0;
}

.pf-v5-c-data-list[aria-label="Executors"] .pf-v5-c-data-list__item-row {
  padding-inline: 16px;
}

.pf-v5-c-data-list[aria-label="Executors"] .pf-v5-c-data-list__cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pf-v5-c-data-list[aria-label="Executors"] .pf-v5-c-data-list__cell > .pf-v5-c-button.pf-m-link {
  padding: 0;
  font-weight: 500;
}

/* Empty states: a small outline icon in a soft tile */
.pf-v5-c-empty-state__icon {
  --pf-v5-c-empty-state__icon--FontSize: 20px;
  --pf-v5-c-empty-state__icon--Color: var(--peikko-icon-muted);
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-inline: auto;
  margin-bottom: 16px;
  color: var(--peikko-icon-muted);
  background: #ffffff;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  box-shadow: var(--peikko-shadow-sm);
}

.pf-v5-c-empty-state__icon > svg {
  width: 20px;
  height: 20px;
}

.pf-v5-c-empty-state__title-text {
  font-size: 18px;
  font-weight: 600;
}

/* In-content spinners: small and muted like the splash screen, not PatternFly's 54px. */
:is(.pf-v5-c-page__main, .pf-v5-c-modal-box) .pf-v5-c-spinner:not(.pf-v5-c-button .pf-v5-c-spinner) {
  --pf-v5-c-spinner--m-xl--diameter: 28px;
  --pf-v5-c-spinner--m-lg--diameter: 28px;
  --pf-v5-c-spinner--Color: var(--peikko-icon-muted);
}

/* Empty lists and tabs: a dashed placeholder card on the page grid */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > .pf-v5-c-empty-state:not(:has(.keycloak__dashboard_icon)) {
  width: auto;
  margin: 24px 0;
  border: 1px dashed var(--peikko-border-strong);
  border-radius: var(--peikko-radius-lg);
  background: var(--peikko-mist);
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section.pf-v5-u-p-0, .pf-v5-c-page__main-section.pf-m-no-padding) > .pf-v5-c-empty-state:not(:has(.keycloak__dashboard_icon)) {
  margin: 24px var(--peikko-gutter);
}

/* Links inside an empty-state sentence ("go to Groups or Users") flow as text. */
.pf-v5-c-empty-state__body .pf-v5-c-button.pf-m-link {
  --pf-v5-c-button--PaddingTop: 0;
  --pf-v5-c-button--PaddingBottom: 0;
  --pf-v5-c-button--PaddingLeft: 0.3em;
  --pf-v5-c-button--PaddingRight: 0.3em;
  --pf-v5-c-button--LineHeight: inherit;
  font-size: inherit;
  vertical-align: baseline;
  text-decoration: underline;
  text-decoration-color: var(--peikko-border-strong);
  text-underline-offset: 3px;
}

.pf-v5-c-empty-state__body .pf-v5-c-button.pf-m-link:hover {
  text-decoration-color: var(--peikko-orange);
}

.pf-v5-c-empty-state__actions {
  gap: 8px;
}

/* 'Clear all filters', the only action of a no-results card, is an outlined button, not bare text.
   (The Attributes empty state sits inside a form and is not matched.) */
:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > .pf-v5-c-empty-state :is(.pf-v5-c-empty-state__footer, .pf-v5-c-empty-state__actions) > .pf-v5-c-button.pf-m-link {
  --pf-v5-c-button--PaddingLeft: 14px;
  --pf-v5-c-button--PaddingRight: 14px;
  background: #ffffff;
  border-radius: var(--peikko-radius);
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
  text-decoration: none;
}

:is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > .pf-v5-c-empty-state :is(.pf-v5-c-empty-state__footer, .pf-v5-c-empty-state__actions) > .pf-v5-c-button.pf-m-link:hover {
  background: var(--peikko-mist);
}

/* Empty states whose only action is Refresh (sessions, events, workflows): an outlined Refresh with its
   icon, not a heavy primary block, and a context icon instead of the 'create' plus. */
.pf-v5-c-empty-state__footer .pf-v5-c-button.pf-m-primary:is([data-testid="no-sessions-empty-action"], [data-testid$="events-empty-action"], [data-testid="no-workflows-empty-action"]) {
  --pf-v5-c-button--m-primary--BackgroundColor: #ffffff;
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--m-primary--active--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--m-primary--Color: var(--peikko-dark);
  --pf-v5-c-button--m-primary--hover--Color: var(--peikko-dark);
  --pf-v5-c-button--m-primary--focus--Color: var(--peikko-dark);
  --pf-v5-c-button--m-primary--active--Color: var(--peikko-dark);
  --pf-v5-c-button--PaddingLeft: 14px;
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

.pf-v5-c-empty-state__footer .pf-v5-c-button.pf-m-primary:is([data-testid="no-sessions-empty-action"], [data-testid$="events-empty-action"], [data-testid="no-workflows-empty-action"])::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -2px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i-refresh) center / contain no-repeat;
  mask: var(--peikko-i-refresh) center / contain no-repeat;
}

.pf-v5-c-empty-state__footer:has(> .pf-v5-c-menu-toggle),
.pf-v5-c-empty-state__footer:has(> .pf-v5-c-button + .pf-v5-c-empty-state__actions) {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pf-v5-c-empty-state__footer > :is(.pf-v5-c-menu-toggle, .pf-v5-c-button) + .pf-v5-c-empty-state__actions {
  margin: 0;
}

.pf-v5-c-empty-state__footer:empty {
  display: none;
}

/* An empty state directly under the tabs starts 24px down, like Mappers and Associated roles. */
.pf-v5-c-tab-content > .pf-v5-c-page__main-section:not(.pf-v5-u-p-0):not(.pf-m-no-padding) > .pf-v5-c-empty-state:first-child {
  margin-top: 0;
  margin-bottom: 0;
}

/* Client scope > Scope: one 24px gap between the info alert and the empty card. */
.pf-v5-c-tab-content > .pf-v5-c-page__main-section:has(> .pf-v5-c-alert:only-child) {
  padding-bottom: 0;
}

/* Empty key/value lists in a form field (ACR to LoA mapping): a dashed placeholder */
.pf-v5-c-form__group-control > .pf-v5-c-empty-state.pf-m-xs {
  padding: 20px !important; /* the pf-v5-u-p-0 utility */
  background: var(--peikko-mist);
  border: 1px dashed var(--peikko-border-strong);
  border-radius: var(--peikko-radius);
}

/* ---------- Clients ---------- */

.pf-v5-c-table[aria-label="Clients"] td:nth-child(3) {
  white-space: nowrap;
}

.pf-v5-c-table[aria-label="Clients"] thead th:nth-child(4) {
  --pf-v5-c-table--cell--Width: 14%;
  width: 14%;
}

.pf-v5-c-table[aria-label="Clients"] a[data-testid^="client-home-url"] {
  position: relative;
  display: inline-block;
  max-width: 22vw; /* a plain vw cap (no %), so the table sizes the column to it */
  padding-right: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-weight: 400;
  color: var(--peikko-steel);
}

.pf-v5-c-table[aria-label="Clients"] a[data-testid^="client-home-url"] svg {
  position: absolute;
  right: 2px;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
}

/* Below 1400px the long URLs give up width, so Client ID and Name aren't cut off. */
@media (max-width: 1399.98px) {
  .pf-v5-c-table[aria-label="Clients"] a[data-testid^="client-home-url"] {
    max-width: 16vw;
  }
}

/* Client registration: provider IDs are machine identifiers, set like the other IDs. */
table[aria-label="Client registration"] > tbody > tr > td:nth-child(2) {
  font-family: var(--peikko-mono);
  font-size: 13px;
  color: var(--peikko-steel);
}

/* Client scopes and Realm roles: descriptions are muted, so the bold names lead. */
.pf-v5-c-page__main-section > table.pf-v5-c-table:is([aria-label="Client scopes"], [aria-label="Role list"]) > tbody > tr > td:nth-last-child(2):not(.pf-v5-c-table__check) {
  color: var(--peikko-steel);
}

/* Client scopes list: Protocol and Display order only as wide as their values, so descriptions fit. */
.pf-v5-c-page__main-section > table.pf-v5-c-table[aria-label="Client scopes"]:has(> thead .pf-v5-c-table__check) > thead th:nth-child(4) {
  --pf-v5-c-table--cell--Width: 150px;
  --pf-v5-c-table--cell--MinWidth: 150px;
}

.pf-v5-c-page__main-section > table.pf-v5-c-table[aria-label="Client scopes"]:has(> thead .pf-v5-c-table__check) > thead th:nth-child(5) {
  --pf-v5-c-table--cell--Width: 128px;
  --pf-v5-c-table--cell--MinWidth: 128px;
}

.pf-v5-c-page__main-section > table.pf-v5-c-table[aria-label="Client scopes"]:has(> thead .pf-v5-c-table__check) > tbody td:nth-child(4) {
  white-space: nowrap;
}

/* Below 1400px the two short columns give width to the descriptions. */
@media (max-width: 1399.98px) {
  .pf-v5-c-page__main-section > table.pf-v5-c-table[aria-label="Client scopes"]:has(> thead .pf-v5-c-table__check) > thead th:nth-child(4) {
    --pf-v5-c-table--cell--Width: 136px;
    --pf-v5-c-table--cell--MinWidth: 136px;
  }

  .pf-v5-c-page__main-section > table.pf-v5-c-table[aria-label="Client scopes"]:has(> thead .pf-v5-c-table__check) > thead th:nth-child(5) {
    --pf-v5-c-table--cell--Width: 112px;
    --pf-v5-c-table--cell--MinWidth: 112px;
  }
}

/* Client scopes filter: the attribute selector and its value select form one control, as in Name mode. */
.pf-v5-c-toolbar__item:has(> [data-testid="clientScopeSearch"]):has(+ .pf-v5-c-toolbar__item > :is([data-testid="clientScopeSearchType"], [data-testid="clientScopeSearchProtocol"])) {
  margin-inline-end: 0;
}

.pf-v5-c-toolbar__item:has(> [data-testid="clientScopeSearch"]):has(+ .pf-v5-c-toolbar__item > :is([data-testid="clientScopeSearchType"], [data-testid="clientScopeSearchProtocol"])) > .pf-v5-c-menu-toggle,
.pf-v5-c-toolbar__item:has(> [data-testid="clientScopeSearch"]):has(+ .pf-v5-c-toolbar__item > :is([data-testid="clientScopeSearchType"], [data-testid="clientScopeSearchProtocol"])) > .pf-v5-c-menu-toggle::before {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.pf-v5-c-toolbar__item:has(> [data-testid="clientScopeSearch"]) + .pf-v5-c-toolbar__item > :is([data-testid="clientScopeSearchType"], [data-testid="clientScopeSearchProtocol"]) {
  position: relative;
  left: -1px;
}

.pf-v5-c-toolbar__item:has(> [data-testid="clientScopeSearch"]) + .pf-v5-c-toolbar__item > :is([data-testid="clientScopeSearchType"], [data-testid="clientScopeSearchProtocol"]),
.pf-v5-c-toolbar__item:has(> [data-testid="clientScopeSearch"]) + .pf-v5-c-toolbar__item > :is([data-testid="clientScopeSearchType"], [data-testid="clientScopeSearchProtocol"])::before {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

/* Manage realms: the current realm (plain text) has the same weight as the realm links. */
.pf-v5-c-table[aria-label="Select realm"] > tbody > tr > td:nth-child(2) {
  font-weight: 500;
}

/* ---------- Users ---------- */

.kc-form-group-userLabel {
  align-items: center;
  gap: 4px;
}

.kc-editUserLabel-btn {
  padding: 6px 8px;
}

/* Credentials: the label's edit, accept and cancel buttons are 32px icon tiles like other row icons;
   the label field and Reset password are compact, so the row keeps 53px. */
.pf-v5-c-table :is(.kc-editUserLabel-btn, .kc-editUserLabelAcceptBtn, .kc-editUserLabel-cancelBtn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  --pf-v5-c-button--m-link--Color: var(--peikko-icon-muted);
  --pf-v5-c-button--m-link--hover--Color: var(--peikko-dark);
  color: var(--peikko-icon-muted);
  border-radius: var(--peikko-radius);
}

/* Keycloak darkens the whole button with a brightness filter on hover. */
.pf-v5-c-table :is(.kc-editUserLabel-btn, .kc-editUserLabelAcceptBtn, .kc-editUserLabel-cancelBtn):hover {
  color: var(--peikko-dark);
  background: var(--peikko-hover);
  filter: none;
}

.pf-v5-c-table .kc-userLabel > input {
  min-height: 32px;
  font-size: 14px;
}

.pf-v5-c-table td.pf-v5-c-table__action > .pf-v5-c-button.pf-m-secondary {
  --pf-v5-c-button--PaddingTop: 4px;
  --pf-v5-c-button--PaddingBottom: 4px;
  --pf-v5-c-button--FontSize: 14px;
}

/* Identity provider links: each description sits under its heading, muted. */
html .pf-v5-c-card.pf-m-flat:is(.kc-linked-idps, .kc-available-idps) > .pf-v5-c-card__header.kc-form-panel__header {
  padding-bottom: 4px;
}

:is(.kc-linked-idps, .kc-available-idps) > .kc-form-panel__body > .pf-v5-c-content:first-child {
  color: var(--peikko-steel);
}

/* Keycloak sets this padding with !important. */
.pf-v5-c-table tbody td.kc-notExpandableRow-credentialType {
  padding-block: 8px !important;
  padding-inline-start: 8px !important;
}

.pf-v5-c-tab-content > .pf-v5-c-button.kc-resetCredentialBtn-header {
  margin: 24px var(--peikko-gutter) 16px 0;
}

.kc-linked-idps,
.kc-available-idps {
  margin: 24px var(--peikko-gutter) 0;
}

.kc-available-idps {
  margin-bottom: 24px;
}

/* .pf-v5-c-content beats Keycloak's later rule, which adds 40px, 16px and 48px margins. */
.kc-form-panel__body > .pf-v5-c-content.kc-no-providers-text {
  margin: 16px 0 0;
  padding: 24px;
  text-align: center;
  background: var(--peikko-mist);
  border: 1px dashed var(--peikko-border-strong);
  border-radius: var(--peikko-radius-lg);
}

/* ---------- Groups ---------- */

/* Tree panel 320px wide by default (dragging the splitter still sets an inline width). */
.keycloak-admin--groups__section .pf-v5-c-drawer > .pf-v5-c-drawer__main > .pf-v5-c-drawer__panel.pf-m-resizable {
  --pf-v5-c-drawer__panel--md--FlexBasis: 320px;
}

/* One quiet divider; the grip shows on hover. */
.keycloak-admin--groups__section .pf-v5-c-drawer__splitter::after {
  border-inline-start-width: 0;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__splitter:hover::after {
  border-color: var(--peikko-border-strong);
}

.keycloak-admin--groups__section .pf-v5-c-drawer__splitter-handle::after {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__splitter:is(:hover, :focus-visible) .pf-v5-c-drawer__splitter-handle::after {
  opacity: 1;
}

.keycloak-admin--groups__section .pf-v5-c-page__main-section:empty {
  display: none;
}

/* Tree: hover tint and the current group as a grey pill, like the sidebar.
   The GroupsSection chunk loads after this file. */
html .pf-v5-c-tree-view {
  /* Lighter than the current pill, like the sidebar, so a hovered neighbour doesn't look selected. */
  --pf-v5-c-tree-view__node--hover--BackgroundColor: #f2f4f6;
  --pf-v5-c-tree-view__node--focus--BackgroundColor: var(--peikko-hover);
  --pf-v5-c-tree-view__node--m-current--Color: var(--peikko-dark);
  --pf-v5-c-tree-view__node--m-current--FontWeight: 500;
}

/* Tree panel head: search flush with the tree, one pagination (the bottom one), no extra line. */
.keycloak-admin--groups__section .pf-v5-c-drawer__head .pf-v5-c-toolbar__content {
  padding-inline: 0;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__head .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:first-child {
  flex: 1 1 100%;
  margin-inline-end: 0;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__head .pf-v5-c-toolbar__content-section > .pf-v5-c-toolbar__item:first-child > .pf-v5-c-input-group {
  width: 100%;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__head > .pf-v5-c-toolbar:first-child .pf-v5-c-toolbar__item.pf-m-pagination,
.keycloak-admin--groups__section .pf-v5-c-drawer__head > hr.pf-v5-c-divider {
  display: none;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__head > .pf-v5-c-tree-view {
  margin-top: 4px;
}

.keycloak-admin--groups__section .pf-v5-c-drawer__head > .pf-v5-c-tree-view + .pf-v5-c-toolbar .pf-v5-c-toolbar__item.pf-m-pagination {
  margin-inline: auto 0;
}

.pf-v5-c-tree-view__content,
.pf-v5-c-tree-view__node {
  border-radius: var(--peikko-radius);
}

.pf-v5-c-tree-view__content:has(> .pf-v5-c-tree-view__node.pf-m-current) {
  background-color: var(--peikko-light);
}

.pf-v5-c-tree-view__node.pf-m-current {
  font-weight: 500;
}

/* 1px between rows, like the sidebar pills. */
.keycloak_groups_treeview .pf-v5-c-tree-view__content {
  margin-block: 1px;
}

/* Keyboard focus: one inset ring around the whole rounded row, not Chrome's box around the chevron or text. */
.pf-v5-c-tree-view :is(.pf-v5-c-tree-view__node-text, .pf-v5-c-tree-view__node-toggle):focus-visible {
  outline: none;
}

.pf-v5-c-tree-view__content:has(> .pf-v5-c-tree-view__node :is(.pf-v5-c-tree-view__node-text, .pf-v5-c-tree-view__node-toggle):focus-visible) {
  box-shadow: inset 0 0 0 2px rgba(51, 58, 71, 0.5);
}

/* The tree's pagination only shows when there is more than one page. */
.keycloak-admin--groups__section .pf-v5-c-drawer__head > .pf-v5-c-tree-view + .pf-v5-c-toolbar:has(.pf-v5-c-pagination__nav-control:first-child > .pf-v5-c-button:disabled):has(.pf-v5-c-pagination__nav-control:last-child > .pf-v5-c-button:disabled) {
  display: none;
}

/* Hide/show tree button: outline panel icon instead of the double angle and the pine tree */
/* A 32px square beside the breadcrumb, with an 8px gap; the glyph stays on the gutter. It sits on the
   breadcrumb's baseline, so a 5px nudge centres it on the breadcrumb text without moving the line. */
.keycloak-admin--groups__section .pf-v5-c-drawer__content > .pf-v5-c-drawer__body > div:first-child > .pf-v5-c-button.pf-m-plain {
  position: relative;
  top: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 12px 8px 0 calc(var(--peikko-gutter) - 7px);
  padding: 0;
  border-radius: var(--peikko-radius);
  color: var(--peikko-icon-muted);
}

.keycloak-admin--groups__section .pf-v5-c-drawer__content > .pf-v5-c-drawer__body > div:first-child > .pf-v5-c-button.pf-m-plain:hover {
  color: var(--peikko-dark);
  background-color: var(--peikko-hover);
}

.keycloak-admin--groups__section .pf-v5-c-drawer__content > .pf-v5-c-drawer__body > div:first-child > .pf-v5-c-button.pf-m-plain > svg {
  --peikko-i: var(--peikko-i-panel-left);
  width: 18px;
  height: 18px;
}

/* ---------- Realm settings ---------- */

/* Keys list: fixed columns so long IDs wrap instead of pushing the buttons off the card. */
table.kc-keys-list {
  table-layout: fixed;
}

/* PatternFly gives these cells max-width: 1px and a min-width, which collapse pixel widths. */
table.kc-keys-list > thead > tr > th { min-width: 0; max-width: none; }
table.kc-keys-list > thead > tr > th:nth-child(1) { width: 112px; }
table.kc-keys-list > thead > tr > th:nth-child(2) { width: 64px; }
table.kc-keys-list > thead > tr > th:nth-child(3) { width: auto; } /* Kid takes the rest */
table.kc-keys-list > thead > tr > th:nth-child(4) { width: 64px; }
table.kc-keys-list > thead > tr > th:nth-child(5) { width: 188px; }
table.kc-keys-list > thead > tr > th:nth-child(6) { width: 188px; }
table.kc-keys-list > thead > tr > th:nth-child(7) { width: 204px; }

table.kc-keys-list td:is(:nth-child(1), :nth-child(2), :nth-child(4)) {
  white-space: nowrap;
}

/* One line per key, like a Vercel list: the Kid truncates, and one click selects the whole id to copy. */
table.kc-keys-list td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--peikko-mono);
  font-size: 12px;
  color: var(--peikko-steel);
  user-select: all;
}

table.kc-keys-list td:is(:nth-child(5), :nth-child(6)) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.kc-keys-list tbody td > .button-wrapper {
  flex-wrap: nowrap;
}

table.kc-keys-list .button-wrapper .pf-v5-c-button {
  --pf-v5-c-button--PaddingTop: 4px;
  --pf-v5-c-button--PaddingBottom: 4px;
  --pf-v5-c-button--PaddingLeft: 8px;
  --pf-v5-c-button--PaddingRight: 8px;
  --pf-v5-c-button--FontSize: 13px;
  --pf-v5-c-button--LineHeight: 20px;
}

/* Key providers: provider names on one line */
table.kc-draggable-table > tbody > tr > td:is(:nth-child(2), :nth-child(3)) {
  white-space: nowrap;
  padding-inline-end: 24px;
}

/* Localization descriptions: a readable measure and a right gutter */
.pf-v5-c-tab-content > .pf-v5-c-content {
  padding-inline-end: var(--peikko-gutter);
}

.pf-v5-c-tab-content > .pf-v5-c-content > p {
  max-width: 760px;
}

/* Realm overrides: the description used pf-v5-u-ml-md (16px) instead of the gutter. */
.pf-v5-c-tab-content > .pf-v5-c-content > p.pf-v5-u-ml-md {
  margin-left: var(--peikko-gutter) !important;
}

/* Effective message bundles: the description and panel toggle sit in a pf-v5-u-pl-md wrapper. */
.pf-v5-c-tab-content > .pf-v5-u-pl-md:has(.kc-dropdown-panel) {
  padding-inline: var(--peikko-gutter) !important;
}

.pf-v5-c-tab-content > .pf-v5-u-pl-md:has(.kc-dropdown-panel) .pf-v5-c-content > p {
  max-width: 760px;
  margin-right: 0 !important;
}

/* The empty card sits 24px under the search toggle, like on Realm overrides. */
.pf-v5-c-tab-content > .pf-v5-u-pl-md:has(.kc-dropdown-panel) + hr.pf-v5-c-divider + .pf-v5-c-empty-state {
  margin-top: 0;
}

/* Key providers search: a leading magnifier and a trailing arrow, like every other list search. */
.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-form-control > input[type="search"]) > .pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-control[aria-label="Search"] > svg {
  --peikko-i: var(--peikko-i-arrow-right);
  width: 16px;
  height: 16px;
}

.pf-v5-c-input-group:has(> .pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-control[aria-label="Search"]) > .pf-v5-c-input-group__item > .pf-v5-c-form-control > input[type="search"] {
  padding-left: 36px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7a83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") 12px center / 16px 16px no-repeat;
}

/* Client policies "Configure via": a segmented control instead of two scaled-up radios */
:is(.kc-profiles-config-section, .kc-policies-config-section) {
  --pf-v5-l-flex--spacer--column--base: 0;
  align-items: center;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) > :first-child {
  margin-right: 12px;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--peikko-steel);
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio {
  position: relative;
  display: block;
  margin: 0 !important; /* spacing utilities */
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio__input {
  position: absolute;
  opacity: 0;
  transform: none;
}

/* The same track and raised white pill as the sub-tabs above it. Each radio sits in its own flex item,
   so the two items together draw the track. */
:is(.kc-profiles-config-section, .kc-policies-config-section) > div:has(> .pf-v5-c-radio) {
  padding: 3px;
  background: var(--peikko-mist);
  border: 1px solid var(--peikko-light);
}

:is(.kc-profiles-config-section, .kc-policies-config-section) > div:has(> .kc-form-radio-btn) {
  padding-right: 1px;
  border-right: 0;
  border-radius: 10px 0 0 10px;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) > div:has(> .kc-editor-radio-btn) {
  padding-left: 1px;
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio__label {
  display: inline-flex;
  align-items: center;
  height: 31px;
  margin: 0;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--peikko-steel);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio__label:hover {
  color: var(--peikko-dark);
  background: var(--peikko-hover);
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio__input:checked + .pf-v5-c-radio__label {
  color: var(--peikko-dark);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(51, 58, 71, 0.1), 0 0 0 1px var(--peikko-light);
}

/* The section holding the switch sits close to the content, and the full-bleed line under it goes. */
.pf-v5-c-tab-content > .pf-v5-c-page__main-section:has(> :is(.kc-profiles-config-section, .kc-policies-config-section)) {
  padding-bottom: 8px;
}

.pf-v5-c-tab-content > .pf-v5-c-page__main-section:has(> :is(.kc-profiles-config-section, .kc-policies-config-section)) + hr.pf-v5-c-divider {
  display: none;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio__input:focus-visible + .pf-v5-c-radio__label {
  box-shadow: var(--peikko-ring-strong);
}

/* A compact 30px view switch, so it doesn't read as a second row of tabs under the sub-tabs. */
:is(.kc-profiles-config-section, .kc-policies-config-section) > div:has(> .pf-v5-c-radio) {
  padding: 2px;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) > div:has(> .kc-form-radio-btn) {
  padding-right: 1px;
  border-radius: 8px 0 0 8px;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) > div:has(> .kc-editor-radio-btn) {
  padding-left: 1px;
  border-radius: 0 8px 8px 0;
}

:is(.kc-profiles-config-section, .kc-policies-config-section) .pf-v5-c-radio__label {
  height: 26px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
}

/* Read-only client profile: Back goes into a grey footer on the right, outlined like Cancel. */
.pf-v5-c-page__main-section .pf-v5-c-form.pf-m-horizontal:has(> a.kc-backToPolicies) {
  position: relative;
  padding-bottom: 89px;
}

.pf-v5-c-page__main-section .pf-v5-c-form.pf-m-horizontal:has(> a.kc-backToPolicies)::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 64px;
  background: var(--peikko-mist);
  border-top: 1px solid var(--peikko-light);
}

.pf-v5-c-form.pf-m-horizontal > a.pf-v5-c-button.kc-backToPolicies {
  --pf-v5-c-button--m-primary--BackgroundColor: #ffffff;
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-button--m-primary--Color: var(--peikko-dark);
  --pf-v5-c-button--m-primary--hover--Color: var(--peikko-dark);
  --pf-v5-c-button--m-primary--focus--Color: var(--peikko-dark);
  position: absolute;
  right: 24px;
  bottom: 12px;
  z-index: 1;
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-shadow-sm);
}

/* Create attribute > Validations: an empty-state card like the other sections */
.kc-attributes-validations > .pf-v5-c-divider {
  display: none;
}

/* 24px to the next section like the others (Keycloak's later chunk adds 52px), and Add validator ends on the card edge. */
html .kc-attributes-validations {
  margin-bottom: 0;
}

#addValidator.pf-v5-c-button.pf-m-link {
  padding-right: 0;
}

/* Validators list: a card like the other lists, config JSON in mono, Delete in danger red. */
.kc-attributes-validations > table.pf-v5-c-table {
  width: 100%;
  margin: 16px 0 0;
}

.kc-attributes-validations > table.pf-v5-c-table td:nth-child(2) {
  font-family: var(--peikko-mono);
  font-size: 13px;
  color: var(--peikko-steel);
}

.kc-attributes-validations .kc--attributes-validations--action-cell {
  text-align: right;
}

.kc-attributes-validations [data-testid="deleteValidator"] {
  font-weight: 500;
  color: var(--pf-v5-global--danger-color--100);
}

.kc-attributes-validations > .kc-emptyValidators {
  margin: 16px 0 0;
  padding: 24px;
  text-align: center;
  color: var(--peikko-steel);
  background: var(--peikko-mist);
  border: 1px dashed var(--peikko-border-strong);
  border-radius: var(--peikko-radius-lg);
}

/* ---------- Authentication ---------- */

/* Flow steps: name, label and requirement on one centre line */
.pf-v5-c-table.pf-m-tree-view > tbody > tr > :is(td, th) {
  vertical-align: middle;
}

.pf-v5-c-table.pf-m-tree-view .pf-v5-c-table__tree-view-main {
  align-items: center;
}

/* Flow header cells: the disabled drag handle adds nothing. */
.keycloak__authentication__header-drag-button {
  visibility: hidden;
}

.pf-v5-c-table tbody td:has(> a + .pf-v5-c-label) {
  white-space: nowrap;
}

.pf-v5-c-table[aria-label="Authentication"] tbody td:nth-child(2) {
  white-space: nowrap;
}

/* Requirement selects share one width, so the chevrons line up; plain 'Required' text starts on their text line. */
.pf-v5-c-table.pf-m-tree-view .keycloak__authentication__requirement-dropdown {
  width: 140px;
}

table.pf-v5-c-table.pf-m-tree-view > tbody > tr > td:nth-child(3):not(:has(.pf-v5-c-menu-toggle)) {
  padding-left: 26px;
  font-size: 14px;
}

/* Step type pills in one case, and the expand chevron's hover tile clear of the pill. */
.pf-v5-c-table.pf-m-tree-view .pf-v5-c-label__text {
  text-transform: capitalize;
}

.pf-v5-c-table.pf-m-tree-view .pf-v5-c-table__toggle {
  margin-inline-end: 4px;
}

/* Flow details: the toolbar starts 16px under the header line like other lists. */
.pf-v5-c-page__main > .pf-v5-c-page__main-section.pf-m-light:has(> .pf-v5-c-toolbar .pf-v5-c-toggle-group [aria-label="Table view"]) {
  padding-top: 0;
}

/* Required actions: the gear sits on the 'Configure' header's text line; its hover tile still fits the cell. */
.pf-v5-c-tab-content > table.pf-v5-c-table[aria-label="Draggable table"] > tbody > tr > td:last-child > .pf-v5-c-button.pf-m-plain[aria-label="Settings"] {
  margin-inline-start: -8px;
}

/* Required actions: On/Off labels at the table's 14px, quieter than the action names. */
.pf-v5-c-table td .pf-v5-c-switch__label {
  font-size: 14px;
}

/* Table / Diagram view switch: grey pill for the selected view, no PatternFly blue.
   The ToggleGroup chunk loads after this file. */
html .pf-v5-c-toggle-group {
  --pf-v5-c-toggle-group__button--m-selected--BackgroundColor: var(--peikko-light);
  --pf-v5-c-toggle-group__button--m-selected--before--BorderColor: var(--peikko-light);
  --pf-v5-c-toggle-group__button--before--BorderColor: var(--peikko-light);
  --pf-v5-c-toggle-group__button--hover--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-toggle-group__button--hover--before--BorderColor: var(--peikko-light);
  --pf-v5-c-toggle-group__button--focus--BackgroundColor: var(--peikko-mist);
  --pf-v5-c-toggle-group__button--focus--before--BorderColor: var(--peikko-light);
}

.pf-v5-c-toggle-group__button {
  min-height: 40px;
}

html .pf-v5-c-toggle-group__button:focus-visible {
  position: relative;
  z-index: 1;
  outline: none;
  box-shadow: var(--peikko-ring-strong);
}

.pf-v5-c-toggle-group__button:is([aria-label="Table view"], [aria-label="Diagram view"]) .pf-v5-c-toggle-group__icon > svg {
  width: 16px;
  height: 16px;
}

.pf-v5-c-toggle-group__button[aria-label="Table view"] .pf-v5-c-toggle-group__icon > svg {
  --peikko-i: var(--peikko-i-table);
}

.pf-v5-c-toggle-group__button[aria-label="Diagram view"] .pf-v5-c-toggle-group__icon > svg {
  --peikko-i: var(--peikko-i-diagram);
}

/* Flow diagram: framed canvas that fits the window, light nodes, quiet controls */
.react-flow {
  height: max(420px, calc(100vh - 340px)) !important; /* inline height: 100% */
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  background: var(--peikko-mist);
}

/* React Flow's stylesheet loads after this file with the same single classes, so these carry .react-flow. */
.react-flow .react-flow__node:is(.react-flow__node-default, .react-flow__node-input, .react-flow__node-output) {
  color: var(--peikko-dark);
  font-weight: 500;
  background: #ffffff;
  border: 1px solid var(--peikko-border-strong);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

.react-flow .react-flow__node-default.selectable:is(:hover, :focus, .selected) {
  border-color: var(--peikko-dark);
  box-shadow: var(--peikko-ring);
}

.keycloak__authentication__conditional_node {
  border-color: var(--peikko-border-strong);
  border-radius: 6px;
}

.react-flow .react-flow__edge-path {
  stroke: #b8c0c7;
}

.react-flow .react-flow__edge text {
  fill: var(--peikko-steel);
}

.react-flow .react-flow__handle {
  background: var(--peikko-icon-muted);
  border-color: #ffffff;
}

.react-flow__controls {
  overflow: hidden;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius);
  box-shadow: var(--peikko-shadow-sm);
}

.react-flow .react-flow__controls-button {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  padding: 7px;
  color: var(--peikko-dark);
  background: #ffffff;
  border-bottom: 1px solid var(--peikko-light);
}

.react-flow .react-flow__controls-button:last-child {
  border-bottom: 0;
}

.react-flow .react-flow__controls-button:hover {
  background: var(--peikko-mist);
}

.react-flow .react-flow__controls-button svg {
  fill: currentColor;
}

.react-flow__minimap {
  overflow: hidden;
  border: 1px solid var(--peikko-light);
  border-radius: var(--peikko-radius-lg);
  box-shadow: var(--peikko-shadow-sm);
}

.react-flow__minimap-mask {
  fill: rgba(247, 249, 250, 0.75);
}

.react-flow__minimap-node {
  fill: var(--peikko-light);
  stroke: none;
}

.react-flow__attribution {
  background: transparent;
  color: var(--peikko-steel);
  font-size: 10px;
}

/* ---------- Identity providers and user federation ---------- */

.pf-v5-c-form .keycloak__discovery-settings__metadata .pf-v5-c-expandable-section__toggle {
  margin-left: 0;
}

.pf-v5-c-page__main-section > .pf-v5-c-content > h2.pf-v5-u-mt-lg {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Phones and tablets ---------- */

/* PatternFly's stacked table mode: one tidy card row per item instead of cut-off grid columns. */
@media screen and (max-width: 768px) {
  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] {
    background: #ffffff;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody {
    border-top-width: 0;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 2px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--peikko-light);
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr:has(> .pf-v5-c-table__check) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody:last-child tr:last-child {
    border-bottom: none;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr > * {
    grid-column: 1;
    min-width: 0;
    height: auto;
    padding: 0;
    border: none;
    color: var(--peikko-steel);
    font-size: 13px;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr:has(> .pf-v5-c-table__check) > * {
    grid-column: 2;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr > :first-child:not(.pf-v5-c-table__check),
  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr > .pf-v5-c-table__check + * {
    color: var(--peikko-dark);
    font-size: 15px;
  }

  /* PatternFly's responsive margins put the checkbox below the name and reserve a wide kebab column. */
  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr > .pf-v5-c-table__check {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin: 2px 0 0;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr > .pf-v5-c-table__action {
    grid-column: -2;
    grid-row: 1;
    align-self: start;
    margin: -8px 0 0;
  }

  /* Rows are grids here, so the hover tints the row, not each cell box. */
  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr:hover {
    background-color: var(--peikko-mist);
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table[class*="pf-m-grid"] tbody tr:hover > * {
    background-color: transparent;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section, .pf-v5-c-drawer__body, .kc-form-panel__body, .kc-attributes-validations) > table.pf-v5-c-table[class*="pf-m-grid"] tbody td a {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  :is(.pf-v5-c-tab-content, .pf-v5-c-page__main-section) > table.pf-v5-c-table[aria-label="Clients"] tbody td a[data-testid^="client-home-url"] {
    max-width: 100%;
    white-space: nowrap;
  }

  .pf-v5-c-pagination.pf-m-bottom {
    box-shadow: none;
  }

  .pf-v5-c-pagination.pf-m-bottom .pf-v5-c-menu-toggle {
    position: static;
  }
}

/* ---------- Outline icons in place of FontAwesome's solid glyphs ---------- */

/* The svg keeps its size, color (currentColor) and aria attributes; only its shape is masked. */
:is(
  .pf-v5-c-menu-toggle__toggle-icon,
  .pf-v5-c-text-input-group__icon,
  .pf-v5-c-pagination__nav-control .pf-v5-c-button:is([aria-label*="previous" i], [aria-label*="next" i]),
  .pf-v5-c-input-group button[aria-label="Search"] .pf-v5-c-icon__content,
  .pf-v5-c-table__action .pf-v5-c-menu-toggle.pf-m-plain,
  .pf-v5-c-tree-view__action .pf-v5-c-menu-toggle.pf-m-plain,
  .pf-v5-c-clipboard-copy__group .pf-v5-c-button.pf-m-control,
  .pf-v5-c-button.pf-m-control[aria-label="Copy to clipboard"],
  .pf-v5-c-modal-box__close .pf-v5-c-button,
  .pf-v5-c-popover__close .pf-v5-c-button,
  .kc-dropdown-panel-icon .pf-v5-c-icon__content,
  .pf-v5-c-toggle-group__button:is([aria-label="Table view"], [aria-label="Diagram view"]) .pf-v5-c-toggle-group__icon,
  .keycloak-admin--groups__section .pf-v5-c-drawer__body > div:first-child > .pf-v5-c-button.pf-m-plain,
  [data-testid="kerberos-card"] .pf-v5-c-icon__content,
  [data-testid="ldap-card"] .pf-v5-c-icon__content,
  .pf-v5-c-toolbar .pf-v5-c-menu-toggle > .pf-v5-c-menu-toggle__icon,
  #help,
  #nav-toggle
) > svg,
.pf-v5-c-button.pf-m-link[data-testid="refresh"] > svg,
a[target="_blank"]:not(.pf-v5-c-button) > svg:last-child {
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

:is(
  .pf-v5-c-menu-toggle__toggle-icon,
  .pf-v5-c-text-input-group__icon,
  .pf-v5-c-pagination__nav-control .pf-v5-c-button:is([aria-label*="previous" i], [aria-label*="next" i]),
  .pf-v5-c-input-group button[aria-label="Search"] .pf-v5-c-icon__content,
  .pf-v5-c-table__action .pf-v5-c-menu-toggle.pf-m-plain,
  .pf-v5-c-tree-view__action .pf-v5-c-menu-toggle.pf-m-plain,
  .pf-v5-c-clipboard-copy__group .pf-v5-c-button.pf-m-control,
  .pf-v5-c-button.pf-m-control[aria-label="Copy to clipboard"],
  .pf-v5-c-modal-box__close .pf-v5-c-button,
  .pf-v5-c-popover__close .pf-v5-c-button,
  .kc-dropdown-panel-icon .pf-v5-c-icon__content,
  .pf-v5-c-toggle-group__button:is([aria-label="Table view"], [aria-label="Diagram view"]) .pf-v5-c-toggle-group__icon,
  .keycloak-admin--groups__section .pf-v5-c-drawer__body > div:first-child > .pf-v5-c-button.pf-m-plain,
  [data-testid="kerberos-card"] .pf-v5-c-icon__content,
  [data-testid="ldap-card"] .pf-v5-c-icon__content,
  .pf-v5-c-toolbar .pf-v5-c-menu-toggle > .pf-v5-c-menu-toggle__icon,
  #help,
  #nav-toggle
) > svg > *,
.pf-v5-c-button.pf-m-link[data-testid="refresh"] > svg > *,
a[target="_blank"]:not(.pf-v5-c-button) > svg:last-child > * {
  display: none;
}

.pf-v5-c-menu-toggle__toggle-icon > svg { --peikko-i: var(--peikko-i-chevron-down); width: 16px; height: 16px; }
.pf-v5-c-text-input-group__icon > svg { --peikko-i: var(--peikko-i-search); width: 16px; height: 16px; color: var(--peikko-icon-muted); }
.pf-v5-c-input-group button[aria-label="Search"] .pf-v5-c-icon__content > svg { --peikko-i: var(--peikko-i-arrow-right); width: 16px; height: 16px; }
.pf-v5-c-pagination__nav-control .pf-v5-c-button[aria-label*="previous" i] > svg { --peikko-i: var(--peikko-i-chevron-left); width: 16px; height: 16px; }
.pf-v5-c-pagination__nav-control .pf-v5-c-button[aria-label*="next" i] > svg { --peikko-i: var(--peikko-i-chevron-right); width: 16px; height: 16px; }
:is(.pf-v5-c-table__action, .pf-v5-c-tree-view__action) .pf-v5-c-menu-toggle.pf-m-plain > svg { --peikko-i: var(--peikko-i-ellipsis-v); width: 18px; height: 18px; }
.pf-v5-c-button.pf-m-link[data-testid="refresh"] > svg { --peikko-i: var(--peikko-i-refresh); width: 15px; height: 15px; margin-right: 6px; }
:is(.pf-v5-c-clipboard-copy__group .pf-v5-c-button.pf-m-control, .pf-v5-c-button.pf-m-control[aria-label="Copy to clipboard"]) > svg { --peikko-i: var(--peikko-i-copy); width: 16px; height: 16px; }
:is(.pf-v5-c-modal-box__close, .pf-v5-c-popover__close) .pf-v5-c-button > svg { --peikko-i: var(--peikko-i-x); width: 18px; height: 18px; }
.pf-v5-c-popover__close .pf-v5-c-button > svg { width: 16px; height: 16px; }
.kc-dropdown-panel-icon .pf-v5-c-icon__content > svg { --peikko-i: var(--peikko-i-chevron-down); width: 16px; height: 16px; }
.pf-v5-c-toolbar .pf-v5-c-menu-toggle > .pf-v5-c-menu-toggle__icon > svg { --peikko-i: var(--peikko-i-filter); width: 16px; height: 16px; color: var(--peikko-icon-muted); }
a[target="_blank"]:not(.pf-v5-c-button) > svg:last-child { --peikko-i: var(--peikko-i-external); width: 0.85em; height: 0.85em; margin-left: 2px; vertical-align: -0.1em; }
#help > svg { --peikko-i: var(--peikko-i-help); width: 18px; height: 18px; }
#nav-toggle > svg { --peikko-i: var(--peikko-i-panel-left); width: 18px; height: 18px; }

/* The remaining FontAwesome and PatternFly glyphs, matched by their path data wherever they appear.
   :where() keeps this at zero specificity, so the class-based rules (above and below) still pick the icon
   and size in context. Status icons (check, warning, error) stay solid on purpose. The help question-circle
   shares its first segment with the error exclamation-circle, so its match also checks a later part. */
:where(svg:has(> path:is(
  [d^="M242.72 256l100.07"],
  [d^="M224.3 273l-136 136"],
  [d^="M31.7 239l136-136"],
  [d^="M143 352.3L7 216.3"],
  [d^="M96 184c39.8 0 72 32.2"],
  [d^="M487.976 0H24.028"],
  [d^="M505 442.7L405.3 343"],
  [d^="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276"],
  [d^="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296"],
  [d^="M572.52 241.4C518.29 135"],
  [d^="M634 471L36 3.51"],
  [d^="M148 288h-40c-6.6"],
  [d^="M96 32H32C14.33 32"],
  [d^="M488.6 250.2L392 214"],
  [d^="M487.4 315.7l-42.6-24.6"],
  [d^="M521.3,576 C627.5,576"],
  [d^="M504 256c0 136.997"][d*="zM262.655"],
  [d^="M497.9 142.1l-46.1 46.1"],
  [d^="M173.898 439.404l-166.4"]
))) {
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

:where(svg:has(> path:is(
  [d^="M242.72 256l100.07"],
  [d^="M224.3 273l-136 136"],
  [d^="M31.7 239l136-136"],
  [d^="M143 352.3L7 216.3"],
  [d^="M96 184c39.8 0 72 32.2"],
  [d^="M487.976 0H24.028"],
  [d^="M505 442.7L405.3 343"],
  [d^="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276"],
  [d^="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296"],
  [d^="M572.52 241.4C518.29 135"],
  [d^="M634 471L36 3.51"],
  [d^="M148 288h-40c-6.6"],
  [d^="M96 32H32C14.33 32"],
  [d^="M488.6 250.2L392 214"],
  [d^="M487.4 315.7l-42.6-24.6"],
  [d^="M521.3,576 C627.5,576"],
  [d^="M504 256c0 136.997"][d*="zM262.655"],
  [d^="M497.9 142.1l-46.1 46.1"],
  [d^="M173.898 439.404l-166.4"]
))) > * {
  display: none;
}

:where(svg:has(> path[d^="M242.72 256l100.07"])) { --peikko-i: var(--peikko-i-x); }
:where(svg:has(> path[d^="M224.3 273l-136 136"])) { --peikko-i: var(--peikko-i-chevron-right); }
:where(svg:has(> path[d^="M31.7 239l136-136"])) { --peikko-i: var(--peikko-i-chevron-left); }
:where(svg:has(> path[d^="M143 352.3L7 216.3"])) { --peikko-i: var(--peikko-i-chevron-down); }
:where(svg:has(> path[d^="M96 184c39.8 0 72 32.2"])) { --peikko-i: var(--peikko-i-ellipsis-v); }
:where(svg:has(> path[d^="M487.976 0H24.028"])) { --peikko-i: var(--peikko-i-filter); }
:where(svg:has(> path[d^="M505 442.7L405.3 343"])) { --peikko-i: var(--peikko-i-search); }
:where(svg:has(> path[d^="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276"])) { --peikko-i: var(--peikko-i-circle-plus); }
:where(svg:has(> path[d^="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296"])) { --peikko-i: var(--peikko-i-trash); }
:where(svg:has(> path[d^="M572.52 241.4C518.29 135"])) { --peikko-i: var(--peikko-i-eye); }
:where(svg:has(> path[d^="M634 471L36 3.51"])) { --peikko-i: var(--peikko-i-eye-off); }
:where(svg:has(> path[d^="M148 288h-40c-6.6"])) { --peikko-i: var(--peikko-i-calendar); }
:where(svg:has(> path[d^="M96 32H32C14.33 32"])) { --peikko-i: var(--peikko-i-grip); }
:where(svg:has(> path[d^="M488.6 250.2L392 214"])) { --peikko-i: var(--peikko-i-inbox); }
:where(svg:has(> path[d^="M487.4 315.7l-42.6-24.6"])) { --peikko-i: var(--peikko-i-settings); }
:where(svg:has(> path:is([d^="M521.3,576 C627.5,576"], [d^="M504 256c0 136.997"][d*="zM262.655"]))) { --peikko-i: var(--peikko-i-help); }
:where(svg:has(> path[d^="M497.9 142.1l-46.1 46.1"])) { --peikko-i: var(--peikko-i-pencil); }
:where(svg:has(> path[d^="M173.898 439.404l-166.4"])) { --peikko-i: var(--peikko-i-check-line); }

/* Glyphs in context */
.pf-v5-c-button.pf-m-link[data-testid$="addValue"] > svg,
.pf-v5-c-button[data-testid="attributes-add-row"] .pf-v5-c-button__icon > svg,
.pf-v5-c-button[data-testid="annotations-add-row"] .pf-v5-c-button__icon > svg,
#addValidator .pf-v5-c-button__icon > svg {
  --peikko-i: var(--peikko-i-plus);
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.pf-v5-c-button.pf-m-link[data-testid$="addValue"] > svg {
  margin-right: 2px;
}

:is(.pf-v5-c-input-group__item > .pf-v5-c-button.pf-m-link[data-testid^="remove"], .pf-v5-c-button:is([data-testid="attributes-remove"], [data-testid="annotations-remove"])) svg {
  --peikko-i: var(--peikko-i-trash);
  width: 16px;
  height: 16px;
}

/* Empty states: inbox by default, a plus when the empty state offers a create action, search for no results. */
.pf-v5-c-empty-state__icon > svg {
  --peikko-i: var(--peikko-i-inbox);
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-empty-state__icon > svg > * {
  display: none;
}

.pf-v5-c-empty-state:has(.pf-v5-c-empty-state__footer :is(.pf-v5-c-button.pf-m-primary, .pf-v5-c-menu-toggle)) .pf-v5-c-empty-state__icon > svg {
  --peikko-i: var(--peikko-i-circle-plus);
}

.pf-v5-c-empty-state__icon > svg:has(> path[d^="M505 442.7"]) {
  --peikko-i: var(--peikko-i-search);
}

/* Empty states whose only action is Refresh: a context icon (the sidebar glyph), not the 'create' plus. */
.pf-v5-c-empty-state:has(.pf-v5-c-empty-state__footer .pf-v5-c-button.pf-m-primary[data-testid="no-sessions-empty-action"]) .pf-v5-c-empty-state__icon > svg {
  --peikko-i: var(--peikko-i-clock);
}

.pf-v5-c-empty-state:has(.pf-v5-c-empty-state__footer .pf-v5-c-button.pf-m-primary[data-testid$="events-empty-action"]) .pf-v5-c-empty-state__icon > svg {
  --peikko-i: var(--peikko-i-activity);
}

.pf-v5-c-empty-state:has(.pf-v5-c-empty-state__footer .pf-v5-c-button.pf-m-primary[data-testid="no-workflows-empty-action"]) .pf-v5-c-empty-state__icon > svg {
  --peikko-i: var(--peikko-i-workflow);
}

/* Toolbar kebabs (list toolbars and the masthead on phones) */
:is(.pf-v5-c-page__main .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain:not(.pf-m-text), [data-testid="options-kebab-toggle"]) > svg {
  --peikko-i: var(--peikko-i-ellipsis-v);
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

:is(.pf-v5-c-page__main .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain:not(.pf-m-text), [data-testid="options-kebab-toggle"]) > svg > * {
  display: none;
}

/* Masthead menu on phones: 'Help on' gets the same outline (?) as the desktop masthead. */
[data-testid="helpIcon"] .pf-v5-c-menu__item-icon > svg {
  --peikko-i: var(--peikko-i-help);
  width: 16px;
  height: 16px;
  color: var(--peikko-icon-muted);
}

/* Filter toggle whose funnel sits in the text span (Client scopes) */
.pf-v5-c-menu-toggle__text > svg:first-child:has(> path[d^="M487.976 0H24.028"]) {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -3px;
  color: var(--peikko-icon-muted);
}

/* Clear buttons: thin x */
:is(.pf-v5-c-text-input-group__utilities, .pf-v5-c-alert__action) .pf-v5-c-button.pf-m-plain svg {
  --peikko-i: var(--peikko-i-x);
  width: 14px;
  height: 14px;
}

.pf-v5-c-chip__actions .pf-v5-c-button.pf-m-plain svg {
  --peikko-i: var(--peikko-i-x);
  width: 12px;
  height: 12px;
}

/* Chip-group close (event search chips): a thin x instead of the solid times-circle. */
.pf-v5-c-chip-group__close .pf-v5-c-button > svg {
  --peikko-i: var(--peikko-i-x);
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-chip-group__close .pf-v5-c-button > svg > * {
  display: none;
}

/* Authentication flow labels: outline glyphs instead of four solid ones from two icon sets
   (execution, flow, condition, step, and the header's Built-in). Scoped to labels, so the green
   'Used by' checks and event status icons stay solid. */
.pf-v5-c-label__icon > svg:has(> path:is([d^="M1016,640.1"], [d^="M384 144c0-44.2"], [d^="M640,432 C640,440.8"], [d^="M172.268 501.67"], [d^="M504 256c0 136.967"])) {
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-label__icon > svg:has(> path:is([d^="M1016,640.1"], [d^="M384 144c0-44.2"], [d^="M640,432 C640,440.8"], [d^="M172.268 501.67"], [d^="M504 256c0 136.967"])) > * {
  display: none;
}

.pf-v5-c-label__icon > svg:has(> path[d^="M1016,640.1"]) { --peikko-i: var(--peikko-i-zap); }
.pf-v5-c-label__icon > svg:has(> path[d^="M384 144c0-44.2"]) { --peikko-i: var(--peikko-i-git-branch); }
.pf-v5-c-label__icon > svg:has(> path[d^="M640,432 C640,440.8"]) { --peikko-i: var(--peikko-i-diamond); } /* the diagram's condition shape */
.pf-v5-c-label__icon > svg:has(> path[d^="M172.268 501.67"]) { --peikko-i: var(--peikko-i-map-pin); }
.pf-v5-c-label__icon > svg:has(> path[d^="M504 256c0 136.967"]) { --peikko-i: var(--peikko-i-circle-check); }

/* Keys footer Refresh and other reload buttons */
.pf-v5-c-button[data-testid="reload"] > svg {
  --peikko-i: var(--peikko-i-refresh);
  width: 15px;
  height: 15px;
  margin-right: 6px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-button[data-testid="reload"] > svg > * {
  display: none;
}

/* Selected option check in select menus */
.pf-v5-c-menu__item-select-icon > svg {
  --peikko-i: var(--peikko-i-check-line);
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-menu__item-select-icon > svg > * {
  display: none;
}

/* Users toolbar in attribute-search mode: the thin arrow, like the plain search */
.pf-v5-c-input-group button[aria-label="Search attributes"] > .pf-v5-c-button__icon > svg {
  --peikko-i: var(--peikko-i-arrow-right);
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: var(--peikko-i) center / contain no-repeat;
  mask: var(--peikko-i) center / contain no-repeat;
}

.pf-v5-c-input-group button[aria-label="Search attributes"] > .pf-v5-c-button__icon > svg > * {
  display: none;
}

/* Attribute search value: check means 'add to filter' */
.user-attribute-search-form-right .pf-v5-c-button.pf-m-control svg {
  --peikko-i: var(--peikko-i-check-line);
  width: 16px;
  height: 16px;
}

/* Small glyphs in controls */
:is(.pf-v5-c-input-group .pf-v5-c-button.pf-m-control, .pf-v5-c-date-picker .pf-v5-c-button.pf-m-control) > svg:has(> path:is([d^="M572.52 241.4C518.29 135"], [d^="M634 471L36 3.51"], [d^="M148 288h-40c-6.6"])),
.pf-v5-c-calendar-month__header-nav-control .pf-v5-c-button > svg,
.pf-v5-c-modal-box .pf-v5-c-data-list__action .pf-v5-c-button > svg,
.pf-v5-c-tree-view__node-toggle-icon > svg,
.pf-v5-c-table td .pf-v5-c-button.pf-m-plain[aria-label="Settings"] > svg,
.pf-v5-c-table__draggable .pf-v5-c-button.pf-m-plain > svg {
  width: 16px;
  height: 16px;
}

.kc-editUserLabel-btn svg {
  width: 15px;
  height: 15px;
}

/* 'What is this form used for?' and other section intro help lines */
.keycloak__section_intro__help p > svg:first-child {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -3px;
  color: var(--peikko-icon-muted);
}

/* ---------- Keyboard focus on outlined buttons ---------- */

/* Outlined and secondary buttons (Cancel, Revert, Refresh, Back, Import client, the toolbar kebab,
   Clear all filters) draw their outline with box-shadow, which hid the shared focus ring. Keep the outline
   and add the ring. Segments inside input groups keep their inset ring. */
html body :is(.pf-v5-c-button:is(.pf-m-link, .pf-m-secondary, .pf-m-tertiary):not(.pf-m-inline), .pf-v5-c-page__main .pf-v5-c-toolbar__item > .pf-v5-c-menu-toggle.pf-m-plain, .pf-v5-c-form__actions > a.kc-attributeCancel, .pf-v5-c-empty-state__footer .pf-v5-c-button:is([data-testid="no-sessions-empty-action"], [data-testid$="events-empty-action"], [data-testid="no-workflows-empty-action"])):not(.pf-v5-c-input-group *):not(.pf-v5-c-breadcrumb *):not(.pf-v5-c-empty-state__body *):focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--peikko-light), var(--peikko-ring-strong);
}