/* Pruefster theme (docs/ui-redesign.md, WP1-WP3).
   Everything is scoped under body.pf (set by the shell partials), so pages
   outside the new shell (proctor, student pages) are unaffected even if this
   file is loaded there. Dark mode = body.pf.darkmode, which only swaps tokens.

   Class API (new markup):
   Shell   .pf-shell > aside.pf-sidebar + .pf-main + .pf-scrim
           .pf-sidebar > a.pf-sidebar__brand(.pf-sidebar__logo(img.pf-logo-light, img.pf-logo-dark), .pf-sidebar__mark)
                       + nav.pf-nav + .pf-sidebar__foot
           .pf-nav > .pf-nav__group | a.pf-nav__item[aria-current=page]
                     (svg.pf-icon|i.pf-nav__icon, span.pf-nav__label, span.pf-nav__ext)
                   | details.pf-nav__su > summary.pf-nav__item(... .pf-nav__count, .pf-nav__chev) + items
           .pf-main > header.pf-subnav(button.pf-sidebar-toggle, .pf-crumbs, .pf-actions) + .pf-brandline + main.pf-page
           <640px: add .is-open to .pf-sidebar to slide it in. 640-991px: icon rail; >=992px: rail with body.pf-nav-compact
           (button.pf-nav__toggle, public/src/shared/navRail.js; its tooltip is div.pf-navtip). Rail logo: svg.pf-mark.
   Parts   .pf-panel(__head, __body) .pf-stats > .pf-stat(--alert)(__n, __l) .pf-chip[aria-pressed]
           .pf-pill.susp--{white|green|yellow|red} .pf-dot--{red|yellow|green|live|session|check|idle|done}
           .pf-segmented > button[aria-pressed] | input+label  input.pf-switch  .pf-selbar(__count)
           .pf-iconbtn .pf-search  tbody > tr[data-susp=red|yellow]  tr.selected
           dialog.pf-modal(--lg) > .modal-header/.modal-body/.modal-footer   .pf-withdrawer > .pf-drawer
           dialog.pf-drawer  .pf-toast-region > .pf-toast(--success|--error|--warning|--info)(__title, __close)
           button[data-pf-menu=m] + div.pf-menu#m[role=menu] > button[role=menuitem](.pf-menu__item--danger) | .pf-menu__sep
           (pf.js handles keys and placement; details.pf-menu > summary + .pf-menu__list is the no-JS variant)
           [data-pf-tip="text"](data-pf-tip-pos=bottom)  .pf-h1 .pf-stack .pf-mute */

/* ---------- Fonts (OFL, see public/fonts/*-OFL.txt) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/inter-latin-wght.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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/inter-latin-ext-wght.woff2) format("woff2");
  unicode-range: U+0100-0130, U+0132-0151, U+0154-017F, U+0218-021B, U+1E9E; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/montserrat-latin-700.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; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/montserrat-latin-ext-700.woff2) format("woff2");
  unicode-range: U+0100-0130, U+0132-0151, U+0154-017F, U+0218-021B, U+1E9E; }

/* ---------- Tokens ---------- */
body.pf {
  --pf-bg: #ffffff; --pf-surface: #f3f7fb; --pf-surface-2: #e4edf6;
  --pf-ink: #0f1b2d; --pf-ink-2: #33445a; --pf-mute: #5b6675;
  --pf-line: #e3e9f0; --pf-line-strong: #cfd9e4;
  --pf-primary: #1765a8; --pf-on-primary: #ffffff; --pf-brand: #007daf; --pf-live: #1a8fd0;
  --pf-select: #e7f2fb; --pf-red: #c62f2f; --pf-red-row: #fdf4f4;
  --pf-yellow: #8f6200; --pf-yellow-dot: #a67c00; --pf-green: #1f8f5a; --pf-session: #7b61ff;
  --pf-brand-gradient: linear-gradient(90deg, #1da5e8, #4cc6c0 55%, #c6f25a);
  --pf-radius: 6px; --pf-radius-panel: 8px;
  --pf-font-ui: "Inter", system-ui, sans-serif;
  --pf-font-display: "Montserrat", "Inter", sans-serif;
  /* extras (not in the WP1 table): popover shadow, focus ring */
  --pf-shadow: 0 8px 28px rgba(15, 27, 45, .12);
  --pf-ring: 0 0 0 3px color-mix(in srgb, var(--pf-live) 28%, transparent);
  /* logo colors (logoLight.png / logoDark.png) for the "P" mark of the icon rail */
  --pf-logo-ink: #1866a9; --pf-logo-frame: #1da5e8; --pf-logo-check: #4cc6c0; --pf-logo-tip: #c6f25a;
  color-scheme: light;
  background: var(--pf-bg); color: var(--pf-ink);
  font: 400 13px/1.45 var(--pf-font-ui); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; scrollbar-color: var(--pf-line-strong) transparent;
}
body.pf.darkmode {
  --pf-bg: #0b1220; --pf-surface: #0f1a2b; --pf-surface-2: #172539;
  --pf-ink: #eef3f9; --pf-ink-2: #c9d4e3; --pf-mute: #8797ad;
  --pf-line: #18263a; --pf-line-strong: #2a3b54;
  --pf-primary: #1f74c2; --pf-brand: #38b6e7; --pf-live: #38b6e7;
  --pf-select: rgba(56, 182, 231, .14); --pf-red: #f26b6b; --pf-red-row: rgba(242, 107, 107, .08);
  --pf-yellow: #f5c542; --pf-yellow-dot: #f5c542; --pf-green: #4cc38a; --pf-session: #a594ff;
  --pf-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  --pf-logo-ink: #ffffff;
  color-scheme: dark;
}
/* the viewport scrollbar takes its style from the root element */
:root:has(> body.pf) { scrollbar-color: #8797ad55 transparent; }

/* ---------- Base (low specificity so page CSS can win) ---------- */
:where(body.pf) :is(h1, h2, h3, h4, h5, h6) { color: var(--pf-ink); letter-spacing: -0.01em; }
:where(body.pf) a { color: var(--pf-brand); }
:where(body.pf) a:hover { color: color-mix(in srgb, var(--pf-brand) 80%, var(--pf-ink)); }
:where(body.pf) label { font-weight: 500; color: var(--pf-ink-2); }
:where(body.pf) hr { border-color: var(--pf-line); }
:where(body.pf) :is(input[type=checkbox], input[type=radio], progress, input[type=range]) { accent-color: var(--pf-primary); }
:where(body.pf) :is(input[type=checkbox], input[type=radio]) { width: 16px; height: 16px; vertical-align: middle; }
:where(body.pf) :is(.pf-sidebar, .pf-page, .table-responsive, .modal-body, dialog, .pf-drawer, .pf-menu__list, .dropdown-menu, textarea, .pf-scroll, [data-simplebar]) { scrollbar-width: thin; }
body.pf :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--pf-live); outline-offset: 2px; }
body.pf svg.pf-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Hyper utilities are !important with fixed light colours; these beat them (see header of report) */
body.pf .text-muted { color: var(--pf-mute) !important; }
body.pf .text-dark { color: var(--pf-ink) !important; }
body.pf .bg-white { background-color: var(--pf-bg) !important; }
body.pf .bg-light { background-color: var(--pf-surface) !important; }
body.pf .border { border-color: var(--pf-line) !important; }
body.pf .color-corporate { color: var(--pf-brand) !important; }
body.pf .text-danger { color: var(--pf-red) !important; }
body.pf .text-success { color: var(--pf-green) !important; }
body.pf .text-warning { color: var(--pf-yellow) !important; }
body.pf :is(.text-info, .text-primary) { color: var(--pf-brand) !important; }
body.pf :is(.shadow, .shadow-sm) { box-shadow: none !important; }

/* ---------- Buttons ---------- */
body.pf .btn {
  --b-bg: var(--pf-bg); --b-bd: var(--pf-line-strong); --b-fg: var(--pf-ink); --b-hv: var(--pf-surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px; border: 1px solid; border-radius: var(--pf-radius);
  font: 500 13px/1 var(--pf-font-ui); letter-spacing: -0.01em; white-space: nowrap; text-decoration: none;
}
body.pf .btn,
body.pf .btn:focus,
body.pf .btn:not(:disabled):not(.disabled):active,
body.pf .btn:not(:disabled):not(.disabled).active,
body.pf .show > .btn.dropdown-toggle { background-color: var(--b-bg); border-color: var(--b-bd); color: var(--b-fg); box-shadow: none; }
body.pf .btn:hover,
body.pf .btn:not(:disabled):not(.disabled):hover { background-color: var(--b-hv); border-color: var(--b-bd); color: var(--b-fg); }
body.pf :is(.btn-primary, .btn-corporate, .btn-success, .btn-info) {
  --b-bg: var(--pf-primary); --b-bd: var(--pf-primary); --b-fg: var(--pf-on-primary);
  --b-hv: color-mix(in srgb, var(--pf-primary) 86%, var(--pf-ink));
}
/* bg/border repeated so scripts that add btn-danger next to btn-primary/btn-success get the danger look, not red on blue */
body.pf .btn-danger { --b-bg: var(--pf-bg); --b-bd: var(--pf-line-strong); --b-fg: var(--pf-red); --b-hv: var(--pf-red-row); }
body.pf .btn-danger:hover { --b-bd: color-mix(in srgb, var(--pf-red) 45%, transparent); }
body.pf .btn-link { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--pf-brand); --b-hv: transparent; }
body.pf .btn-link:hover { text-decoration: underline; }
body.pf .btn-sm, body.pf .btn-group-sm > .btn { height: 26px; padding: 0 8px; font-size: 12px; }
body.pf .btn-lg { height: 36px; padding: 0 16px; font-size: 14px; }
body.pf .btn-block { display: flex; width: 100%; }
body.pf .btn:disabled, body.pf .btn.disabled { opacity: .5; }
body.pf .close { color: var(--pf-ink-2); text-shadow: none; opacity: .7; }
body.pf .pf-iconbtn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: var(--pf-radius); background: transparent; color: var(--pf-ink-2); cursor: pointer;
}
body.pf .pf-iconbtn:hover, body.pf .pf-iconbtn[aria-expanded=true] { background: var(--pf-surface-2); color: var(--pf-ink); }

/* ---------- Inputs ---------- */
body.pf .form-control,
body.pf .custom-select,
:where(body.pf) :is(select, textarea, input:is([type=text], [type=search], [type=email], [type=number], [type=password], [type=url], [type=tel], [type=date], [type=time], [type=datetime-local])):not([class]) {
  height: 30px; padding: 0 10px; border: 1px solid var(--pf-line-strong); border-radius: var(--pf-radius);
  background-color: var(--pf-bg); color: var(--pf-ink); font: 400 13px/1.4 var(--pf-font-ui); box-shadow: none;
}
body.pf :is(textarea.form-control, select.form-control[multiple], select.form-control[size]),
:where(body.pf) textarea:not([class]) { height: auto; padding: 6px 10px; }
body.pf :is(select.form-control:not([multiple]):not([size]), .custom-select),
:where(body.pf) select:not([class]) {
  appearance: none; padding-right: 28px;
  background: var(--pf-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238797ad' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
}
body.pf :is(.form-control, .custom-select)::placeholder, :where(body.pf) :is(input, textarea)::placeholder { color: var(--pf-mute); opacity: 1; }
body.pf :is(.form-control, .custom-select):focus,
:where(body.pf) :is(select, textarea, input):not([class]):focus { border-color: var(--pf-live); box-shadow: var(--pf-ring); outline: 0; background-color: var(--pf-bg); color: var(--pf-ink); }
body.pf .form-control:is(:disabled, [readonly]), body.pf .custom-select:disabled { background-color: var(--pf-surface); color: var(--pf-mute); }
body.pf .form-control.is-invalid { border-color: var(--pf-red); }
body.pf .form-control-sm { height: 26px; font-size: 12px; }
body.pf .input-group-text { height: 30px; padding: 0 10px; background: var(--pf-surface); border-color: var(--pf-line-strong); color: var(--pf-mute); font-size: 13px; }
body.pf :is(.form-text, .invalid-feedback) { font-size: 12px; }
body.pf .invalid-feedback { color: var(--pf-red); }
body.pf .pf-search { position: relative; color: var(--pf-mute); }
body.pf .pf-search > svg { position: absolute; left: 9px; top: 7px; pointer-events: none; }
body.pf .pf-search > input { padding-left: 30px; width: 100%; }

/* Bootstrap custom checkbox / switch */
body.pf .custom-control-label::before { background-color: var(--pf-bg); border-color: var(--pf-line-strong); }
body.pf .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--pf-primary); border-color: var(--pf-primary); }
body.pf .custom-control-input:focus ~ .custom-control-label::before { box-shadow: var(--pf-ring); border-color: var(--pf-live); }
body.pf .custom-switch .custom-control-label::after { background-color: var(--pf-mute); }
body.pf .custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: #fff; }
/* native switch: <input type=checkbox class="pf-switch"> (knob is a gradient, so it works without ::before) */
body.pf input.pf-switch {
  appearance: none; width: 30px; height: 18px; margin: 0; border-radius: 999px; cursor: pointer; flex: none; vertical-align: middle;
  background: radial-gradient(circle at 9px 50%, #fff 6px, transparent 6.5px), var(--pf-line-strong);
}
body.pf input.pf-switch:checked { background: radial-gradient(circle at 21px 50%, #fff 6px, transparent 6.5px), var(--pf-primary); }
body.pf input.pf-switch:disabled { opacity: .5; cursor: default; }

/* ---------- Cards and panels (flat: bg, hairline border, 8px) ---------- */
body.pf :is(.card, .pf-panel) { background: var(--pf-bg); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); box-shadow: none; color: var(--pf-ink); min-width: 0; }
body.pf :is(.card-header, .pf-panel__head) {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px;
  background: transparent; border-bottom: 1px solid var(--pf-line); font-weight: 600;
}
body.pf .card-footer { padding: 10px 14px; background: transparent; border-top: 1px solid var(--pf-line); }
body.pf :is(.card-body, .pf-panel__body) { padding: 14px; }
body.pf .card-title { color: var(--pf-ink); font-size: 14px; font-weight: 600; }
body.pf .pf-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }
body.pf .pf-h1 { margin: 0; font: 700 22px/1.25 var(--pf-font-display); letter-spacing: -0.2px; color: var(--pf-ink); }
body.pf .pf-mute { color: var(--pf-mute); }

/* Stats row: 1px gap on a line-coloured grid gives dividers at any wrap */
body.pf .pf-stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px;
  background: var(--pf-line); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); overflow: hidden;
}
body.pf .pf-stat { display: grid; gap: 2px; padding: 12px 16px; background: var(--pf-surface); }
body.pf .pf-stat__n { font: 700 22px/1.1 var(--pf-font-display); letter-spacing: -0.2px; font-variant-numeric: tabular-nums; color: var(--pf-ink); }
body.pf .pf-stat__l { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--pf-mute); }
body.pf .pf-stat--alert .pf-stat__n { color: var(--pf-red); }

/* ---------- Table ---------- */
body.pf :is(.table, .pf-table) { width: 100%; margin: 0; color: var(--pf-ink); background: transparent; border-collapse: collapse; }
body.pf :is(.table, .pf-table) :is(th, td) { padding: 8px 9px; border-top: 0; border-bottom: 1px solid var(--pf-line); vertical-align: middle; }
body.pf :is(.table, .pf-table) thead th {
  background: var(--pf-surface); color: var(--pf-mute); font-size: 12px; font-weight: 500;
  text-align: left; text-transform: none; letter-spacing: 0; white-space: nowrap; border-bottom: 1px solid var(--pf-line);
}
body.pf .table-sm :is(th, td) { padding: 5px 8px; }
body.pf .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
body.pf :is(.card, .pf-panel, .pf-table-wrap) > :is(.table, .pf-table) > tbody > tr:last-child > td,
body.pf :is(.card, .pf-panel, .pf-table-wrap) > .table-responsive > .table > tbody > tr:last-child > td { border-bottom: 0; }
body.pf .pf-table-wrap { position: relative; /* an absolute .sr-only inside must not widen the page */ border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); overflow-x: auto; overflow-y: hidden; background: var(--pf-bg); }
body.pf :is(.table, .pf-table) td a:not(.btn) { color: var(--pf-ink); font-weight: 600; text-decoration: none; }
body.pf :is(.table, .pf-table) td a:not(.btn):hover { color: var(--pf-brand); text-decoration: underline; }
body.pf tbody > tr[data-susp="red"] { background: var(--pf-red-row); }
body.pf :is(.table, .pf-table) tbody > tr:hover { background: var(--pf-surface); color: var(--pf-ink); }
body.pf :is(.table, .pf-table) tbody > tr.selected { background: var(--pf-select); }
body.pf tbody > tr.selected > td:first-child { box-shadow: inset 2px 0 0 var(--pf-live); }
body.pf tbody > tr[data-susp="red"] > td:first-child { box-shadow: inset 3px 0 0 var(--pf-red); }
body.pf tbody > tr[data-susp="yellow"] > td:first-child { box-shadow: inset 3px 0 0 var(--pf-yellow-dot); }

/* ---------- Chips, pills, dots, badges, segmented, selection bar ---------- */
body.pf .pf-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px;
  border: 1px solid var(--pf-line-strong); border-radius: var(--pf-radius); background: transparent;
  color: var(--pf-ink); font: 500 12.5px/1 var(--pf-font-ui); cursor: pointer; white-space: nowrap;
}
body.pf .pf-chip b { font-weight: 500; color: var(--pf-mute); font-variant-numeric: tabular-nums; }
body.pf .pf-chip:hover { background: var(--pf-surface); }
body.pf .pf-chip[aria-pressed="true"] { background: var(--pf-select); border-color: color-mix(in srgb, var(--pf-live) 45%, transparent); }
body.pf .pf-chip[aria-pressed="true"] b { color: var(--pf-ink-2); }

body.pf .pf-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  --pill: var(--pf-mute); color: var(--pf-ink-2); background: color-mix(in srgb, var(--pf-mute) 14%, transparent);
}
body.pf .pf-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pill); flex: none; }
body.pf .pf-pill.susp--white { color: var(--pf-mute); background: transparent; box-shadow: inset 0 0 0 1px var(--pf-line-strong); --pill: var(--pf-line-strong); }
body.pf .pf-pill.susp--green { --pill: var(--pf-green); color: color-mix(in srgb, var(--pf-green) 75%, var(--pf-ink)); background: color-mix(in srgb, var(--pf-green) 12%, transparent); }
body.pf .pf-pill.susp--yellow { --pill: var(--pf-yellow-dot); color: var(--pf-yellow); background: color-mix(in srgb, var(--pf-yellow-dot) 16%, transparent); }
body.pf .pf-pill.susp--red { --pill: var(--pf-red); color: color-mix(in srgb, var(--pf-red) 85%, var(--pf-ink)); background: color-mix(in srgb, var(--pf-red) 12%, transparent); font-weight: 700; }

body.pf .pf-dot { position: relative; display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--pf-mute); }
body.pf .pf-dot--red { background: var(--pf-red); }
body.pf .pf-dot--yellow { background: var(--pf-yellow-dot); }
body.pf :is(.pf-dot--green, .pf-dot--done) { background: var(--pf-green); }
body.pf .pf-dot--session { background: var(--pf-session); }
body.pf .pf-dot--idle { background: var(--pf-line-strong); }
body.pf :is(.pf-dot--live, .pf-dot--check) { background: var(--pf-live); }
body.pf .pf-dot--check { opacity: .55; }
body.pf .pf-dot--live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pf-live); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  body.pf .pf-dot--live::after { animation: pf-pulse 1.8s ease-out infinite; }
}
@keyframes pf-pulse { 0% { opacity: .5; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.6); } }

body.pf .badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1;
  background: var(--pf-surface-2); color: var(--pf-ink-2);
}
body.pf :is(.badge-primary, .badge-info) { background: var(--pf-primary); color: var(--pf-on-primary); }
body.pf .badge-danger { background: color-mix(in srgb, var(--pf-red) 14%, transparent); color: var(--pf-red); }
body.pf .badge-success { background: color-mix(in srgb, var(--pf-green) 14%, transparent); color: color-mix(in srgb, var(--pf-green) 75%, var(--pf-ink)); }
body.pf .badge-warning { background: color-mix(in srgb, var(--pf-yellow-dot) 18%, transparent); color: var(--pf-yellow); }

body.pf .pf-segmented { display: inline-flex; justify-self: start; align-self: start; border: 1px solid var(--pf-line-strong); border-radius: var(--pf-radius); overflow: hidden; }
body.pf .pf-segmented > input { position: absolute; opacity: 0; pointer-events: none; }
body.pf .pf-segmented > :is(button, label) {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 11px; border: 0; background: transparent;
  color: var(--pf-ink-2); font: 500 12.5px/1.2 var(--pf-font-ui); cursor: pointer;
}
body.pf .pf-segmented > :is(button, label) ~ :is(button, label) { border-left: 1px solid var(--pf-line-strong); }
body.pf .pf-segmented > button[aria-pressed="true"], body.pf .pf-segmented > input:checked + label { background: var(--pf-select); color: var(--pf-ink); }
body.pf .pf-segmented > .is-danger[aria-pressed="true"], body.pf .pf-segmented > input:checked + label.is-danger { background: color-mix(in srgb, var(--pf-red) 16%, transparent); color: var(--pf-red); font-weight: 600; }
body.pf .pf-segmented > input:focus-visible + label { outline: 2px solid var(--pf-live); outline-offset: -2px; }

body.pf .pf-selbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 6px 6px 14px;
  border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); background: var(--pf-surface);
}
body.pf .pf-selbar__count { font-weight: 500; margin-right: auto; }
body.pf .pf-selbar.is-idle .pf-selbar__count { font-weight: 400; color: var(--pf-mute); }
body.pf .pf-selbar.is-idle .btn:disabled { opacity: .45; }

/* Table footer with pf_createTable paging: <div.pf-tablefoot> info, page-size select, <nav.pf-pager> */
body.pf .pf-tablefoot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--pf-mute); font-size: 12.5px; }
body.pf .pf-tablefoot select { width: auto; margin-left: auto; }
body.pf .pf-pager { display: flex; gap: 4px; align-items: center; }
body.pf .pf-pager .pf-iconbtn { min-width: 28px; height: 28px; width: auto; padding: 0 4px; font-weight: 500; font-variant-numeric: tabular-nums; }
body.pf .pf-pager .pf-iconbtn.on { background: var(--pf-primary); color: var(--pf-on-primary); }
body.pf .pf-pager .pf-iconbtn:disabled { opacity: .4; cursor: default; }

/* ---------- Tabs, pagination, dropdowns, alerts ---------- */
body.pf .nav-tabs { gap: 16px; border-bottom: 1px solid var(--pf-line); }
body.pf .nav-tabs .nav-link {
  margin: 0 0 -1px; padding: 8px 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--pf-mute); font-weight: 500;
}
body.pf .nav-tabs .nav-link:hover { color: var(--pf-ink); }
body.pf .nav-tabs :is(.nav-link.active, .nav-item.show .nav-link) { color: var(--pf-ink); background: transparent; border-bottom-color: var(--pf-live); }

body.pf .pagination { gap: 4px; margin: 0; }
body.pf .page-link {
  display: grid; place-items: center; min-width: 28px; height: 28px; margin: 0; padding: 0 6px;
  border: 0; border-radius: var(--pf-radius); background: transparent; color: var(--pf-ink); font-weight: 500; box-shadow: none;
}
body.pf .page-link:hover { background: var(--pf-surface-2); color: var(--pf-ink); }
body.pf .page-item:is(:first-child, :last-child) .page-link { border-radius: var(--pf-radius); }
body.pf .page-item.active .page-link { background: var(--pf-primary); color: var(--pf-on-primary); }
body.pf .page-item.disabled .page-link { background: transparent; color: var(--pf-mute); opacity: .6; }

body.pf :is(.dropdown-menu, .pf-menu__list, div.pf-menu) {
  min-width: 180px; padding: 4px; border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel);
  background: var(--pf-bg); color: var(--pf-ink); box-shadow: var(--pf-shadow); font-size: 13px;
}
body.pf :is(.dropdown-item, .pf-menu__item, div.pf-menu > [role^=menuitem]) {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--pf-ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
body.pf :is(.dropdown-item, .pf-menu__item, div.pf-menu > [role^=menuitem]):is(:hover, :focus-visible) { background: var(--pf-surface-2); color: var(--pf-ink); }
body.pf .dropdown-item:is(.active, :active) { background: var(--pf-select); color: var(--pf-ink); }
body.pf .pf-menu__item--danger, body.pf .pf-menu__item--danger:hover { color: var(--pf-red); }
body.pf :is(.dropdown-divider, .pf-menu__sep) { height: 0; margin: 4px 0; border: 0; border-top: 1px solid var(--pf-line); }
body.pf .dropdown-header { color: var(--pf-mute); font-size: 11.5px; padding: 6px 10px 2px; }
body.pf details.pf-menu { position: relative; display: inline-block; }
body.pf details.pf-menu > summary { list-style: none; }
body.pf details.pf-menu > summary::-webkit-details-marker { display: none; }
body.pf .pf-menu__list { position: absolute; z-index: 1000; top: calc(100% + 4px); right: 0; display: grid; }
body.pf .pf-menu__list[hidden] { display: none; }
/* pf.js menus: button[data-pf-menu] + div.pf-menu[role=menu]; pf.js positions them (fixed, top layer) */
body.pf div.pf-menu { display: grid; z-index: 1060; max-height: min(60vh, 360px); overflow-y: auto; }
body.pf div.pf-menu[hidden] { display: none; }
/* checkable menus (language): the checked item is tinted, hover is neutral so it never reads as a second selection;
   keyboard focus is an inset ring (app-creative.min.css removes button outlines), also on the checked item */
body.pf div.pf-menu:has(> [aria-checked]) > [role^=menuitem]:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--pf-ink) 7%, var(--pf-bg)); }
body.pf div.pf-menu > [aria-checked="true"] { background: color-mix(in srgb, var(--pf-live) 16%, var(--pf-bg)); font-weight: 600; }
body.pf div.pf-menu:has(> [aria-checked]) > [aria-checked="true"]:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--pf-live) 24%, var(--pf-bg)); }
body.pf div.pf-menu > [role^=menuitem]:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--pf-live); }
body.pf div.pf-menu > [aria-checked="true"]::after { content: "\F012C"; margin-inline-start: auto; padding-inline-start: 12px; font: normal 16px/1 "Material Design Icons"; color: var(--pf-live); }

body.pf .alert {
  --a: var(--pf-live); padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--a) 40%, transparent);
  border-radius: var(--pf-radius-panel); background: color-mix(in srgb, var(--a) 9%, var(--pf-bg)); color: var(--pf-ink);
}
body.pf .alert-danger { --a: var(--pf-red); }
body.pf .alert-warning { --a: var(--pf-yellow-dot); }
body.pf .alert-success { --a: var(--pf-green); }
body.pf :is(.alert-secondary, .alert-light, .alert-dark) { --a: var(--pf-mute); }
body.pf .alert .alert-link { color: inherit; text-decoration: underline; }

/* ---------- Modals (native <dialog>, plus Bootstrap modal parts) ---------- */
body.pf dialog.pf-modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; overflow: auto;
  border: 1px solid var(--pf-line); border-radius: 10px; background: var(--pf-bg); color: var(--pf-ink); box-shadow: var(--pf-shadow);
}
body.pf dialog.pf-modal--lg { width: min(800px, calc(100vw - 32px)); }
body.pf dialog:is(.pf-modal, .pf-drawer)::backdrop { background: rgba(5, 10, 20, .5); }
body.pf .modal-content { background: var(--pf-bg); color: var(--pf-ink); border: 1px solid var(--pf-line); border-radius: 10px; box-shadow: var(--pf-shadow); }
body.pf dialog .modal-content { border: 0; box-shadow: none; }
body.pf .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--pf-line); }
body.pf .modal-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--pf-ink); }
body.pf .modal-body { padding: 16px; }
body.pf .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--pf-line); }
body.pf .modal-footer > :is(.btn, button, a, span, div) { margin: 0; }
body.pf .modal-backdrop { background: rgb(5, 10, 20); }

/* Drawer: inline (.pf-withdrawer grid) or as a right-hand <dialog class="pf-drawer"> */
body.pf .pf-withdrawer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
body.pf .pf-drawer { border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); background: var(--pf-bg); color: var(--pf-ink); box-shadow: var(--pf-shadow); min-width: 0; }
body.pf dialog.pf-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(420px, 100vw); height: 100%; max-height: none; margin: 0; padding: 0;
  border-width: 0 0 0 1px; border-radius: 0; overflow: auto;
}

/* ---------- Toasts ---------- */
body.pf .pf-toast-region {
  position: fixed; z-index: 1090; inset-inline-start: 236px; bottom: 16px; display: grid; gap: 8px; /* next to the sidebar, also in RTL */
  width: min(360px, calc(100vw - 32px)); pointer-events: none;
}
body.pf .pf-toast {
  --t: var(--pf-live); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; pointer-events: auto;
  border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); background: var(--pf-bg); color: var(--pf-ink);
  box-shadow: var(--pf-shadow), inset 3px 0 0 var(--t);
}
/* the accent stripe on the side where the text starts */
html[dir="rtl"] body.pf .pf-toast { box-shadow: var(--pf-shadow), inset -3px 0 0 var(--t); }
body.pf .pf-toast--success { --t: var(--pf-green); }
body.pf .pf-toast--error { --t: var(--pf-red); }
body.pf .pf-toast--warning { --t: var(--pf-yellow-dot); }
body.pf .pf-toast__title { font-weight: 600; }
body.pf .pf-toast > :not(.pf-toast__close) { grid-column: 1; }
body.pf .pf-toast__close { grid-row: 1 / span 2; grid-column: 2; align-self: start; width: 22px; height: 22px; }

/* ---------- Tooltip: <x data-pf-tip="Text"> (not on <input>/<img>: no pseudo-elements there) ---------- */
body.pf [data-pf-tip] { position: relative; }
/* look shared with the rail tooltip div.pf-navtip (Shell) */
body.pf [data-pf-tip]::after, body.pf .pf-navtip {
  z-index: 1070; padding: 4px 8px; border-radius: 4px; background: var(--pf-ink); color: var(--pf-bg);
  font: 500 12px/1.3 var(--pf-font-ui); letter-spacing: 0; white-space: nowrap; pointer-events: none;
}
body.pf [data-pf-tip]::after {
  content: attr(data-pf-tip); position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translate(-50%, 0);
  /* not rendered until hover/focus: a transparent tooltip still widens scroll areas (table scrollbars) */
  display: none;
}
body.pf [data-pf-tip-pos="bottom"]::after { bottom: auto; top: calc(100% + 6px); }
body.pf [data-pf-tip]:not([data-pf-tip=""]):is(:hover, :focus-visible)::after { display: block; animation: pf-tip .12s .3s both; }

/* ---------- Shell ---------- */
body.pf .pf-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
body.pf .pf-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px; background: var(--pf-surface); border-inline-end: 1px solid var(--pf-line);
}
body.pf .pf-sidebar__brand { display: block; padding: 8px 10px 18px; }
body.pf .pf-sidebar__logo { display: flex; }
body.pf .pf-sidebar__logo img { height: 42px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
body.pf .pf-sidebar__mark { display: none; }
body.pf .pf-mark { display: block; width: 28px; height: 28px; margin: 0 auto; }
body.pf .pf-mark__frame { fill: none; stroke: var(--pf-logo-frame); stroke-width: 2; }
body.pf .pf-mark__p { fill: var(--pf-logo-ink); }
body.pf .pf-mark__stop1 { stop-color: var(--pf-logo-frame); }
body.pf .pf-mark__stop2 { stop-color: var(--pf-logo-check); }
body.pf .pf-mark__stop3 { stop-color: var(--pf-logo-tip); }
body.pf .pf-logo-dark, body.pf.darkmode .pf-logo-light { display: none; }
body.pf.darkmode .pf-logo-dark { display: block; }
body.pf .pf-nav { display: grid; gap: 2px; }
body.pf .pf-nav__group { padding: 14px 10px 4px; font-size: 11px; font-weight: 500; color: var(--pf-mute); }
body.pf .pf-nav__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 30px; padding: 6px 10px;
  border: 0; border-radius: var(--pf-radius); background: transparent; color: var(--pf-ink-2);
  font: 500 13px/1.3 var(--pf-font-ui); text-align: left; text-decoration: none; cursor: pointer;
}
body.pf .pf-nav__item:hover { background: color-mix(in srgb, var(--pf-surface-2) 60%, transparent); color: var(--pf-ink); }
body.pf .pf-nav__item[aria-current="page"] { background: var(--pf-surface-2); color: var(--pf-ink); box-shadow: inset 2px 0 0 var(--pf-live); border-radius: 0; border-start-end-radius: 6px; border-end-end-radius: 6px; }
html[dir="rtl"] body.pf .pf-nav__item[aria-current="page"]:not(:focus-visible) { box-shadow: inset -2px 0 0 var(--pf-live); }
/* app-creative.min.css removes the outline of every a and button (an important declaration): the sidebar marks focus inside */
body.pf :is(.pf-nav__item, .pf-sidebar__brand):focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--pf-live); }
body.pf .pf-sidebar__brand { border-radius: var(--pf-radius); }
body.pf :is(.pf-nav__icon, .pf-nav__item > .pf-icon) { width: 16px; flex: none; color: var(--pf-mute); font-size: 16px; line-height: 1; text-align: center; }
body.pf .pf-nav__item[aria-current="page"] :is(.pf-nav__icon, .pf-icon) { color: var(--pf-brand); }
body.pf .pf-nav__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.pf :is(.pf-nav__ext, .pf-nav__count) { margin-left: auto; display: inline-flex; color: var(--pf-mute); }
body.pf .pf-nav__ext .pf-icon { width: 13px; height: 13px; }
body.pf .pf-nav__count { font-size: 11px; font-weight: 600; }
body.pf .pf-nav__chev { width: 14px; height: 14px; transition: transform .15s ease; }
body.pf details.pf-nav__su { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pf-line); display: grid; gap: 2px; }
body.pf details.pf-nav__su > summary { list-style: none; }
body.pf details.pf-nav__su > summary::-webkit-details-marker { display: none; }
body.pf details.pf-nav__su[open] .pf-nav__chev { transform: rotate(180deg); }
body.pf .pf-sidebar__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--pf-line); display: grid; gap: 2px; }
/* collapse toggle: the icon points to where the sidebar goes (mirrored in RTL and when collapsed) */
body.pf.pf-nav-compact .pf-nav__toggle .pf-nav__icon, html[dir="rtl"] body.pf .pf-nav__toggle .pf-nav__icon { transform: scaleX(-1); }
html[dir="rtl"] body.pf.pf-nav-compact .pf-nav__toggle .pf-nav__icon { transform: none; }
/* rail tooltip (navRail.js sets top and left): fixed, so the sidebar's overflow cannot clip it */
body.pf .pf-navtip { position: fixed; top: 0; left: 0; transform: translateY(-50%); }

body.pf .pf-main { min-width: 0; display: flex; flex-direction: column; }
body.pf .pf-subnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 10px 24px; box-shadow: inset 0 -1px 0 var(--pf-line); }
body.pf .pf-crumbs { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pf-mute); font-weight: 500; }
body.pf .pf-crumbs a { color: inherit; text-decoration: none; }
body.pf .pf-crumbs a:hover { color: var(--pf-ink); }
body.pf .pf-crumbs :is(b, [aria-current]) { color: var(--pf-ink); font-weight: 500; }
body.pf .pf-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
body.pf .pf-brandline { height: 2px; flex: none; background: var(--pf-brand-gradient); }
body.pf .pf-page { flex: 1; min-width: 0; padding: 22px 24px 20px; }
body.pf .pf-sidebar-toggle, body.pf .pf-scrim { display: none; }

/* icon rail: always at 640-991px, and at >=992px when collapsed (body.pf-nav-compact). The two blocks hold the
   same rail declarations (a media query cannot be OR-ed with a class); change them together. .pf-withdrawer is
   about the viewport width, not the rail, so it is only in the first. */
@media (min-width: 640px) and (max-width: 991.98px) {
  body.pf .pf-toast-region { inset-inline-start: 72px; }
  body.pf .pf-shell { grid-template-columns: 56px minmax(0, 1fr); }
  body.pf .pf-sidebar { padding: 14px 8px; z-index: 1020; } /* menus beside the rail stay above the page without the Popover API */
  body.pf .pf-sidebar__brand { padding: 4px 0 14px; }
  body.pf :is(.pf-sidebar__logo, .pf-nav__label, .pf-nav__group, .pf-nav__ext, .pf-nav__count, .pf-nav__chev) { display: none; }
  body.pf .pf-sidebar__mark { display: block; }
  body.pf .pf-nav__item { justify-content: center; padding: 7px 0; }
  body.pf .pf-withdrawer { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 992px) {
  body.pf.pf-nav-compact .pf-toast-region { inset-inline-start: 72px; }
  body.pf.pf-nav-compact .pf-shell { grid-template-columns: 56px minmax(0, 1fr); }
  body.pf.pf-nav-compact .pf-sidebar { padding: 14px 8px; z-index: 1020; }
  body.pf.pf-nav-compact .pf-sidebar__brand { padding: 4px 0 14px; }
  body.pf.pf-nav-compact :is(.pf-sidebar__logo, .pf-nav__label, .pf-nav__group, .pf-nav__ext, .pf-nav__count, .pf-nav__chev) { display: none; }
  body.pf.pf-nav-compact .pf-sidebar__mark { display: block; }
  body.pf.pf-nav-compact .pf-nav__item { justify-content: center; padding: 7px 0; }
}
/* the collapse toggle exists only where the sidebar can be wide */
@media (max-width: 991.98px) { body.pf .pf-nav__toggle { display: none; } }
/* <640px: off-canvas drawer */
@media (max-width: 639.98px) {
  body.pf .pf-toast-region { inset-inline-start: 16px; }
  body.pf .pf-shell { grid-template-columns: minmax(0, 1fr); }
  body.pf .pf-sidebar {
    position: fixed; z-index: 1045; inset: 0 auto 0 0; width: 260px; max-width: 85vw; height: auto;
    transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s;
    border-left: 0; border-right: 1px solid var(--pf-line); /* pinned to the left in RTL too: edge stays on the right */
  }
  body.pf .pf-sidebar.is-open { transform: none; visibility: visible; transition: transform .2s ease; }
  body.pf .pf-sidebar.is-open ~ .pf-scrim { display: block; position: fixed; z-index: 1044; inset: 0; background: rgba(5, 10, 20, .45); }
  body.pf .pf-sidebar-toggle { display: inline-grid; }
  body.pf .pf-subnav { padding: 8px 16px; }
  body.pf .pf-page { padding: 16px; }
  body.pf .pf-stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  body.pf .pf-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  body.pf .pf-withdrawer { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  body.pf dialog:is(.pf-modal, .pf-drawer)[open] { animation: pf-in .16s ease-out; }
  body.pf dialog.pf-drawer[open] { animation-name: pf-slide; }
  body.pf .pf-toast { animation: pf-in .16s ease-out; }
  body.pf .pf-navtip:not([hidden]) { animation: pf-fade .12s .3s both; }
}
@media (prefers-reduced-motion: reduce) {
  body.pf .pf-sidebar, body.pf .pf-sidebar.is-open, body.pf .pf-nav__chev { transition: none; }
}
@keyframes pf-tip { from { opacity: 0; transform: translate(-50%, 2px); } }
@keyframes pf-fade { from { opacity: 0; } }
@keyframes pf-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes pf-slide { from { transform: translateX(24px); opacity: 0; } }

/* ---------- Flatpickr (calendar is appended to body) ---------- */
body.pf .flatpickr-calendar { background: var(--pf-bg); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel); box-shadow: var(--pf-shadow); color: var(--pf-ink); }
body.pf .flatpickr-calendar::before, body.pf .flatpickr-calendar::after { display: none; }
body.pf :is(.flatpickr-months .flatpickr-month, .flatpickr-current-month input.cur-year, .flatpickr-time input, .flatpickr-time .flatpickr-am-pm, .flatpickr-time .flatpickr-time-separator) { color: var(--pf-ink); fill: var(--pf-ink); background: transparent; }
body.pf :is(.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month) { color: var(--pf-ink-2); fill: var(--pf-ink-2); }
body.pf .flatpickr-current-month .flatpickr-monthDropdown-months { background: var(--pf-bg); color: var(--pf-ink); }
body.pf span.flatpickr-weekday { color: var(--pf-mute); }
body.pf .flatpickr-day { color: var(--pf-ink); border-radius: var(--pf-radius); }
body.pf .flatpickr-day:is(:hover, :focus) { background: var(--pf-surface-2); border-color: transparent; }
body.pf .flatpickr-day.today { border-color: var(--pf-live); }
body.pf .flatpickr-day:is(.selected, .startRange, .endRange), body.pf .flatpickr-day.selected:hover { background: var(--pf-primary); border-color: var(--pf-primary); color: var(--pf-on-primary); }
body.pf .flatpickr-day.inRange { background: var(--pf-select); border-color: transparent; box-shadow: none; }
body.pf .flatpickr-day:is(.flatpickr-disabled, .prevMonthDay, .nextMonthDay) { color: var(--pf-mute); opacity: .6; }
body.pf .flatpickr-time,
body.pf .flatpickr-calendar.hasTime .flatpickr-time { border-top: 1px solid var(--pf-line); } /* flatpickr's own hasTime rule is more specific */
body.pf .flatpickr-time :is(input, .flatpickr-am-pm):hover { background: var(--pf-surface); }

/* ---------- Shell extras (wave 2) ---------- */
body.pf .pf-nav__item img.pf-nav__icon { width: 16px; height: 11px; object-fit: cover; border-radius: 2px; }
body.pf .pf-nav__item--logout:hover { color: var(--pf-red); }
body.pf div.pf-menu > [role^=menuitem] img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }
body.pf .pf-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 24px 16px; color: var(--pf-mute); font-size: 12px; }
body.pf .pf-footer a { color: inherit; }
body.pf .pf-footer a:hover { color: var(--pf-ink); }
body.pf .pf-main { display: flex; flex-direction: column; min-width: 0; }
body.pf .pf-search-legacy { display: flex; align-items: center; flex: 0 1 420px; min-width: 0; margin-left: auto; }
body.pf .pf-search-legacy #searchForm { min-width: 0; flex: 1; }
body.pf .pf-search-legacy #searchForm .input-group { align-items: center; flex-wrap: nowrap; box-shadow: none; }
/* input and button share one height so the placeholder sits in the middle of the pill */
body.pf .pf-search-legacy #top-search { height: 34px; line-height: 34px; padding-top: 0; padding-bottom: 0; }
body.pf .pf-search-legacy .buttonTopBarCorpSearch { display: inline-flex; align-items: center; height: 30px; margin: 2px; padding: 0 14px; font-size: 13px; }
body.pf .pf-search-legacy #searchRadioForm { font-size: 0.72rem; gap: 0; margin-left: 8px; white-space: nowrap; }
/* results panel: hangs from the right edge of the search pill and grows to the left, never past the viewport.
   search.css (loaded after this file) pins width/left with !important for the old topbar, hence specificity + !important */
body.pf .pf-search-legacy #searchForm .input-group-append { position: static; }
body.pf .pf-search-legacy #searchDropdown.dropdown-menu {
  top: 100%; left: auto !important; right: 0 !important; transform: none !important;
  width: min(440px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px) !important;
  margin: 6px 0 0 !important; overflow: hidden; overflow-wrap: anywhere;
  background: var(--pf-bg); border-color: var(--pf-line) !important; border-radius: var(--pf-radius-panel); box-shadow: var(--pf-shadow);
}
body.pf .pf-search-legacy #searchDropdown .noti-title,
body.pf .pf-search-legacy #searchFilters { background: var(--pf-surface); border-color: var(--pf-line); }
body.pf .pf-search-legacy #searchDropdown h5 { color: var(--pf-ink); white-space: normal; }
body.pf .pf-search-legacy #instituteSelect { width: 100%; max-width: 100%; }
body.pf .pf-search-legacy .searchResult { white-space: normal; border-bottom-color: var(--pf-line); }
/* pager: search.js gives both buttons an inline width of 120px, which pushed "Next" out of a narrow panel */
body.pf .pf-search-legacy #pagination { gap: 8px; border-top-color: var(--pf-line); }
body.pf .pf-search-legacy #pagination > .btn { width: auto !important; min-width: 0; flex: 0 1 auto; white-space: nowrap; }
body.pf .pf-search-legacy #pagination > span { flex: none; white-space: nowrap; }
body.pf .pf-cookie {
  position: fixed; z-index: 1030; inset-inline-end: 16px; bottom: 16px; max-width: 280px; padding-block: 10px; padding-inline: 12px 32px; /* away from the sidebar, also in RTL */
  background: var(--pf-bg); color: var(--pf-ink-2); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-panel);
  box-shadow: var(--pf-shadow); font-size: 12px; line-height: 1.45;
}
body.pf .pf-cookie__close { position: absolute; top: 4px; inset-inline-end: 6px; border: 0; background: none; font-size: 16px; line-height: 1; color: var(--pf-mute); cursor: pointer; }
@media (max-width: 991.98px) { body.pf .pf-search-legacy { display: none; } }
/* legacy page wrappers inside the shell */
body.pf .pf-page > .wrapper { display: block; height: auto; max-width: none; margin: 0; overflow: visible; background: none; box-shadow: none; }
body.pf .pf-page > .wrapper > .container-fluid { padding: 0; }
/* Bootstrap modal markup inside dialog.pf-modal: the wrappers stay (page scripts resize .modal-dialog), the dialog sizes */
body.pf dialog.pf-modal > .modal-dialog { max-width: none; width: auto; margin: 0; pointer-events: auto; transform: none; }
body.pf dialog.pf-modal > .modal-dialog > .modal-content { border: 0; border-radius: 0; box-shadow: none; background: transparent; color: inherit; }
body.pf dialog.pf-modal:has(> .modal-sm) { width: min(360px, calc(100vw - 32px)); }
body.pf dialog.pf-modal:has(> .modal-lg) { width: min(800px, calc(100vw - 32px)); }
body.pf dialog.pf-modal:has(> .modal-xl) { width: min(1140px, calc(100vw - 32px)); }
body.pf dialog.pf-modal:has(> .modal-full-width) { width: calc(100vw - 48px); }
/* the dialog is the scroll container: its header (title, Close/Save) stays on top while long forms scroll under it */
body.pf dialog.pf-modal > .modal-dialog > .modal-content > .modal-header { position: sticky; top: 0; z-index: 5; background: var(--pf-bg); }
body.pf dialog.pf-modal .modal-filled { color: inherit; }
body.pf dialog.pf-modal .modal-filled .modal-header { border-bottom-color: var(--pf-line); }
/* review notes (wave 1): Hyper card titles, code, drawer on phones */
body.pf .header-title { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--pf-ink); }
body.pf pre { color: var(--pf-ink); background: var(--pf-surface); border: 1px solid var(--pf-line); border-radius: var(--pf-radius); padding: 10px 12px; }
body.pf code { color: var(--pf-ink-2); background: var(--pf-surface); border-radius: 4px; padding: 0 4px; }
body.pf pre code { background: none; padding: 0; }
body.pf dialog.pf-drawer { max-width: 100vw; max-height: 100dvh; }
/* wave 3 shared requests */
body.pf .pf-toast__close { display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--pf-radius); background: none; color: var(--pf-mute); font-size: 16px; line-height: 1; cursor: pointer; }
body.pf .pf-toast__close:hover { background: var(--pf-surface-2); color: var(--pf-ink); }
body.pf [data-pf-tip=""]::after { display: none; }
body.pf [data-pf-tip-wrap]::after { width: max-content; max-width: 260px; white-space: normal; }
body.pf .pf-actions > :last-child[data-pf-tip]::after, body.pf [data-pf-tip-align="end"]::after { left: auto; right: 0; transform: none; }
body.pf :is(.pf-stack, .pf-page) > .card, body.pf .pf-stack > * > .card { margin-bottom: 0; }
body.pf .btn-outline-primary { --b-fg: var(--pf-primary); --b-bd: color-mix(in srgb, var(--pf-primary) 45%, transparent); --b-hv: var(--pf-select); }
body.pf .btn-outline-danger { --b-fg: var(--pf-red); --b-bd: color-mix(in srgb, var(--pf-red) 45%, transparent); --b-hv: var(--pf-red-row); }
body.pf select.form-control:not([size]):not([multiple]) { height: 30px; }
body.pf .table-responsive { position: relative; }
body.pf .flatpickr-wrapper { display: block; }
/* Safari: native search fields ignore padding (icon overlaps the text) and add their own decoration */
body.pf input[type="search"] { -webkit-appearance: none; appearance: none; }
body.pf input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
/* small helpers that several pages defined themselves */
body.pf .pf-h2 { margin: 0; font: 700 16px/1.3 var(--pf-font-display); color: var(--pf-ink); }
body.pf .pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body.pf .pf-search > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
body.pf .pf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--pf-mute); }
body.pf .pf-num { font-variant-numeric: tabular-nums; }
body.pf .pf-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }

/* Option cards: independent on/off choices (webcam, screen share, phone camera) shown as boxes with a visible
   checkbox; checked = outlined, not filled. Selectors carry label.btn to beat the page toggle-button rules. */
body.pf .pf-optcards > label.btn {
  --b-bg: var(--pf-bg); --b-bd: var(--pf-line-strong); --b-fg: var(--pf-ink); --b-hv: var(--pf-surface);
  justify-content: flex-start; gap: 8px; height: auto; min-height: 38px; padding: 8px 12px; font-weight: 500; line-height: 1.3; text-align: left; white-space: normal;
}
body.pf .pf-optcards > label.btn input[type=checkbox] {
  position: static; order: -1; width: 16px; height: 16px; margin: 0; flex: none; clip: auto; pointer-events: auto; cursor: pointer;
}
body.pf .pf-optcards > label.btn:has(input:checked) {
  --b-bg: color-mix(in srgb, var(--pf-primary) 10%, var(--pf-bg)); --b-bd: var(--pf-primary); --b-fg: var(--pf-ink);
  --b-hv: color-mix(in srgb, var(--pf-primary) 16%, var(--pf-bg)); box-shadow: inset 0 0 0 1px var(--pf-primary);
}
body.pf .pf-optcards > label.btn:has(input:checked) .mdi { color: var(--pf-primary); }
body.pf .pf-optcards > label.btn:has(input:focus-visible) { outline: 2px solid var(--pf-live); outline-offset: 2px; }
