/*
 * nowo-ui.css — UiKit 2.0 stylesheet inside the cascade layer `nowo-ui` (GENERATED from nowo-ui.unlayered.css by
 * `pnpm run build:css`; edit the unlayered file).
 *
 * Layer order: the statement below declares `theme, base, nowo-ui, components, utilities` (Tailwind v4 names) when
 * this file is the first stylesheet that names them. `nowo-ui` sits ABOVE `base` (Tailwind preflight would otherwise
 * reset the kit dialogs) and BELOW `components` / `utilities` (host utilities in theme slots win). Load it before the
 * host Tailwind stylesheet, or declare the same order at the top of that stylesheet.
 *
 * Unlayered host CSS (Bootstrap from a CDN, a host theme file) always beats layered rules: hosts that relied on the
 * 1.x cascade (kit rules overriding unlayered framework rules) link nowo-ui.unlayered.css instead.
 */
@layer theme, base, nowo-ui, components, utilities;

@layer nowo-ui {
/**
 * Semantic dashboard styles (REQ-UI-001).
 * Used with css_framework custom/none, and as dual-class base for all stacks.
 *
 * Theming (1.13): every colour, radius, font, focus ring, overlay and shadow reads a --nowo-ui-* token.
 * Base tokens below have :root defaults (light) and [data-theme="dark"] defaults (end of file).
 * Component tokens (--nowo-ui-btn-*, --nowo-ui-input-*, --nowo-ui-table-*, --nowo-ui-tab-*,
 * --nowo-ui-pagination-*, --nowo-ui-list-*, …) are optional: they are NOT declared here and resolve
 * at the use site through var() fallbacks to the base tokens, so a host can set them on :root or on
 * any scope (.kit-admin, a dialog) and dark mode keeps following the base tokens.
 * Full list + defaults: docs/THEMING.md. Hosts: a short :root { --nowo-ui-…: … } block.
 *
 * 2.0 (REQ-UI-003): when the host sets nowo_ui_kit.theme.tokens, the UiKit document layout marks <html> with
 * data-nowo-ui-host-tokens and these palette defaults drop to zero specificity (:where), so any host
 * declaration wins whatever the load order — no !important remaps. Without the attribute nothing changes.
 * 2.15.4: host `tokens` for the tokens of the dark defaults block (end of file) are printed for light mode only
 * (Theme::LIGHT_ONLY_TOKENS, kept equal to that block by ThemeTest), so these dark defaults still apply in dark mode.
 */
:root:where(:not([data-nowo-ui-host-tokens])),
:where(:root[data-nowo-ui-host-tokens]) {
  --nowo-ui-primary: #2563eb;
  --nowo-ui-primary-contrast: #ffffff;
  --nowo-ui-danger: #ef4444;
  --nowo-ui-danger-text: #b91c1c;
  --nowo-ui-danger-bg: #fef2f2;
  --nowo-ui-danger-border: #fecaca;
  --nowo-ui-danger-text-strong: #991b1b;
  --nowo-ui-danger-solid: #b91c1c;
  --nowo-ui-danger-contrast: #ffffff;
  --nowo-ui-success-bg: #ecfdf5;
  --nowo-ui-success-border: #a7f3d0;
  --nowo-ui-success-text: #065f46;
  --nowo-ui-warning-bg: #fffbeb;
  --nowo-ui-warning-border: #fde68a;
  --nowo-ui-warning-text: #92400e;
  --nowo-ui-info-bg: #f0f9ff;
  --nowo-ui-info-border: #bae6fd;
  --nowo-ui-info-text: #075985;
  --nowo-ui-surface: #ffffff;
  --nowo-ui-surface-muted: #f8fafc;
  --nowo-ui-border: #e2e8f0;
  --nowo-ui-border-strong: #cbd5e1;
  --nowo-ui-text: #0f172a;
  --nowo-ui-muted: #64748b;
  --nowo-ui-radius: 0.375rem;
  /* 2.3: defined (follows the primary on the same element), so host / bundle CSS can read var(--nowo-ui-link) */
  --nowo-ui-link: var(--nowo-ui-primary);
}

.nowo-ui-page-header,
.nowo-ui-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.nowo-ui-page-header {
  align-items: flex-start;
  justify-content: space-between;
}

/* Area navigation (PageHeader::tabs, 2.1): its own row under the title and the toolbar */
.nowo-ui-page-header__nav {
  flex: 1 0 100%;
  min-width: 0;
}

.nowo-ui-page-header__nav > .nowo-ui-tabs {
  margin-bottom: 0;
}

.nowo-ui-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nowo-ui-search__input {
  flex: 1 1 14rem;
  min-width: 14rem;
  max-width: none;
}

.nowo-ui-btn {
  display: inline-flex;
  align-items: center;
  /* Density tokens (2.11, re-audit OVR-11): unset ones keep these values; a var() without fallback is "unset". */
  justify-content: var(--nowo-ui-btn-justify);
  gap: 0.25rem;
  min-height: var(--nowo-ui-control-height, auto);
  padding: var(--nowo-ui-btn-py, 0.35rem) var(--nowo-ui-btn-px, 0.75rem);
  border: 1px solid var(--nowo-ui-btn-border, var(--nowo-ui-border-strong));
  border-radius: var(--nowo-ui-btn-radius, var(--nowo-ui-radius));
  background: var(--nowo-ui-btn-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-btn-text, var(--nowo-ui-text));
  font: inherit;
  font-size: var(--nowo-ui-btn-font-size, 0.875rem);
  font-weight: var(--nowo-ui-btn-font-weight);
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

/* Hover / focus for the kit-painted stacks (custom, none, tailwind). Bootstrap `.btn` keeps its own states. */
.nowo-ui-btn:not(.btn):hover {
  border-color: var(--nowo-ui-btn-hover-border, var(--nowo-ui-btn-border, var(--nowo-ui-border-strong)));
  background: var(--nowo-ui-btn-hover-bg, var(--nowo-ui-surface-muted));
  color: var(--nowo-ui-btn-hover-text, var(--nowo-ui-btn-text, var(--nowo-ui-text)));
}

.nowo-ui-btn:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-btn--sm {
  min-height: var(--nowo-ui-btn-sm-size, auto);
  padding: var(--nowo-ui-btn-sm-py, 0.2rem) var(--nowo-ui-btn-sm-px, 0.5rem);
  font-size: var(--nowo-ui-btn-sm-font-size, 0.8125rem);
}

/* Icon-only toolbar button (View\Action::display = icon; slot btn_icon): square padding, label visually hidden */
.nowo-ui-btn--icon {
  justify-content: center;
  gap: 0;
  padding-inline: 0.5rem;
}

/* Compact icon-only buttons are squares of --nowo-ui-btn-sm-size when a host sets it (2.11) */
.nowo-ui-btn--sm.nowo-ui-btn--icon {
  inline-size: var(--nowo-ui-btn-sm-size, auto);
  min-inline-size: var(--nowo-ui-btn-sm-size, auto);
  block-size: var(--nowo-ui-btn-sm-size, auto);
}

.nowo-ui-btn--primary {
  background: var(--nowo-ui-btn-primary-bg, var(--nowo-ui-primary));
  border-color: var(--nowo-ui-btn-primary-border, var(--nowo-ui-btn-primary-bg, var(--nowo-ui-primary)));
  color: var(--nowo-ui-btn-primary-text, var(--nowo-ui-primary-contrast));
}

.nowo-ui-btn--primary:not(.btn):hover {
  background: var(--nowo-ui-btn-primary-hover-bg, var(--nowo-ui-primary-hover, color-mix(in srgb, var(--nowo-ui-primary) 85%, white)));
  border-color: var(--nowo-ui-btn-primary-hover-bg, var(--nowo-ui-primary-hover, color-mix(in srgb, var(--nowo-ui-primary) 85%, white)));
  color: var(--nowo-ui-btn-primary-text, var(--nowo-ui-primary-contrast));
}

.nowo-ui-btn--danger {
  border-color: var(--nowo-ui-btn-danger-border, var(--nowo-ui-danger));
  color: var(--nowo-ui-btn-danger-text, var(--nowo-ui-danger-text));
  background: var(--nowo-ui-btn-danger-bg, var(--nowo-ui-surface));
}

.nowo-ui-btn--danger:not(.btn):hover {
  border-color: var(--nowo-ui-btn-danger-border, var(--nowo-ui-danger));
  background: var(--nowo-ui-btn-danger-hover-bg, var(--nowo-ui-danger-bg));
  color: var(--nowo-ui-btn-danger-text, var(--nowo-ui-danger-text));
}

/* Outline (primary-tinted) variant, 1.13. */
.nowo-ui-btn--outline {
  border-color: var(--nowo-ui-btn-outline-border, var(--nowo-ui-primary));
  background: var(--nowo-ui-btn-outline-bg, transparent);
  color: var(--nowo-ui-btn-outline-text, var(--nowo-ui-primary));
}

.nowo-ui-btn--outline:not(.btn):hover {
  border-color: var(--nowo-ui-btn-outline-border, var(--nowo-ui-primary));
  background: var(--nowo-ui-btn-outline-hover-bg, color-mix(in srgb, var(--nowo-ui-primary) 10%, var(--nowo-ui-surface)));
  color: var(--nowo-ui-btn-outline-text, var(--nowo-ui-primary));
}

.nowo-ui-btn--link,
.nowo-ui-btn--link:not(.btn):hover {
  border: 0;
  background: transparent;
  color: var(--nowo-ui-link, var(--nowo-ui-primary));
  padding-left: 0;
  padding-right: 0;
}

.nowo-ui-btn--link:not(.btn):hover {
  color: var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary)));
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Text link (1.13). */
.nowo-ui-link {
  color: var(--nowo-ui-link, var(--nowo-ui-primary));
  text-decoration: none;
}

.nowo-ui-link:hover {
  color: var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary)));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nowo-ui-link:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
  border-radius: 2px;
}

.nowo-ui-input {
  max-width: 20rem;
  min-height: var(--nowo-ui-control-height, auto);
  padding: var(--nowo-ui-input-py, 0.35rem) var(--nowo-ui-input-px, 0.6rem);
  border: 1px solid var(--nowo-ui-input-border, var(--nowo-ui-border-strong));
  border-radius: var(--nowo-ui-input-radius, var(--nowo-ui-radius));
  font: inherit;
  font-size: var(--nowo-ui-input-font-size);
  accent-color: var(--nowo-ui-accent, var(--nowo-ui-primary));
}

/* Wide / full-width inputs (slots input_wide / input_full, 2.1). 2.29.1: border-box, so width 100% includes the
   padding and border and a full-width field (a textarea) never overflows its container on hosts without a global
   box-sizing reset. */
.nowo-ui-input--wide {
  box-sizing: border-box;
  width: 100%;
  max-width: 36rem;
}

.nowo-ui-input--full {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}

/* Surface, text, placeholder and focus for the kit-painted stacks; Bootstrap `.form-control` keeps its own. */
.nowo-ui-input:not(.form-control) {
  background-color: var(--nowo-ui-input-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-input-text, var(--nowo-ui-text));
}

.nowo-ui-input:not(.form-control)::placeholder {
  color: var(--nowo-ui-input-placeholder, var(--nowo-ui-muted));
  opacity: 1;
}

.nowo-ui-input:not(.form-control):focus {
  outline: 0;
  border-color: var(--nowo-ui-input-focus-border, var(--nowo-ui-primary));
  box-shadow: var(--nowo-ui-focus-ring, 0 0 0 0.2rem var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent)));
}

/* Checkbox / radio (1.13): `.nowo-ui-check` label wrapper + accent colour inside kit surfaces. */
.nowo-ui-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--nowo-ui-text);
  cursor: pointer;
}

.nowo-ui-check > input:is([type='checkbox'], [type='radio']),
:is(.nowo-ui-filter-bar, .nowo-ui-search, .nowo-ui-table, .nowo-ui-data-table, .nowo-ui-list, .nowo-ui-card, .nowo-ui-modal, .nowo-ui-confirm) input:is([type='checkbox'], [type='radio']) {
  accent-color: var(--nowo-ui-accent, var(--nowo-ui-primary));
}

.nowo-ui-check > input:is([type='checkbox'], [type='radio']):focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--nowo-ui-list-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-list-radius, var(--nowo-ui-radius));
}

.nowo-ui-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--nowo-ui-list-item-border, var(--nowo-ui-list-border, var(--nowo-ui-border)));
}

.nowo-ui-list-item:not(.list-group-item) {
  background: var(--nowo-ui-list-item-bg, transparent);
}

.nowo-ui-list-item:not(.list-group-item):hover {
  background: var(--nowo-ui-list-item-hover-bg, var(--nowo-ui-list-item-bg, transparent));
}

.nowo-ui-list-item:last-child {
  border-bottom: 0;
}

.nowo-ui-table-wrap {
  overflow-x: auto;
}

.nowo-ui-table {
  width: 100%;
  border-collapse: collapse;
}

.nowo-ui-table th,
.nowo-ui-table td {
  padding: var(--nowo-ui-table-cell-py, 0.5rem) var(--nowo-ui-table-cell-px, 0.75rem);
  font-size: var(--nowo-ui-table-font-size);
  border-bottom: 1px solid var(--nowo-ui-table-border, var(--nowo-ui-border));
  text-align: left;
  vertical-align: middle;
}

/* Head type (2.11): unset tokens keep the browser's bold, untransformed header */
.nowo-ui-table > thead > tr > th {
  font-size: var(--nowo-ui-table-head-font-size);
  font-weight: var(--nowo-ui-table-head-font-weight, bold);
  letter-spacing: var(--nowo-ui-table-head-letter-spacing);
  text-transform: var(--nowo-ui-table-head-transform);
}

/* Head + hover paint for the kit-painted stacks; Bootstrap `.table` keeps --bs-table-* (see .nowo-ui-bs-tokens). */
.nowo-ui-table:not(.table) > thead > tr > th {
  background: var(--nowo-ui-table-head-bg, transparent);
  color: var(--nowo-ui-table-head-text, currentColor);
}

.nowo-ui-table--striped tbody tr:nth-child(even) {
  background: var(--nowo-ui-table-stripe-bg, var(--nowo-ui-surface-muted));
}

.nowo-ui-table:not(.table) > tbody > tr:hover {
  background: var(--nowo-ui-table-hover-bg, color-mix(in srgb, var(--nowo-ui-surface-muted) 80%, transparent));
}

.nowo-ui-row-actions {
  display: flex;
  gap: var(--nowo-ui-row-actions-gap, 0.25rem);
  align-items: center;
  flex-wrap: wrap;
}

/* 2.33 (UI-4): icon-only row actions as squares of --nowo-ui-row-action-size when a host sets it (else as before) */
.nowo-ui-row-actions--icon .nowo-ui-action.nowo-ui-btn--sm {
  inline-size: var(--nowo-ui-row-action-size, auto);
  min-inline-size: var(--nowo-ui-row-action-size, auto);
  block-size: var(--nowo-ui-row-action-size, auto);
}

.nowo-ui-row-actions__form {
  display: inline;
  margin: 0;
}

.nowo-ui-row-actions--text .nowo-ui-action,
.nowo-ui-row-actions--icon-text .nowo-ui-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nowo-ui-action__label {
  white-space: nowrap;
}

.nowo-ui-action.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

.nowo-ui-flash {
  padding: 0.75rem 1rem;
  border-radius: var(--nowo-ui-radius);
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}

.nowo-ui-flash--success {
  background: var(--nowo-ui-success-bg);
  border-color: var(--nowo-ui-success-border);
  color: var(--nowo-ui-success-text);
}

.nowo-ui-flash--error {
  background: var(--nowo-ui-danger-bg);
  border-color: var(--nowo-ui-danger-border);
  color: var(--nowo-ui-danger-text-strong);
}

.nowo-ui-flash--warning {
  background: var(--nowo-ui-warning-bg);
  border-color: var(--nowo-ui-warning-border);
  color: var(--nowo-ui-warning-text);
}

.nowo-ui-flash--info {
  background: var(--nowo-ui-info-bg);
  border-color: var(--nowo-ui-info-border);
  color: var(--nowo-ui-info-text);
}

.nowo-ui-empty,
.nowo-ui-muted {
  color: var(--nowo-ui-muted);
}

.nowo-ui-badge {
  display: inline-flex;
  align-items: center;
  min-height: var(--nowo-ui-badge-min-height, auto);
  padding: var(--nowo-ui-badge-py, 0.1rem) var(--nowo-ui-badge-px, 0.45rem);
  border: 1px solid var(--nowo-ui-badge-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-badge-radius, 999px);
  font-size: var(--nowo-ui-badge-font-size, 0.75rem);
  font-weight: var(--nowo-ui-badge-font-weight);
  letter-spacing: var(--nowo-ui-badge-letter-spacing);
  margin-left: var(--nowo-ui-badge-offset, 0.35rem);
  background: var(--nowo-ui-badge-bg, var(--nowo-ui-surface-muted));
  color: var(--nowo-ui-badge-text, var(--nowo-ui-text));
}

/* Per-tone badge colours (2.11): --nowo-ui-badge-<tone>-bg / -border / -text, else the semantic palette */
.nowo-ui-badge--success {
  background: var(--nowo-ui-badge-success-bg, var(--nowo-ui-success-bg));
  border-color: var(--nowo-ui-badge-success-border, var(--nowo-ui-success-border));
  color: var(--nowo-ui-badge-success-text, var(--nowo-ui-success-text));
}

.nowo-ui-badge--warning {
  background: var(--nowo-ui-badge-warning-bg, var(--nowo-ui-warning-bg));
  border-color: var(--nowo-ui-badge-warning-border, var(--nowo-ui-warning-border));
  color: var(--nowo-ui-badge-warning-text, var(--nowo-ui-warning-text));
}

.nowo-ui-badge--danger,
.nowo-ui-badge--error {
  background: var(--nowo-ui-badge-danger-bg, var(--nowo-ui-danger-bg));
  border-color: var(--nowo-ui-badge-danger-border, var(--nowo-ui-danger-border));
  color: var(--nowo-ui-badge-danger-text, var(--nowo-ui-danger-text-strong));
}

.nowo-ui-badge--info,
.nowo-ui-badge--primary {
  background: var(--nowo-ui-badge-primary-bg, color-mix(in srgb, var(--nowo-ui-primary) 12%, var(--nowo-ui-surface)));
  border-color: var(--nowo-ui-badge-primary-border, color-mix(in srgb, var(--nowo-ui-primary) 35%, var(--nowo-ui-surface)));
  color: var(--nowo-ui-badge-primary-text, color-mix(in srgb, var(--nowo-ui-primary) 75%, var(--nowo-ui-text)));
}

.nowo-ui-badge--neutral {
  background: var(--nowo-ui-surface-muted);
  border-color: var(--nowo-ui-border);
  color: var(--nowo-ui-muted);
}

/* Bootstrap solid badges (text-bg-* / bg-* utilities paint the background with !important): the semantic
 * palette must not mix with them — no tinted border on a solid fill, and white text when a 1.x `bg-*` badge
 * carries no text utility (dark semantic text on a solid green / red background is unreadable). */
.nowo-ui-badge.badge:is(.text-bg-primary, .text-bg-secondary, .text-bg-success, .text-bg-danger, .text-bg-warning, .text-bg-info, .text-bg-dark, .bg-primary, .bg-secondary, .bg-success, .bg-danger, .bg-warning, .bg-info, .bg-dark) {
  border-color: transparent;
}

.nowo-ui-badge.badge:is(.bg-primary, .bg-secondary, .bg-success, .bg-danger, .bg-dark):not([class*="text-"]) {
  color: var(--bs-badge-color, white);
}

/* --- Modal overlay (custom/none stacks) ---
 * Scoped to .nowo-ui-modal-open so Bootstrap stacks (.modal.show) are never affected.
 * For bootstrap* css_framework the element has .modal and Bootstrap controls display.
 */
.nowo-ui-modal {
  /* Hidden by default; shown by nowoOpenModal() via .nowo-ui-modal-open (custom/none)
   * or by Bootstrap via .show (bootstrap* stacks). */
  display: none;
}

.nowo-ui-modal.nowo-ui-modal-open {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: var(--nowo-ui-z-modal, 1050);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--nowo-ui-overlay, rgba(0, 0, 0, 0.45));
  padding: 1.5rem;
  align-items: flex-start;
  justify-content: center;
}

.nowo-ui-modal.nowo-ui-modal-open .modal-dialog {
  width: 100%;
  max-width: 560px;
  margin: auto;
  pointer-events: none;
}

.nowo-ui-modal.nowo-ui-modal-open .modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-modal-radius, var(--nowo-ui-radius));
  box-shadow: var(--nowo-ui-shadow-dialog, 0 8px 32px rgba(0, 0, 0, 0.18));
  pointer-events: auto;
  outline: 0;
}

.nowo-ui-modal.nowo-ui-modal-open .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--nowo-ui-border);
}

.nowo-ui-modal.nowo-ui-modal-open .modal-title {
  margin: 0;
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--nowo-ui-text);
}

.nowo-ui-modal.nowo-ui-modal-open .modal-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.nowo-ui-modal.nowo-ui-modal-open .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--nowo-ui-border);
}

.nowo-ui-modal.nowo-ui-modal-open .btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--nowo-ui-radius);
  cursor: pointer;
  opacity: 0.55;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--nowo-ui-text);
}

.nowo-ui-modal.nowo-ui-modal-open .btn-close:hover {
  opacity: 1;
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-modal.nowo-ui-modal-open .btn-close:focus-visible {
  opacity: 1;
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-modal.nowo-ui-modal-open .btn-close::before {
  content: '\00D7';
}

body.nowo-modal-open {
  overflow: hidden;
}

/* 2.3: the vertical padding sits on the content region (slot `content`), not on <body>: no band above a host navbar.
   A non-body .nowo-ui-body wrapper (1.x markup) keeps it. Inside the 1.x shell (.nowo-ui-main pads itself) none. */
.nowo-ui-body:not(body) {
  padding: 1rem 0;
}

:where(.nowo-ui-content) {
  padding-block: var(--nowo-ui-content-padding-block, 1rem);
}

:where(.nowo-ui-main .nowo-ui-content) {
  padding-block: 0;
}

/* --- Pagination --- */
.nowo-ui-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.nowo-ui-pagination__info {
  margin: 0;
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

/* Per-page choices (2.4, `per_page_choices` / `per_page_selector` of the pagination partial) */
.nowo-ui-pagination__per-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

.nowo-ui-pagination__per-page-label {
  margin-inline-end: 0.25rem;
}

/* Code (slots code / code_block, 2.1): inline identifiers and <pre> payloads / JSON; the block scrolls. */
.nowo-ui-code,
.nowo-ui-code-block {
  font-family: var(--nowo-ui-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace);
  font-size: 0.875em;
  color: var(--nowo-ui-code-text, var(--nowo-ui-text));
  /* 2.3: Bootstrap's unlayered `code { color: var(--bs-code-color) }` (pink) reads this element-level value */
  --bs-code-color: var(--nowo-ui-code-text, var(--nowo-ui-text));
  /* Own tint (2.2): visible on the surface and on the page background, whatever the stack */
  background: var(--nowo-ui-code-bg, color-mix(in srgb, var(--nowo-ui-text) 7%, var(--nowo-ui-surface)));
}

.nowo-ui-code {
  padding: 0.1em 0.35em;
  box-shadow: inset 0 0 0 1px var(--nowo-ui-code-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-code-radius, var(--nowo-ui-radius));
  overflow-wrap: anywhere;
}

.nowo-ui-code-block {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  max-height: var(--nowo-ui-code-block-max-height, 32rem);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  overflow: auto;
  border: 1px solid var(--nowo-ui-code-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-code-radius, var(--nowo-ui-radius));
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}

.nowo-ui-code-block--wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nowo-ui-code-block > code {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  white-space: inherit;
}

.nowo-ui-pagination__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nowo-ui-pagination-gap, 0.25rem);
}

/* The partial's <ul class="pagination"> lays out as a row on every stack (zero specificity: Bootstrap wins). */
:where(.nowo-ui-pagination__nav) > :where(ul.pagination) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nowo-ui-pagination-gap, 0.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nowo-ui-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--nowo-ui-pagination-size, 2rem);
  min-height: var(--nowo-ui-pagination-size, auto);
  padding: var(--nowo-ui-pagination-py, 0.25rem) var(--nowo-ui-pagination-px, 0.5rem);
  border: 1px solid var(--nowo-ui-pagination-border, var(--nowo-ui-border-strong));
  border-radius: var(--nowo-ui-pagination-radius, var(--nowo-ui-radius));
  background: var(--nowo-ui-pagination-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-pagination-text, var(--nowo-ui-text));
  text-decoration: none;
  font-size: var(--nowo-ui-pagination-font-size, 0.875rem);
  font-weight: var(--nowo-ui-pagination-font-weight);
  line-height: var(--nowo-ui-pagination-line-height);
}

a.nowo-ui-pagination__link:hover {
  border-color: var(--nowo-ui-pagination-hover-border, var(--nowo-ui-pagination-border, var(--nowo-ui-border-strong)));
  background: var(--nowo-ui-pagination-hover-bg, var(--nowo-ui-surface-muted));
  color: var(--nowo-ui-pagination-hover-text, var(--nowo-ui-pagination-text, var(--nowo-ui-text)));
}

.nowo-ui-pagination__link:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-pagination__link.is-active {
  background: var(--nowo-ui-pagination-active-bg, var(--nowo-ui-primary));
  border-color: var(--nowo-ui-pagination-active-border, var(--nowo-ui-pagination-active-bg, var(--nowo-ui-primary)));
  color: var(--nowo-ui-pagination-active-text, var(--nowo-ui-primary-contrast));
  font-weight: var(--nowo-ui-pagination-active-weight, inherit);
}

.nowo-ui-pagination__link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.nowo-ui-pagination__ellipsis {
  padding: 0 0.35rem;
  color: var(--nowo-ui-muted);
}

/* The ellipsis item of the pagination list sits like a pill (same box as the links, no border / fill) (2.2) */
.nowo-ui-pagination__link.nowo-ui-pagination__ellipsis,
.nowo-ui-pagination__nav .page-link.nowo-ui-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  border-color: transparent;
  border-radius: var(--nowo-ui-pagination-radius, var(--nowo-ui-radius));
  background: transparent;
  color: var(--nowo-ui-muted);
  opacity: 1;
}

/* --- Tabs --- */
.nowo-ui-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nowo-ui-tabs-gap, 0.25rem);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--nowo-ui-tabs-border, var(--nowo-ui-border));
}

.nowo-ui-tabs__item {
  display: inline-flex;
  min-height: var(--nowo-ui-tab-min-height, auto);
  padding: var(--nowo-ui-tab-py, 0.5rem) var(--nowo-ui-tab-px, 0.75rem);
  font-size: var(--nowo-ui-tab-font-size);
  font-weight: var(--nowo-ui-tab-font-weight);
  color: var(--nowo-ui-tab-text, var(--nowo-ui-muted));
  background: var(--nowo-ui-tab-bg, transparent);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--nowo-ui-tab-radius, 0);
  margin-bottom: -1px;
}

.nowo-ui-tabs__item:not(.nowo-ui-tabs__item--active):not(.is-active):hover {
  color: var(--nowo-ui-tab-hover-text, var(--nowo-ui-text));
  background: var(--nowo-ui-tab-hover-bg, var(--nowo-ui-tab-bg, transparent));
}

.nowo-ui-tabs__item:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-tabs__item--active,
.nowo-ui-tabs__item.is-active {
  color: var(--nowo-ui-tab-active-text, var(--nowo-ui-text));
  background: var(--nowo-ui-tab-active-bg, var(--nowo-ui-tab-bg, transparent));
  border-bottom-color: var(--nowo-ui-tab-active-border, var(--nowo-ui-primary));
  font-weight: var(--nowo-ui-tab-active-weight, 600);
}

/* Tab icons (2.16): an item with `icon` renders an icon and a label; the host's tab style (`data-tab-style` on any
   ancestor, usually <html>) decides what shows — absent / text: the label only (as before 2.16), icon-text: both,
   icon: the icon, the label visually hidden (still the accessible name) except on the current tab, and shown as a
   tooltip from data-rail-label on hover / keyboard focus. Under 30rem, icon-text rows of five or more tabs behave like
   icon (one line instead of three). */
.nowo-ui-tabs__item:has(> .nowo-ui-tabs__icon) {
  position: relative;
  align-items: center;
  gap: 0.4rem;
}

.nowo-ui-tabs__icon {
  display: none;
  flex: none;
  line-height: 1;
}

.nowo-ui-tabs__icon :is(svg, i, .nowo-ui-icon) {
  width: 1.05em;
  height: 1.05em;
  font-size: 1.05em;
}

:is([data-tab-style='icon-text'], [data-tab-style='icon']) .nowo-ui-tabs__icon {
  display: inline-flex;
}

[data-tab-style='icon'] .nowo-ui-tabs__item:not(.nowo-ui-tabs__item--active, .is-active, [aria-current='page']) > .nowo-ui-tabs__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[data-tab-style='icon'] .nowo-ui-tabs__item[data-rail-label]:not(.nowo-ui-tabs__item--active, .is-active, [aria-current='page']):is(:hover, :focus-visible)::after {
  content: attr(data-rail-label);
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  z-index: 30;
  padding: 0.25rem 0.5rem;
  border-radius: var(--nowo-ui-radius, 0.375rem);
  background: var(--nowo-ui-tooltip-bg, var(--nowo-ui-text));
  color: var(--nowo-ui-tooltip-text, var(--nowo-ui-surface));
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

/* The first / last tab of a row anchor the tooltip to their outer edge (same specificity as the rule above, later). */
[data-tab-style='icon'] .nowo-ui-tabs__item[data-rail-label]:first-child:not(.nowo-ui-tabs__item--active, .is-active, [aria-current='page']):is(:hover, :focus-visible)::after {
  left: 0;
  transform: none;
}

[data-tab-style='icon'] .nowo-ui-tabs__item[data-rail-label]:last-child:not(:first-child, .nowo-ui-tabs__item--active, .is-active, [aria-current='page']):is(:hover, :focus-visible)::after {
  right: 0;
  left: auto;
  transform: none;
}

@media (max-width: 30rem) {
  [data-tab-style='icon-text'] .nowo-ui-tabs:has(> .nowo-ui-tabs__item:nth-child(5)) > .nowo-ui-tabs__item:has(> .nowo-ui-tabs__icon):not(.nowo-ui-tabs__item--active, .is-active, [aria-current='page']) > .nowo-ui-tabs__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Pill tabs (2.11, `tabs` slot class nowo-ui-tabs--pill): a bordered pill per tab instead of the underline */
.nowo-ui-tabs--pill {
  align-items: stretch;
  border-bottom: 0;
}

.nowo-ui-tabs--pill > .nowo-ui-tabs__item {
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  border: var(--nowo-ui-border-width, 1px) solid transparent;
  border-radius: var(--nowo-ui-tab-radius, var(--nowo-ui-radius));
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nowo-ui-tabs--pill > :is(.nowo-ui-tabs__item--active, .nowo-ui-tabs__item.is-active, .nowo-ui-tabs__item[aria-current='page']) {
  border-color: var(--nowo-ui-tab-active-border, var(--nowo-ui-primary));
  font-weight: var(--nowo-ui-tab-active-weight, var(--nowo-ui-tab-font-weight, 600));
}

.nowo-ui-page-header__title {
  margin: 0;
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 1.5rem;
  font-weight: var(--nowo-ui-heading-weight, 700);
  color: var(--nowo-ui-text);
}

.nowo-ui-page-header__intro {
  margin: 0.25rem 0 0;
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- App shell / aside / header / footer --- */
@property --nowo-ui-aside-width {
  syntax: '<length>';
  inherits: true;
  initial-value: 15.5rem;
}

:root {
  --nowo-ui-aside-width: 15.5rem;
  --nowo-ui-aside-rail-width: 3.75rem;
  --nowo-ui-aside-duration: 0.36s;
  --nowo-ui-aside-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nowo-ui-header-height: 3.25rem;
  --nowo-ui-content-max-width: 72rem;
  /* 2.48: comfortable line length of reading content (.nowo-ui-readable) */
  --nowo-ui-reading-width: 75ch;
}

.nowo-ui-shell {
  --nowo-ui-aside-width: 15.5rem;
  display: grid;
  grid-template-columns: var(--nowo-ui-aside-width) minmax(0, 1fr);
  grid-template-rows: var(--nowo-ui-header-height) 1fr auto;
  grid-template-areas:
    "header header"
    "aside main"
    "footer footer";
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--nowo-ui-surface-muted);
  color: var(--nowo-ui-text);
  font-family: var(--nowo-ui-font-family, inherit);
  transition: grid-template-columns var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease);
}

.nowo-ui-shell.is-aside-collapsed {
  --nowo-ui-aside-width: 0px;
}

.nowo-ui-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--nowo-ui-border);
  background: var(--nowo-ui-surface);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nowo-ui-header__start,
.nowo-ui-header__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nowo-ui-main {
  grid-area: main;
  min-width: 0;
  padding: 1.25rem 1.25rem 2rem;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
  transition:
    max-width var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease),
    margin var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease),
    padding var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease);
}

.nowo-ui-shell.is-main-content .nowo-ui-main {
  max-width: var(--nowo-ui-content-max-width);
  margin-inline: auto;
}

.nowo-ui-aside {
  grid-area: aside;
  border-right: 1px solid var(--nowo-ui-border);
  background: var(--nowo-ui-surface);
  overflow: hidden;
  will-change: transform, width;
  transition:
    width var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease),
    transform var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease),
    box-shadow var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease),
    border-color var(--nowo-ui-aside-duration) ease;
}

.nowo-ui-shell.is-aside-collapsed .nowo-ui-aside {
  border-right-color: transparent;
}

.nowo-ui-aside__inner {
  width: 15.5rem;
  height: 100%;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 1;
  transition: opacity calc(var(--nowo-ui-aside-duration) * 0.75) var(--nowo-ui-aside-ease);
}

.nowo-ui-shell.is-aside-collapsed .nowo-ui-aside__inner {
  opacity: 0;
  pointer-events: none;
}

.nowo-ui-aside__label {
  margin: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nowo-ui-muted);
}

.nowo-ui-aside__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nowo-ui-aside__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--nowo-ui-radius);
  color: var(--nowo-ui-text);
  text-decoration: none;
  font-size: 0.875rem;
}

.nowo-ui-aside__link:hover {
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-aside__link.is-current,
.nowo-ui-aside__link--active {
  background: var(--nowo-ui-nav-active-bg, color-mix(in srgb, var(--nowo-ui-primary) 12%, transparent));
  color: var(--nowo-ui-nav-active-text, var(--nowo-ui-primary));
  font-weight: 600;
}

.nowo-ui-aside__link:focus-visible,
.nowo-ui-aside__group-toggle:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 1px;
}

.nowo-ui-aside-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--nowo-ui-overlay, rgba(15, 23, 42, 0.35));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease),
    visibility var(--nowo-ui-aside-duration) var(--nowo-ui-aside-ease);
}

.nowo-ui-shell.is-aside-open-mobile .nowo-ui-aside-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2.17.3: never narrower than a 32px tap target — in a crowded phone header the flex row shrank it to its glyph. */
.nowo-ui-burger {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
}

.nowo-ui-burger__icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

/* Avatar */
.nowo-ui-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nowo-ui-primary) 18%, var(--nowo-ui-surface));
  /* 2.26: initials darkened toward the text colour (AA: 4.18:1 → about 6:1 on the default theme). */
  color: color-mix(in srgb, var(--nowo-ui-primary) 70%, var(--nowo-ui-text));
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--nowo-ui-border);
}

.nowo-ui-avatar--xs {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.55rem;
}

.nowo-ui-avatar--sm {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.65rem;
}

.nowo-ui-avatar--lg {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.95rem;
}

.nowo-ui-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 2.26: the picture sits over the initials, which hide only once it has loaded (js/nowo-ui-avatar.js adds
   is-loaded; on error it removes the picture). Without the script a broken picture leaves the initials visible. */
.nowo-ui-avatar__image {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.nowo-ui-avatar.is-loaded {
  color: transparent;
}

.nowo-ui-avatar.is-loaded .nowo-ui-avatar__image {
  background: var(--nowo-ui-surface);
}

/* User dropdown */
.nowo-ui-user-menu {
  position: relative;
}

.nowo-ui-user-menu__details > summary {
  list-style: none;
  cursor: pointer;
}

.nowo-ui-user-menu__details > summary::-webkit-details-marker {
  display: none;
}

.nowo-ui-user-menu__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  padding: 0.15rem;
  border-radius: 999px;
}

.nowo-ui-user-menu__summary:hover,
.nowo-ui-user-menu__summary:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 14rem;
  padding: 0.5rem;
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  box-shadow: var(--nowo-ui-shadow-popover, 0 10px 28px rgba(15, 23, 42, 0.12));
  z-index: 50;
}

.nowo-ui-user-menu__identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--nowo-ui-border);
  margin-bottom: 0.35rem;
}

.nowo-ui-user-menu__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.nowo-ui-user-menu__email {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--nowo-ui-muted);
  word-break: break-all;
}

.nowo-ui-user-menu__link {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--nowo-ui-radius) - 1px);
  color: var(--nowo-ui-text);
  text-decoration: none;
  font-size: 0.875rem;
}

.nowo-ui-user-menu__link:hover {
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-user-menu__link.is-current {
  font-weight: 600;
  color: var(--nowo-ui-primary);
}

.nowo-ui-user-menu__footer {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--nowo-ui-border);
}

.nowo-ui-user-menu__link--danger {
  color: var(--nowo-ui-danger-text);
}

/* Footer */
.nowo-ui-footer {
  grid-area: footer;
  border-top: 1px solid var(--nowo-ui-border);
  background: var(--nowo-ui-surface);
  padding: 0.85rem 1.25rem;
}

.nowo-ui-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nowo-ui-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.nowo-ui-footer__nav a {
  color: var(--nowo-ui-muted);
  text-decoration: none;
  font-size: 0.8125rem;
}

.nowo-ui-footer__nav a:hover {
  color: var(--nowo-ui-text);
  text-decoration: underline;
}

.nowo-ui-footer__meta {
  margin: 0;
  color: var(--nowo-ui-muted);
  font-size: 0.8125rem;
}

@media (max-width: 900px) {
  .nowo-ui-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
    transition: none;
  }

  .nowo-ui-aside {
    position: fixed;
    top: var(--nowo-ui-header-height);
    left: 0;
    bottom: 0;
    width: min(15.5rem, 86vw);
    z-index: 45;
    transform: translate3d(-105%, 0, 0);
    border-right: 1px solid var(--nowo-ui-border);
    box-shadow: none;
  }

  .nowo-ui-shell.is-aside-open-mobile .nowo-ui-aside {
    transform: translate3d(0, 0, 0);
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.18);
  }

  .nowo-ui-shell.is-aside-collapsed {
    --nowo-ui-aside-width: 0px;
  }

  .nowo-ui-shell.is-aside-collapsed .nowo-ui-aside__inner {
    opacity: 1;
    pointer-events: auto;
  }
}

/* --- Sidebar rail (opt-in, 1.15) ---
 * `data-nowo-ui-sidebar-rail` on the shell + `nowo-ui-shell.js`: icons-only rail on desktop. Labels are
 * hidden; `data-nowo-ui-rail-label` (set by the script) shows them as a tooltip, links without an icon
 * show `data-nowo-ui-rail-initial`. Width: `--nowo-ui-aside-rail-width`.
 */
@media (min-width: 901px) {
  .nowo-ui-shell.is-aside-rail {
    --nowo-ui-aside-width: var(--nowo-ui-aside-rail-width);
  }

  .nowo-ui-shell.is-aside-rail .nowo-ui-aside {
    overflow: visible;
  }

  .nowo-ui-shell.is-aside-rail .nowo-ui-aside__inner {
    width: var(--nowo-ui-aside-rail-width);
    padding-inline: 0.375rem;
  }

  .nowo-ui-shell.is-aside-rail .nowo-ui-aside__label,
  .nowo-ui-shell.is-aside-rail .nowo-ui-aside__chevron {
    display: none !important;
  }

  .nowo-ui-shell.is-aside-rail :is(.nowo-ui-aside__link, .nowo-ui-aside__group-toggle) {
    position: relative;
    justify-content: center;
    font-size: 0;
  }

  .nowo-ui-shell.is-aside-rail :is(.nowo-ui-aside__link, .nowo-ui-aside__group-toggle) :is(svg, img, i, .nowo-ui-icon) {
    font-size: 1rem;
  }

  .nowo-ui-shell.is-aside-rail [data-nowo-ui-rail-initial]::before {
    content: attr(data-nowo-ui-rail-initial);
    font-size: 0.875rem;
    font-weight: 600;
  }

  .nowo-ui-shell.is-aside-rail [data-nowo-ui-rail-label]::after {
    content: attr(data-nowo-ui-rail-label);
    position: absolute;
    top: 50%;
    left: calc(100% + 0.5rem);
    z-index: 60;
    padding: 0.25rem 0.5rem;
    border-radius: var(--nowo-ui-radius);
    background: var(--nowo-ui-text);
    color: var(--nowo-ui-surface);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-0.25rem, -50%);
    transition: opacity 0.12s ease, transform 0.12s ease;
  }

  .nowo-ui-shell.is-aside-rail [data-nowo-ui-rail-label]:is(:hover, :focus-visible)::after {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* --- Nested aside groups --- */
.nowo-ui-aside__group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nowo-ui-aside__group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: var(--nowo-ui-radius);
  background: transparent;
  color: var(--nowo-ui-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.nowo-ui-aside__group-toggle:hover {
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-aside__chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.nowo-ui-aside__group.is-open .nowo-ui-aside__chevron {
  transform: rotate(45deg);
}

.nowo-ui-aside__group-panel {
  display: none !important;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 0.5rem;
}

.nowo-ui-aside__group.is-open .nowo-ui-aside__group-panel {
  display: flex !important;
}

/* --- Hover-expanded rail (opt-in, 2.32) ---
 * `data-nowo-ui-sidebar-hover-expand` on a rail shell + `nowo-ui-shell.js`: while the pointer or the keyboard focus is on
 * the icons-only rail, `is-aside-peek` widens the panel over the page (the grid column keeps the rail width, so nothing
 * moves) and shows the labels; leaving it goes back to icons. Width: `--nowo-ui-aside-peek-width` (default 15.5rem).
 */
@media (min-width: 901px) {
  .nowo-ui-shell.is-aside-rail.is-aside-peek .nowo-ui-aside {
    position: relative;
    overflow: hidden;
    overflow: clip;
    z-index: 45;
    justify-self: start;
    width: var(--nowo-ui-aside-peek-width, 15.5rem);
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.18);
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek .nowo-ui-aside__inner {
    box-sizing: border-box;
    width: var(--nowo-ui-aside-peek-width, 15.5rem);
    padding-inline: 0.75rem;
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek .nowo-ui-aside__label {
    display: block !important;
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek .nowo-ui-aside__chevron {
    display: inline-block !important;
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek :is(.nowo-ui-aside__link, .nowo-ui-aside__group-toggle) {
    font-size: 0.875rem;
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek .nowo-ui-aside__link {
    justify-content: flex-start;
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek .nowo-ui-aside__group-toggle {
    justify-content: space-between;
  }

  .nowo-ui-shell.is-aside-rail.is-aside-peek [data-nowo-ui-rail-initial]::before,
  .nowo-ui-shell.is-aside-rail.is-aside-peek [data-nowo-ui-rail-label]::after {
    content: none;
  }
}

/* --- Full-height sidebar layout (opt-in, 2.32) ---
 * `nowo_ui_kit.shell.sidebar_layout: full-height` (or the `sidebar_layout` option / the `_nowo_ui_sidebar_layout`
 * request attribute): `data-nowo-ui-sidebar-layout="full-height"` on the shell. Desktop only (901px and up): the aside
 * runs from the top edge to the bottom, the header and the footer start at its right edge (grid areas, so they follow
 * its slide / rail width), and the aside head carries the burger (centred on the nav icons' column) and the brand —
 * expanded: icon and name on the burger's row; icons-only rail: the icon under the burger, the name visually hidden
 * (still the link's name); hover-expanded rail: the panel goes over the header with its own burger, the icon stays and
 * the name shows. While the aside shows, the header's own burger and brand are hidden; a hidden aside gives them back.
 * Phones keep the off-canvas aside with the burger and the brand in the header. A host's fixed footer follows the aside
 * with `inset-inline-start: var(--nowo-ui-shell-inset-start)` (0 except in this layout on desktop).
 */
.nowo-ui-shell {
  --nowo-ui-shell-inset-start: 0px;
}

.nowo-ui-aside-head {
  display: none;
}

.nowo-ui-aside-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--nowo-ui-text);
  font-weight: 600;
  text-decoration: none;
}

.nowo-ui-aside-brand__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--nowo-ui-aside-brand-icon-size, 1.75rem);
  height: var(--nowo-ui-aside-brand-icon-size, 1.75rem);
  overflow: hidden;
}

.nowo-ui-aside-brand__icon > :is(img, svg) {
  max-width: 100%;
  max-height: 100%;
}

.nowo-ui-aside-brand__icon--initial {
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-primary);
  color: var(--nowo-ui-primary-contrast);
  font-size: 0.875rem;
  line-height: 1;
}

.nowo-ui-aside-brand__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2.40 (spec 220 S1): appearance logos. The lockup replaces the name; its <img> pair shows the one of the current
   [data-theme] (no script; !important so an unlayered host `img { display: … }` cannot show both). */
.nowo-ui-brand__logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: var(--nowo-ui-brand-logo-height, 1.75rem);
  object-fit: contain;
}

[data-theme='dark'] [data-nowo-ui-theme-only='light'],
:root:not([data-theme='dark']) [data-nowo-ui-theme-only='dark'] {
  display: none !important;
}

.nowo-ui-aside-brand__logo {
  display: inline-flex;
  align-items: center;
}

/* The mark (or initial) of a logo brand is for the icons-only rail only. */
.nowo-ui-aside-brand__icon--rail {
  display: none;
}

.nowo-ui-brand-region {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem;
}

.nowo-ui-brand-region .nowo-ui-brand__logo {
  height: var(--nowo-ui-brand-region-logo-height, 2.5rem);
}

@media (min-width: 901px) {
  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'] {
    --nowo-ui-shell-inset-start: var(--nowo-ui-aside-width);
    grid-template-areas:
      "aside header"
      "aside main"
      "aside footer";
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'] > .nowo-ui-aside {
    overflow: hidden;
    overflow: clip;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail > .nowo-ui-aside {
    overflow: visible;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail.is-aside-peek > .nowo-ui-aside {
    overflow: hidden;
    overflow: clip;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'] > .nowo-ui-aside > .nowo-ui-aside__inner {
    height: auto;
  }

  /* The header's burger and brand only while the aside is hidden; its end keeps the right edge. */
  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height']:not(.is-aside-collapsed) > .nowo-ui-header > .nowo-ui-header__start {
    display: none;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'] > .nowo-ui-header > .nowo-ui-header__end {
    margin-inline-start: auto;
  }

  /* Expanded: one row the height of the header — the burger (centred on the rail's icon column), then the brand. */
  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'] .nowo-ui-aside-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: var(--nowo-ui-header-height);
    align-items: center;
    column-gap: 0.65rem;
    box-sizing: border-box;
    width: var(--nowo-ui-aside-peek-width, 15.5rem);
    padding-inline: calc((var(--nowo-ui-aside-rail-width) - 2.25rem) / 2) 0.75rem;
    background: var(--nowo-ui-surface);
    transition: opacity calc(var(--nowo-ui-aside-duration) * 0.75) var(--nowo-ui-aside-ease);
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-collapsed .nowo-ui-aside-head {
    visibility: hidden;
    opacity: 0;
  }

  /* Icons-only rail (and its hover-expanded panel): the burger's row, then the icon under it on the same column. */
  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail .nowo-ui-aside-head {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--nowo-ui-header-height) auto;
    width: 100%;
    padding-bottom: 0.5rem;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail .nowo-ui-aside-head > .nowo-ui-burger {
    justify-self: start;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail .nowo-ui-aside-head > .nowo-ui-aside-brand {
    justify-self: start;
    padding-inline-start: calc((2.25rem - var(--nowo-ui-aside-brand-icon-size, 1.75rem)) / 2);
  }

  /* A host brand without the name class (aside_brand_html / brand_html) is cut to the icon column. */
  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail:not(.is-aside-peek) .nowo-ui-aside-head > .nowo-ui-aside-brand {
    max-width: 2.25rem;
    overflow: hidden;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail:not(.is-aside-peek) .nowo-ui-aside-head .nowo-ui-aside-brand__name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail:not(.is-aside-peek) .nowo-ui-aside-head .nowo-ui-aside-brand__icon--rail {
    display: inline-flex;
  }

  .nowo-ui-shell[data-nowo-ui-sidebar-layout='full-height'].is-aside-rail.is-aside-peek .nowo-ui-aside-head {
    width: var(--nowo-ui-aside-peek-width, 15.5rem);
  }
}

/* --- Toasts --- */
.nowo-ui-toast-stack {
  position: fixed;
  z-index: var(--nowo-ui-z-toast, 1100);
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.nowo-ui-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  pointer-events: auto;
  box-shadow: var(--nowo-ui-shadow-toast, 0 10px 28px rgba(15, 23, 42, 0.14));
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nowo-ui-toast.is-leaving {
  opacity: 0;
  transform: translateY(0.35rem);
}

.nowo-ui-toast__content {
  flex: 1 1 auto;
  min-width: 0;
}

.nowo-ui-toast__title {
  margin: 0 0 0.15rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.nowo-ui-toast__message {
  margin: 0;
  font-size: 0.875rem;
}

.nowo-ui-toast__dismiss {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 0.15rem;
}

.nowo-ui-toast__dismiss:hover {
  opacity: 1;
}

/*
 * --- Dialog sizes (2.29, owner rule "two sizes only"; 2.31 dialog rule v2: the height follows the content) ---
 * Every kit dialog has one of two sizes, set by public tokens a host overrides once on :root (no :root value is
 * declared here, so a host value wins whatever the load order; other kits read the same tokens with the same
 * fallbacks): medium (default: forms, choosers, steps) and wide (tables, two-column forms, guides, the remote form
 * dialog). The width belongs to the size. 2.31: the height is the content's, capped at min(the size's height token,
 * 100dvh - 2rem) (--nowo-ui-dialog-max-h): the body scrolls inside, the header and the footer stay.
 *   --nowo-dialog-width-md   min(40rem, 100vw - 2rem)    --nowo-dialog-height-md   min(36rem, 100dvh - 2rem)
 *   --nowo-dialog-width-wide min(56rem, 100vw - 2rem)    --nowo-dialog-height-wide min(52rem, 100dvh - 2rem)
 * --nowo-ui-dialog-w / --nowo-ui-dialog-h are the resolved size of one dialog (internal; a modifier sets them).
 * --nowo-ui-dialog-fill (2.31, no :root value; `theme.dialog.height: size` prints 1 on :root): 1 gives every dialog
 * with a field, list, table or fold the size's height again (the 2.29 / 2.30 rule), 0 / unset = the content's height.
 * Legacy size modifiers map onto the two sizes: sm / md → medium, lg / xl → wide.
 */
.nowo-ui-dialog,
.nowo-ui-confirm-dialog,
.nowo-ui-confirm {
  --nowo-ui-dialog-w: var(--nowo-dialog-width-md, min(40rem, 100vw - 2rem));
  --nowo-ui-dialog-h: var(--nowo-dialog-height-md, min(36rem, 100dvh - 2rem));
  --nowo-ui-dialog-max-h: min(var(--nowo-ui-dialog-h), 100dvh - 2rem);
}

.nowo-ui-dialog--lg,
.nowo-ui-dialog--xl,
.nowo-ui-dialog--wide,
.nowo-ui-confirm-dialog--lg,
.nowo-ui-confirm-dialog--xl,
.nowo-ui-confirm-dialog--wide {
  --nowo-ui-dialog-w: var(--nowo-dialog-width-wide, min(56rem, 100vw - 2rem));
  --nowo-ui-dialog-h: var(--nowo-dialog-height-wide, min(52rem, 100dvh - 2rem));
}

/* --- Confirm dialog --- */
.nowo-ui-confirm {
  /* Centred whatever the host reset does to <dialog> (Tailwind preflight sets margin: 0); a fixed width (2.2) so a
     long message wraps instead of widening the dialog off-centre. 2.29: the medium width for every size (sm / md /
     lg); a yes / no confirmation keeps its natural height. --nowo-ui-confirm-width still wins when a host sets it. */
  box-sizing: border-box;
  width: var(--nowo-ui-confirm-width, var(--nowo-ui-dialog-w));
  margin: auto;
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
}

.nowo-ui-confirm::backdrop {
  background: var(--nowo-ui-overlay, rgba(15, 23, 42, 0.45));
}

.nowo-ui-confirm__panel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-modal-radius, var(--nowo-ui-radius));
  box-shadow: var(--nowo-ui-shadow-dialog, 0 16px 40px rgba(15, 23, 42, 0.2));
  overflow: hidden;
}

.nowo-ui-confirm__header {
  padding: 1rem 1.25rem 0.5rem;
}

/*
 * 2.31 (dialog rule v2): the confirm <dialog> (partial `confirm`, View\Confirm row / page actions; the release and row
 * detail dialogs; askConfirm()) has the dialog anatomy with its own classes: a tinted header (title, ×) with a divider,
 * the body (message; type-to-confirm right under it) that alone scrolls, a tinted footer outside the body (Cancel, then
 * the one primary). Medium width; the content's height capped at --nowo-ui-dialog-max-h. The full-page confirm
 * (page/confirm) keeps its own layout.
 */
.nowo-ui-confirm > .nowo-ui-confirm__panel {
  display: flex;
  flex-direction: column;
  max-height: var(--nowo-ui-dialog-max-h);
}

.nowo-ui-confirm > .nowo-ui-confirm__panel > :is(.nowo-ui-confirm__header, .nowo-ui-confirm__expect, .nowo-ui-confirm__footer) {
  flex: none;
}

.nowo-ui-confirm > .nowo-ui-confirm__panel > .nowo-ui-confirm__header {
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--nowo-ui-border);
  background: var(--nowo-ui-dialog-chrome-bg, color-mix(in srgb, var(--nowo-ui-text) 4%, var(--nowo-ui-surface)));
}

.nowo-ui-confirm > .nowo-ui-confirm__panel > .nowo-ui-confirm__body {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 1rem;
  overflow: auto;
}

/* Type-to-confirm without a body (message in the header): the body's top padding */
.nowo-ui-confirm > .nowo-ui-confirm__panel > .nowo-ui-confirm__header + .nowo-ui-confirm__expect {
  padding-top: 1rem;
}

.nowo-ui-confirm > .nowo-ui-confirm__panel > .nowo-ui-confirm__footer {
  background: var(--nowo-ui-dialog-chrome-bg, color-mix(in srgb, var(--nowo-ui-text) 4%, var(--nowo-ui-surface)));
}

.nowo-ui-confirm__title {
  margin: 0;
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 1.1rem;
  font-weight: 600;
}

.nowo-ui-confirm__body {
  padding: 0.5rem 1.25rem 1rem;
  font-size: 0.925rem;
  /* Body text in the text colour (2.2): the muted token is for secondary text and can fall under 4.5:1 */
  color: var(--nowo-ui-confirm-text, var(--nowo-ui-text));
  overflow-wrap: anywhere;
}

/* The dialog body pads the message (the full-page confirm keeps the paragraph margin before the expect input) */
.nowo-ui-confirm .nowo-ui-confirm__message {
  margin: 0;
}

/* Close button of a 2.0 confirm (2.2, slot confirm_close): top-right of the panel, the header keeps room for it */
.nowo-ui-confirm__header:has(> .nowo-ui-confirm__close) {
  padding-inline-end: 3rem;
}

.nowo-ui-confirm__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

/* Generic native dialog (partial `dialog`, 2.1): framework-free, the <dialog> is the panel. 2.29: the dialog width
   (medium by default; lg / xl / wide = wide), header and footer fixed, the body scrolls; 2.31: the content's height,
   capped. */
.nowo-ui-dialog {
  box-sizing: border-box;
  width: var(--nowo-ui-dialog-w);
  max-width: calc(100vw - 2rem);
  max-height: var(--nowo-ui-dialog-max-h);
  margin: auto;
  padding: 0;
  overflow: auto;
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-modal-radius, var(--nowo-ui-radius));
  box-shadow: var(--nowo-ui-shadow-dialog, 0 16px 40px rgba(15, 23, 42, 0.2));
}

.nowo-ui-dialog:not([open]) {
  display: none !important;
}

.nowo-ui-dialog::backdrop {
  background: var(--nowo-ui-overlay, rgba(15, 23, 42, 0.45));
}

/* Centred dialogs (not the side panels): a flex column; header and footer never scroll. 2.31 (dialog rule v2): the
   content's height, capped at min(the size's height, 100dvh - 2rem); fit-content as the UA <dialog> (auto would stretch
   a modal dialog between its insets up to max-height). With --nowo-ui-dialog-fill: 1 (`theme.dialog.height: size`) the
   min-height gives the size's height back (2.29 / 2.30). */
.nowo-ui-dialog[open]:not(.nowo-ui-dialog--end):not(.nowo-ui-dialog--start),
.nowo-ui-confirm-dialog--anatomy[open] {
  display: flex;
  flex-direction: column;
  height: fit-content;
  min-height: calc(var(--nowo-ui-dialog-max-h) * clamp(0, var(--nowo-ui-dialog-fill, 0), 1));
  overflow: hidden;
}

/* A plain yes / no confirmation (no field, list, table or fold) always keeps its natural height (capped by the size) */
.nowo-ui-dialog[open]:not(.nowo-ui-dialog--end):not(.nowo-ui-dialog--start):not(.nowo-ui-dialog--remote-form):not(:has(input:not([type='hidden']), select, textarea, table, ul, ol, details)),
.nowo-ui-confirm-dialog--anatomy[open]:not(:has(input:not([type='hidden']), select, textarea, table, ul, ol, details)) {
  min-height: 0;
}

:is(.nowo-ui-dialog, .nowo-ui-confirm-dialog--anatomy) > :is(.nowo-ui-dialog__header, .nowo-ui-dialog__footer) {
  flex: none;
}

:is(.nowo-ui-dialog, .nowo-ui-confirm-dialog--anatomy) > .nowo-ui-dialog__body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

/* 2.31 (dialog rule v2): tinted header (with a divider) and footer around the body, the TaskBoard "Create board"
   anatomy; --nowo-ui-dialog-chrome-bg (no :root value) sets the tint, the confirm dialog reads it too. */
:is(.nowo-ui-dialog, .nowo-ui-confirm-dialog--anatomy) > .nowo-ui-dialog__header {
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--nowo-ui-border);
  background: var(--nowo-ui-dialog-chrome-bg, color-mix(in srgb, var(--nowo-ui-text) 4%, var(--nowo-ui-surface)));
}

:is(.nowo-ui-dialog, .nowo-ui-confirm-dialog--anatomy) > .nowo-ui-dialog__header + .nowo-ui-dialog__body {
  padding-top: 1rem;
}

:is(.nowo-ui-dialog, .nowo-ui-confirm-dialog--anatomy) > .nowo-ui-dialog__footer {
  background: var(--nowo-ui-dialog-chrome-bg, color-mix(in srgb, var(--nowo-ui-text) 4%, var(--nowo-ui-surface)));
}

/* Side panel (dialog placement end / start, 2.12): full height, stuck to that edge, slides in; the size sets the width */
.nowo-ui-dialog--end,
.nowo-ui-dialog--start {
  width: min(32rem, 100vw);
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
  border-block: 0;
  transition: transform 0.2s ease, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
}

.nowo-ui-dialog--end {
  margin-inline-start: auto;
  border-inline-end: 0;
  transform: translateX(100%);
}

.nowo-ui-dialog--start {
  margin-inline-end: auto;
  border-inline-start: 0;
  transform: translateX(-100%);
}

.nowo-ui-dialog--end[open],
.nowo-ui-dialog--start[open] {
  display: flex;
  flex-direction: column;
  transform: none;
}

@starting-style {
  .nowo-ui-dialog--end[open] {
    transform: translateX(100%);
  }

  .nowo-ui-dialog--start[open] {
    transform: translateX(-100%);
  }
}

.nowo-ui-dialog--end.nowo-ui-dialog--sm,
.nowo-ui-dialog--start.nowo-ui-dialog--sm {
  width: min(22rem, 100vw);
}

.nowo-ui-dialog--end.nowo-ui-dialog--lg,
.nowo-ui-dialog--start.nowo-ui-dialog--lg {
  width: min(48rem, 100vw);
}

.nowo-ui-dialog--end.nowo-ui-dialog--xl,
.nowo-ui-dialog--start.nowo-ui-dialog--xl {
  width: min(64rem, 100vw);
}

.nowo-ui-dialog--end > .nowo-ui-dialog__body,
.nowo-ui-dialog--start > .nowo-ui-dialog__body {
  flex: 1;
  overflow: auto;
}

@media (prefers-reduced-motion: reduce) {
  .nowo-ui-dialog--end,
  .nowo-ui-dialog--start {
    transition: none;
  }
}

.nowo-ui-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.5rem;
}

.nowo-ui-dialog__title {
  margin: 0;
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Back arrow before the title (2.34, `back_href` of the dialog partial): the title takes the width, the × stays at the end */
.nowo-ui-dialog__back {
  flex: none;
  margin: -0.25rem 0 0 -0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--nowo-ui-radius);
  color: var(--nowo-ui-muted);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
}

.nowo-ui-dialog__back:dir(rtl) {
  margin: -0.25rem -0.5rem 0 0;
}

.nowo-ui-dialog__back:dir(rtl) > span {
  display: inline-block;
  transform: scaleX(-1);
}

.nowo-ui-dialog__back:hover {
  color: var(--nowo-ui-text);
}

.nowo-ui-dialog__back:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-dialog__back + * {
  flex: 1 1 auto;
  min-width: 0;
}

/* Title + inline status badge (2.29, `status` of the dialog / confirm_dialog partials) */
.nowo-ui-dialog__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.nowo-ui-dialog__close,
.nowo-ui-confirm__close {
  flex: none;
  margin: -0.25rem -0.5rem 0 0;
  padding: 0.125rem 0.5rem;
  border: 0;
  border-radius: var(--nowo-ui-radius);
  background: transparent;
  color: var(--nowo-ui-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.nowo-ui-dialog__close:hover,
.nowo-ui-confirm__close:hover {
  color: var(--nowo-ui-text);
}

.nowo-ui-dialog__close:focus-visible,
.nowo-ui-confirm__close:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-dialog__body {
  padding: 0.5rem 1.25rem 1rem;
}

/* Muted body text (dialog body_muted / slot dialog_body_muted; also usable on a confirm_body), no framework CSS */
.nowo-ui-dialog__body--muted,
.nowo-ui-confirm__body--muted {
  color: var(--nowo-ui-muted);
  font-size: 0.925rem;
}

.nowo-ui-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--nowo-ui-border);
}

/* The empty footer of the remote form dialog until a fragment hands it its actions (2.29) */
.nowo-ui-dialog__footer[hidden] {
  display: none !important;
}

/* Message under the title (Confirm::messageInHeader / theme.confirm_message_in_header) */
:is(.nowo-ui-confirm__header, .nowo-ui-confirm-page__header) > .nowo-ui-confirm__message {
  margin: 0.25rem 0 0;
  font-size: 0.925rem;
  color: var(--nowo-ui-confirm-text, var(--nowo-ui-text));
}

/* Type-to-confirm (2.0, View\Confirm::expectedValue) */
.nowo-ui-confirm__expect {
  display: grid;
  gap: 0.375rem;
  padding: 0 1.25rem 1rem;
  font-size: 0.925rem;
}

.nowo-ui-confirm-page .nowo-ui-confirm__expect {
  padding-inline: 0;
}

.nowo-ui-confirm__expect-input {
  box-sizing: border-box; /* 2.31: 100% includes its padding and border (it overflowed the dialog's right padding) */
  width: 100%;
  max-width: none;
}

.nowo-ui-confirm__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--nowo-ui-border);
}

/* --- Release version (optional release_check) --- */
.nowo-ui-release {
  display: inline-block;
}

.nowo-ui-release__trigger {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-size: 0.85em;
  color: var(--nowo-ui-muted);
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.nowo-ui-release__trigger:hover,
.nowo-ui-release__trigger:focus-visible {
  color: var(--nowo-ui-text);
}

.nowo-ui-release__body > * + * {
  margin-top: 0.5rem;
}

.nowo-ui-release__installed,
.nowo-ui-release__summary {
  margin: 0;
  color: var(--nowo-ui-text);
}

.nowo-ui-release__summary {
  font-weight: 600;
}

.nowo-ui-release__muted {
  margin: 0;
  font-size: 0.85em;
  color: var(--nowo-ui-muted);
}

/* --- Page loader --- */
.nowo-ui-page-loader {
  position: fixed;
  inset: 0;
  z-index: var(--nowo-ui-z-loader, 1200);
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--nowo-ui-surface) 82%, transparent);
  backdrop-filter: blur(2px);
}

.nowo-ui-page-loader.is-active {
  display: flex;
}

.nowo-ui-page-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.nowo-ui-page-loader__label {
  margin: 0;
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

/* Leave fade (page-loader Stimulus peer adds .is-leaving, then [hidden] once the overlay's opacity ends). */
.nowo-ui-page-loader.is-leaving {
  opacity: 0;
  transition: opacity 0.45s ease;
}

/*
 * Minimal visuals (bar, bar_loop, bar_spinner, corner_spinner, dots, glow, corner_mark): no veil, never
 * block the page, fade in after a short delay so fast loads show nothing. Children only use keyframes.
 * Tune with --nowo-ui-page-loader-color / --nowo-ui-page-loader-corner-bottom / --nowo-ui-page-loader-corner-left.
 */
.nowo-ui-page-loader--minimal {
  --nowo-ui-page-loader-color: var(--nowo-ui-primary);
  --nowo-ui-page-loader-corner-bottom: 1rem;
  --nowo-ui-page-loader-corner-left: 1rem;

  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}

.nowo-ui-page-loader--minimal.is-active {
  display: block;
}

.nowo-ui-page-loader--minimal.is-leaving {
  transition: opacity 0.3s ease-out 0.22s;
}

.nowo-ui-page-loader--corner_spinner.is-leaving,
.nowo-ui-page-loader--bar_loop.is-leaving,
.nowo-ui-page-loader--dots.is-leaving,
.nowo-ui-page-loader--glow.is-leaving,
.nowo-ui-page-loader--corner_mark.is-leaving {
  transition: opacity 0.3s ease-out;
}

.nowo-ui-page-loader__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nowo-ui-page-loader__bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  opacity: 0;
}

.nowo-ui-page-loader__bar-fill,
.nowo-ui-page-loader__bar::after {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--nowo-ui-page-loader-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--nowo-ui-page-loader-color) 55%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
}

.nowo-ui-page-loader__bar::after {
  content: "";
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__bar {
  animation: nowo-ui-loader-appear 0.25s ease-out 0.12s both;
}

/* Trickle towards 90 %; the leave sweep then runs it to the end. */
.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__bar-fill {
  animation: nowo-ui-loader-trickle 9s cubic-bezier(0.08, 0.6, 0.2, 1) 0.12s both;
}

.nowo-ui-page-loader--minimal.is-leaving .nowo-ui-page-loader__bar:not(.nowo-ui-page-loader__bar--loop)::after {
  animation: nowo-ui-loader-complete 0.24s ease-out both;
}

.nowo-ui-page-loader__bar--loop .nowo-ui-page-loader__bar-fill {
  width: 35%;
  transform: none;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__bar--loop .nowo-ui-page-loader__bar-fill {
  animation: nowo-ui-loader-loop 1.3s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.nowo-ui-page-loader__spinner,
.nowo-ui-page-loader__dots,
.nowo-ui-page-loader__mark {
  position: fixed;
  bottom: var(--nowo-ui-page-loader-corner-bottom);
  left: var(--nowo-ui-page-loader-corner-left);
  opacity: 0;
}

.nowo-ui-page-loader__spinner {
  box-sizing: border-box;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid color-mix(in srgb, var(--nowo-ui-page-loader-color) 22%, transparent);
  border-top-color: var(--nowo-ui-page-loader-color);
  border-radius: 50%;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__spinner {
  animation:
    nowo-ui-loader-appear 0.3s ease-out 0.15s both,
    nowo-ui-loader-spin 0.75s linear infinite;
}

.nowo-ui-page-loader__dots {
  display: flex;
  gap: 0.3rem;
}

.nowo-ui-page-loader__dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--nowo-ui-page-loader-color);
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__dots {
  animation: nowo-ui-loader-appear 0.3s ease-out 0.15s both;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__dots span {
  animation: nowo-ui-loader-dot 1s ease-in-out infinite;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.nowo-ui-page-loader__mark {
  display: block;
  width: auto;
  height: 1.75rem;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__mark {
  animation:
    nowo-ui-loader-appear 0.35s ease-out 0.15s both,
    nowo-ui-loader-breathe 1.8s ease-in-out 0.5s infinite;
}

.nowo-ui-page-loader__glow {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 4.5rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--nowo-ui-page-loader-color) 32%, transparent), transparent);
  opacity: 0;
}

.nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__glow {
  animation: nowo-ui-loader-glow 1.6s ease-in-out 0.12s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .nowo-ui-page-loader.is-leaving,
  .nowo-ui-page-loader--minimal.is-leaving {
    transition: none;
  }

  .nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__bar-fill {
    animation: none;
    transform: scaleX(0.6);
  }

  .nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__bar--loop .nowo-ui-page-loader__bar-fill,
  .nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__dots span {
    animation: none;
  }

  .nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__spinner,
  .nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__mark,
  .nowo-ui-page-loader--minimal.is-active .nowo-ui-page-loader__glow {
    animation: nowo-ui-loader-appear 0.3s ease-out 0.15s both;
  }
}

@keyframes nowo-ui-loader-appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes nowo-ui-loader-trickle {
  0% {
    transform: scaleX(0);
  }

  10% {
    transform: scaleX(0.3);
  }

  35% {
    transform: scaleX(0.6);
  }

  100% {
    transform: scaleX(0.9);
  }
}

@keyframes nowo-ui-loader-complete {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes nowo-ui-loader-loop {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(290%);
  }
}

@keyframes nowo-ui-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nowo-ui-loader-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes nowo-ui-loader-breathe {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.75;
  }
}

@keyframes nowo-ui-loader-glow {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

/* --- Thinking orb (canvas) --- */
.nowo-ui-orb {
  --nowo-ui-orb-size: 64px;
  display: block;
  width: var(--nowo-ui-orb-size);
  height: var(--nowo-ui-orb-size);
  flex-shrink: 0;
}

.nowo-ui-orb--20 {
  --nowo-ui-orb-size: 20px;
}

.nowo-ui-orb--64 {
  --nowo-ui-orb-size: 64px;
}

.nowo-ui-page-loader__inner .nowo-ui-orb {
  margin-bottom: 0.15rem;
}

.nowo-ui-orb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: center;
}

.nowo-ui-orb-row__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 4.5rem;
}

.nowo-ui-orb-row__caption {
  margin: 0;
  font-size: 0.75rem;
  color: var(--nowo-ui-muted);
}

/* --- Card / panel --- */
.nowo-ui-card {
  background: var(--nowo-ui-card-bg, var(--nowo-ui-surface));
  border: 1px solid var(--nowo-ui-card-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-card-radius, var(--nowo-ui-radius));
  margin-bottom: 1rem;
  overflow: hidden;
}

.nowo-ui-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--nowo-ui-border);
}

.nowo-ui-card__title {
  margin: 0;
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 1.05rem;
  font-weight: 600;
}

.nowo-ui-card__intro {
  margin: 0.25rem 0 0;
  /* Muted pulled 15% towards the text colour so the 0.875rem intro keeps WCAG AA (4.5:1) on Bootstrap's
     `.card-header` cap (rgba(33, 37, 41, 0.03) over the card), where plain muted measured 4.48:1 (default palette:
     5.50:1 light, 7.37:1 dark). Follows host muted / text remaps and dark mode. */
  color: var(--nowo-ui-card-intro-text, color-mix(in srgb, var(--nowo-ui-muted) 85%, var(--nowo-ui-text)));
  font-size: 0.875rem;
}

.nowo-ui-card__body {
  padding: 1rem;
}

.nowo-ui-card__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--nowo-ui-border);
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* --- Filters --- */
.nowo-ui-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nowo-ui-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

/* List-scaffold filters (2.2): fields on a regular responsive grid, the actions bottom-aligned with the inputs
   right after the last field (no empty gap); FilterField::width spans columns (lg = 2, full = the whole row).
   Tokens: --nowo-ui-filters-field-min (12rem), --nowo-ui-filters-gap; 2.30: --nowo-ui-filters-grid-columns (the
   whole track list, theme.pages.list.filters.grid; default auto-fit: a lone filter stretches across the card). */
form.nowo-ui-filters[data-nowo-ui-region] {
  display: grid;
  grid-template-columns: var(--nowo-ui-filters-grid-columns, repeat(auto-fit, minmax(min(100%, var(--nowo-ui-filters-field-min, 12rem)), 1fr)));
  align-items: end;
  gap: var(--nowo-ui-filters-gap, 0.75rem 1rem);
}

/* 2.30 grid modes (theme.pages.list.filters.grid / ListPage::filtersGrid): auto-fill keeps empty tracks, so a lone
   filter keeps one track's width; auto-fit restores the default over a host track list. */
form.nowo-ui-filters[data-nowo-ui-region].nowo-ui-filters--grid-auto-fill {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--nowo-ui-filters-field-min, 12rem)), 1fr));
}

form.nowo-ui-filters[data-nowo-ui-region].nowo-ui-filters--grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--nowo-ui-filters-field-min, 12rem)), 1fr));
}

form.nowo-ui-filters[data-nowo-ui-region] > .nowo-ui-filters__field {
  min-width: 0;
  margin: 0;
}

/* 2.15.4: the Bootstrap `mb-3` of the form_row / form_row_check slots (and of bootstrap_5_layout rows) does not space
   grid fields: the grid gap does. `!important` beats the Bootstrap utility (layered or not). */
form.nowo-ui-filters[data-nowo-ui-region] > .nowo-ui-filters__field.mb-3 {
  margin-bottom: 0 !important;
}

form.nowo-ui-filters[data-nowo-ui-region] > .nowo-ui-filters__field :is(input, select, textarea):not([type='checkbox'], [type='radio']) {
  width: 100%;
  max-width: none;
}

form.nowo-ui-filters[data-nowo-ui-region] > .nowo-ui-filters__actions {
  grid-column: span var(--nowo-ui-filters-actions-span, 1);
  align-self: end;
  justify-content: flex-start;
  margin-left: 0;
}

form.nowo-ui-filters[data-nowo-ui-region] > :is(.nowo-ui-filters__field--xs, .nowo-ui-filters__field--sm, .nowo-ui-filters__field--md) {
  grid-column: span 1;
}

/* Two-column spans only where two columns surely fit (an implicit column would overflow a narrow form) */
@media (min-width: 48rem) {
  form.nowo-ui-filters[data-nowo-ui-region]:has(.nowo-ui-filters__header-actions) > .nowo-ui-filters__actions {
    --nowo-ui-filters-actions-span: 2;
  }

  form.nowo-ui-filters[data-nowo-ui-region] > .nowo-ui-filters__field--lg {
    grid-column: span 2;
  }
}

form.nowo-ui-filters[data-nowo-ui-region] > .nowo-ui-filters__field--full {
  grid-column: 1 / -1;
}

/* --- Filter bar (opt-in, 1.12) ---
 * One control height for every single-line field and button in the bar in every engine (an explicit
 * height, not only min-height: WebKit gives native selects a taller intrinsic box, Firefox a shorter
 * one). Actions sit on the bottom edge of the field row; `__actions--pager` keeps
 * "N per page" + Filter + Clear in one unbreakable group. Compact: `--compact` modifier or
 * `[data-ui-density="compact"]` on an ancestor. Nothing here applies without `.nowo-ui-filter-bar`.
 */
.nowo-ui-filter-bar {
  --nowo-ui-filter-control-height: var(--nowo-ui-control-height, 2.375rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.nowo-ui-filter-bar--compact,
[data-ui-density='compact'] .nowo-ui-filter-bar {
  --nowo-ui-filter-control-height: var(--nowo-ui-control-height-compact, 2.125rem);
}

.nowo-ui-filter-bar > * {
  margin: 0;
  min-width: 0;
}

.nowo-ui-filter-bar__field {
  display: flex;
  flex: 1 1 10rem;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.nowo-ui-filter-bar__field--search {
  flex-basis: 14rem;
}

.nowo-ui-filter-bar input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='range']):not([type='file']):not([type='hidden']),
.nowo-ui-filter-bar select:not([multiple]):not([size]),
.nowo-ui-filter-bar .nowo-ui-filter-bar__submit,
.nowo-ui-filter-bar .nowo-ui-filter-bar__clear {
  box-sizing: border-box;
  height: var(--nowo-ui-filter-control-height);
  min-height: var(--nowo-ui-filter-control-height);
}

/* iOS WebKit (2.22): a native date input keeps its intrinsic width and ignores `width: 100%`, overflowing narrow filter
   and form fields. Dropping the native appearance and the intrinsic min-width lets it fill its field. Scoped to iOS
   (`-webkit-touch-callout`) and to the kit's form / filter containers; no markup change. */
@supports (-webkit-touch-callout: none) {
  :is(.nowo-ui-filters, .nowo-ui-filter-bar, form.nowo-ui-form, .nowo-ui-dialog__body form) input[type='date'] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
  }
}

.nowo-ui-filter-bar--compact input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='range']):not([type='file']):not([type='hidden']),
.nowo-ui-filter-bar--compact select:not([multiple]):not([size]),
[data-ui-density='compact'] .nowo-ui-filter-bar input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='range']):not([type='file']):not([type='hidden']),
[data-ui-density='compact'] .nowo-ui-filter-bar select:not([multiple]):not([size]) {
  padding-block: 0.3rem;
  font-size: 0.8125rem;
  line-height: 1.25;
}

/* Native multi-select (2.14): the no-JS / not-yet-enhanced fallback of the `multi-select` peer stays a short
   scrollable list (about four options) instead of the browser's tall default; enhanced, the peer's skin
   (nowo-ui-multi-select.css) takes over. */
.nowo-ui-filter-bar select[multiple]:not(.ts-hidden-accessible),
form.nowo-ui-filters select[multiple]:not(.ts-hidden-accessible) {
  box-sizing: border-box;
  min-height: var(--nowo-ui-filter-control-height, var(--nowo-ui-control-height, 2.375rem));
  max-height: 6.5rem;
}

/* Date-range field (2.15, DateRangeType + `date-range` peer).
   Without JavaScript: two labelled native date inputs side by side, wrapping under each other in a narrow cell.
   Enhanced (`.is-enhanced`): one control as tall as the other inputs (trigger button + clear button) and a range
   calendar in a popover (top layer, positioned by the peer; inline under the field without the Popover API). Colours
   are the kit tokens, so light / dark follow the theme. Tokens: --nowo-ui-date-range-z, --nowo-ui-date-range-shadow,
   --nowo-ui-date-range-day-size, --nowo-ui-date-range-range-bg. */
.nowo-ui-date-range {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.nowo-ui-date-range__parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.nowo-ui-date-range__part {
  display: flex;
  flex: 1 1 9rem;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
}

.nowo-ui-date-range__short {
  flex: none;
  color: var(--nowo-ui-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.nowo-ui-date-range__part input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.nowo-ui-date-range.is-enhanced > .nowo-ui-date-range__parts {
  display: none;
}

.nowo-ui-date-range__trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: var(--nowo-ui-filter-control-height, var(--nowo-ui-control-height, 2.375rem));
  padding-inline-end: 2.1rem;
  overflow: hidden;
  text-align: start;
  cursor: pointer;
}

.nowo-ui-filter-bar .nowo-ui-date-range__trigger {
  height: var(--nowo-ui-filter-control-height);
}

.nowo-ui-date-range__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nowo-ui-date-range.is-empty .nowo-ui-date-range__value {
  color: var(--nowo-ui-input-placeholder, var(--nowo-ui-muted));
}

.nowo-ui-date-range__icon,
.nowo-ui-date-range__clear {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  transform: translateY(-50%);
  color: var(--nowo-ui-muted);
}

.nowo-ui-date-range__icon {
  pointer-events: none;
}

.nowo-ui-date-range__clear {
  padding: 0;
  border: 0;
  border-radius: var(--nowo-ui-radius, 0.375rem);
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.nowo-ui-date-range__clear:hover {
  color: var(--nowo-ui-text);
  background: color-mix(in srgb, var(--nowo-ui-text) 8%, transparent);
}

.nowo-ui-date-range__clear:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 1px;
}

.nowo-ui-date-range:not(.is-empty) .nowo-ui-date-range__icon,
.nowo-ui-date-range.is-empty .nowo-ui-date-range__clear {
  display: none;
}

.nowo-ui-date-range__panel {
  --nowo-ui-date-range-day-size: 2.25rem;
  position: fixed;
  inset: auto;
  z-index: var(--nowo-ui-date-range-z, var(--nowo-ui-z-popover, 1080));
  box-sizing: border-box;
  max-width: calc(100vw - 1rem);
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  box-shadow: var(--nowo-ui-date-range-shadow, var(--nowo-ui-shadow-popover, 0 10px 28px rgba(15, 23, 42, 0.12)));
}

/* Without the Popover API the panel opens inline, under the field. */
.nowo-ui-date-range__panel:not([popover]) {
  position: absolute;
  top: calc(100% + 0.25rem);
  inset-inline-start: 0;
}

.nowo-ui-date-range__panel[hidden] {
  display: none !important;
}

.nowo-ui-date-range__panel .nowo-ui-date-range__parts {
  margin-top: 0.75rem;
}

.nowo-ui-date-range__panel calendar-range {
  display: block;
  inline-size: auto;
}

.nowo-ui-date-range__panel calendar-range::part(container) {
  gap: 0.5rem;
}

.nowo-ui-date-range__panel calendar-range::part(heading) {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
}

.nowo-ui-date-range__panel calendar-range::part(button) {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: var(--nowo-ui-radius, 0.375rem);
  background: transparent;
  color: var(--nowo-ui-text);
  cursor: pointer;
}

.nowo-ui-date-range__panel calendar-range::part(button):hover {
  background: color-mix(in srgb, var(--nowo-ui-text) 8%, transparent);
}

.nowo-ui-date-range__months {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.nowo-ui-date-range__panel calendar-month {
  --color-accent: var(--nowo-ui-primary);
  --color-text-on-accent: var(--nowo-ui-primary-contrast);
  color: var(--nowo-ui-text);
}

.nowo-ui-date-range__panel calendar-month::part(th) {
  inline-size: var(--nowo-ui-date-range-day-size);
  block-size: 1.75rem;
  color: var(--nowo-ui-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.nowo-ui-date-range__panel calendar-month::part(day) {
  inline-size: var(--nowo-ui-date-range-day-size);
  block-size: var(--nowo-ui-date-range-day-size);
  border-radius: var(--nowo-ui-radius, 0.375rem);
  cursor: pointer;
}

.nowo-ui-date-range__panel calendar-month::part(today) {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.nowo-ui-date-range__panel calendar-month::part(range-inner) {
  border-radius: 0;
  background: var(--nowo-ui-date-range-range-bg, color-mix(in srgb, var(--nowo-ui-primary) 18%, var(--nowo-ui-surface)));
  color: var(--nowo-ui-text);
}

.nowo-ui-date-range__panel calendar-month::part(range-start) {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.nowo-ui-date-range__panel calendar-month::part(range-end) {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.nowo-ui-date-range__panel calendar-month::part(range-start range-end) {
  border-radius: var(--nowo-ui-radius, 0.375rem);
}

.nowo-ui-date-range__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nowo-ui-date-range__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

@media (max-width: 30rem) {
  .nowo-ui-date-range__panel {
    --nowo-ui-date-range-day-size: 2.1rem;
    padding: 0.6rem;
  }
}

/* Per-field help stays for assistive tech only (aria-describedby); the placeholder names the filter. */
.nowo-ui-filter-bar__help {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nowo-ui-filter-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: flex-end;
  gap: 0.5rem;
  min-height: var(--nowo-ui-filter-control-height, 2.375rem);
}

.nowo-ui-filter-bar__submit,
.nowo-ui-filter-bar__clear {
  justify-content: center;
  white-space: nowrap;
}

/* Icon actions (1.15): `submit_icon` / `clear_icon`, square with `icon_only`. */
.nowo-ui-filter-bar__submit,
.nowo-ui-filter-bar__clear {
  gap: 0.375rem;
}

.nowo-ui-filter-bar__action--icon-only {
  aspect-ratio: 1;
  padding-inline: 0;
  min-width: var(--nowo-ui-filter-control-height, 2.375rem);
}

.nowo-ui-filter-bar__actions--pager {
  flex-wrap: nowrap;
  align-items: flex-end;
}

.nowo-ui-filter-bar__actions--pager .nowo-ui-filter-bar__pager {
  flex: 1 1 8rem;
  min-width: 8.25rem;
  margin: 0;
}

.nowo-ui-filter-bar__actions--pager .nowo-ui-filter-bar__submit,
.nowo-ui-filter-bar__actions--pager .nowo-ui-filter-bar__clear {
  flex: 0 0 auto;
  width: auto;
}

/* --- Data table (opt-in, 1.12) ---
 * One header / cell contract for list tables: `table.nowo-ui-data-table` (alone or next to
 * `.nowo-ui-table` / `.table`). Doubled class + child combinators outrank framework table remaps.
 * Compact: `--compact` modifier or `[data-ui-density="compact"]` on an ancestor.
 */
.nowo-ui-data-table {
  --nowo-ui-table-head-py: 0.625rem;
  --nowo-ui-table-cell-py: 0.625rem;
  --nowo-ui-table-cell-px: 0.75rem;
  --nowo-ui-table-font-size: 0.875rem;
  --nowo-ui-table-head-font-size: 0.75rem;
}

.nowo-ui-data-table--compact,
[data-ui-density='compact'] .nowo-ui-data-table {
  --nowo-ui-table-head-py: 0.45rem;
  --nowo-ui-table-cell-py: 0.45rem;
  --nowo-ui-table-cell-px: 0.625rem;
  --nowo-ui-table-font-size: 0.8125rem;
}

table.nowo-ui-data-table.nowo-ui-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nowo-ui-table-font-size);
  text-align: left;
}

table.nowo-ui-data-table.nowo-ui-data-table > thead > tr > th {
  padding: var(--nowo-ui-table-head-py) var(--nowo-ui-table-cell-px);
  border-bottom: 1px solid var(--nowo-ui-table-border, var(--nowo-ui-border));
  background: var(--nowo-ui-table-head-bg, transparent);
  color: var(--nowo-ui-table-head-text, var(--nowo-ui-muted));
  font-size: var(--nowo-ui-table-head-font-size);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: bottom;
}

table.nowo-ui-data-table.nowo-ui-data-table > tbody > tr > td,
table.nowo-ui-data-table.nowo-ui-data-table > tbody > tr > th {
  padding: var(--nowo-ui-table-cell-py) var(--nowo-ui-table-cell-px);
  border-bottom: 1px solid color-mix(in srgb, var(--nowo-ui-table-border, var(--nowo-ui-border)) 70%, transparent);
  font-size: var(--nowo-ui-table-font-size);
  line-height: 1.4;
  vertical-align: middle;
}

table.nowo-ui-data-table.nowo-ui-data-table > tbody > tr:last-child > td,
table.nowo-ui-data-table.nowo-ui-data-table > tbody > tr:last-child > th {
  border-bottom: 0;
}

table.nowo-ui-data-table.nowo-ui-data-table > tbody > tr:hover > td {
  background: var(--nowo-ui-table-hover-bg, color-mix(in srgb, var(--nowo-ui-surface-muted) 80%, transparent));
}

/* --- Brand --- */
.nowo-ui-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.nowo-ui-brand__mark {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.nowo-ui-brand--sm .nowo-ui-brand__mark {
  width: 1.35rem;
  height: 1.35rem;
}

.nowo-ui-brand--lg .nowo-ui-brand__mark {
  width: 2.25rem;
  height: 2.25rem;
}

.nowo-ui-brand__text {
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 0.95rem;
}

/* --- Theme toggle --- */
.nowo-ui-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--nowo-ui-border-strong);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
}

.nowo-ui-theme-toggle:focus-visible,
.nowo-ui-width-toggle:focus-visible,
.nowo-ui-locale-switcher__summary:focus-visible,
.nowo-ui-kebab__summary:focus-visible,
.nowo-ui-toast__dismiss:focus-visible,
.nowo-ui-release__trigger:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-theme-toggle--compact {
  padding: 0.35rem;
}

.nowo-ui-theme-toggle__icon--moon {
  display: none !important;
}

[data-theme="dark"] .nowo-ui-theme-toggle__icon--sun {
  display: none !important;
}

[data-theme="dark"] .nowo-ui-theme-toggle__icon--moon {
  display: block !important;
}

/* --- Main width toggle (full / content) --- */
.nowo-ui-width-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--nowo-ui-border-strong);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
}

.nowo-ui-width-toggle--compact {
  padding: 0.35rem;
}

.nowo-ui-width-toggle__icon--content {
  display: none !important;
}

.nowo-ui-shell.is-main-content .nowo-ui-width-toggle__icon--full {
  display: none !important;
}

.nowo-ui-shell.is-main-content .nowo-ui-width-toggle__icon--content {
  display: block !important;
}

/* --- Locale switcher --- */
.nowo-ui-locale-switcher {
  position: relative;
}

.nowo-ui-locale-switcher__details > summary {
  list-style: none;
  cursor: pointer;
}

.nowo-ui-locale-switcher__details > summary::-webkit-details-marker {
  display: none;
}

.nowo-ui-locale-switcher__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--nowo-ui-border-strong);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  font-size: 0.8125rem;
}

.nowo-ui-locale-switcher__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 10rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  box-shadow: var(--nowo-ui-shadow-popover, 0 10px 28px rgba(15, 23, 42, 0.12));
  z-index: 50;
}

.nowo-ui-locale-switcher__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: calc(var(--nowo-ui-radius) - 1px);
  background: transparent;
  color: var(--nowo-ui-text);
  text-decoration: none;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
}

.nowo-ui-locale-switcher__option:hover,
.nowo-ui-locale-switcher__option.is-active {
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-locale-switcher__code {
  font-weight: 700;
  font-size: 0.75rem;
}

.nowo-ui-locale-switcher__chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.nowo-ui-locale-switcher__form {
  margin: 0;
}

/* --- Kebab / overflow --- */
.nowo-ui-kebab {
  position: relative;
  display: inline-flex;
}

.nowo-ui-kebab__details > summary {
  list-style: none;
  cursor: pointer;
}

.nowo-ui-kebab__details > summary::-webkit-details-marker {
  display: none;
}

.nowo-ui-kebab__summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--nowo-ui-border-strong);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
}

.nowo-ui-kebab__dots {
  font-size: 1.1rem;
  line-height: 1;
}

.nowo-ui-kebab__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  min-width: 10rem;
  padding: 0.35rem;
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  box-shadow: var(--nowo-ui-shadow-popover, 0 10px 28px rgba(15, 23, 42, 0.12));
  z-index: 50;
}

.nowo-ui-kebab__item {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: calc(var(--nowo-ui-radius) - 1px);
  color: var(--nowo-ui-text);
  text-decoration: none;
  font-size: 0.875rem;
}

.nowo-ui-kebab__item:hover,
.nowo-ui-kebab__item.is-current {
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-kebab__item--danger {
  color: var(--nowo-ui-danger-text);
}

/* <button> items (a POST action in a <form> inside the menu) keep the item look: Tailwind preflight (layer `base`)
   and the UA stylesheet set `font` / `font-size` on buttons; this rule re-applies the item size after `font: inherit`
   and, in nowo-ui.css, wins from the `nowo-ui` layer above `base` (2.5.3). */
button.nowo-ui-kebab__item {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  line-height: inherit;
  text-align: start;
  cursor: pointer;
}

button.nowo-ui-kebab__item:hover,
button.nowo-ui-kebab__item.is-current {
  background: var(--nowo-ui-surface-muted);
}

/* --- Progress / spinner --- */
.nowo-ui-progress {
  display: block;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--nowo-ui-progress-track, var(--nowo-ui-surface-muted));
  border: 1px solid var(--nowo-ui-border);
}

.nowo-ui-progress__bar {
  display: block;
  height: 100%;
  background: var(--nowo-ui-progress-bar, var(--nowo-ui-primary));
  transition: width 0.2s ease;
}

.nowo-ui-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--nowo-ui-border-strong);
  border-top-color: var(--nowo-ui-primary);
  border-radius: 999px;
  animation: nowo-ui-spin 0.7s linear infinite;
  vertical-align: middle;
}

.nowo-ui-spinner--sm {
  width: 0.9rem;
  height: 0.9rem;
}

.nowo-ui-spinner--lg {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 3px;
}

@keyframes nowo-ui-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Bootstrap token bridge (opt-in, 1.13) ---
 * Bootstrap stacks keep Bootstrap's own variant classes (btn-primary, alert-*, badge bg-*, text-muted,
 * table, list-group, pagination, nav-tabs) and therefore Bootstrap's palette by default. Add the class
 * `nowo-ui-bs-tokens` to an ancestor (e.g. <body> or the panel root) to paint those Bootstrap 5.3
 * components from the same --nowo-ui-* tokens. Nothing here applies without that class.
 */
.nowo-ui-bs-tokens {
  --bs-body-color: var(--nowo-ui-text);
  --bs-body-bg: var(--nowo-ui-surface);
  --bs-border-color: var(--nowo-ui-border);
  --bs-secondary-color: var(--nowo-ui-muted);
  --bs-tertiary-bg: var(--nowo-ui-surface-muted);
  --bs-border-radius: var(--nowo-ui-radius);
  --bs-focus-ring-color: var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
}

.nowo-ui-bs-tokens .text-muted {
  color: var(--nowo-ui-muted) !important;
}

.nowo-ui-bs-tokens a:not([class]),
.nowo-ui-bs-tokens .nowo-ui-link {
  color: var(--nowo-ui-link, var(--nowo-ui-primary));
}

.nowo-ui-bs-tokens .btn {
  --bs-btn-border-radius: var(--nowo-ui-btn-radius, var(--nowo-ui-radius));
  --bs-btn-focus-box-shadow: var(--nowo-ui-focus-ring, 0 0 0 0.2rem var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent)));
}

.nowo-ui-bs-tokens .btn-primary {
  --bs-btn-color: var(--nowo-ui-btn-primary-text, var(--nowo-ui-primary-contrast));
  --bs-btn-bg: var(--nowo-ui-btn-primary-bg, var(--nowo-ui-primary));
  --bs-btn-border-color: var(--nowo-ui-btn-primary-border, var(--nowo-ui-btn-primary-bg, var(--nowo-ui-primary)));
  --bs-btn-hover-color: var(--nowo-ui-btn-primary-text, var(--nowo-ui-primary-contrast));
  --bs-btn-hover-bg: var(--nowo-ui-btn-primary-hover-bg, var(--nowo-ui-primary-hover, color-mix(in srgb, var(--nowo-ui-primary) 85%, white)));
  --bs-btn-hover-border-color: var(--nowo-ui-btn-primary-hover-bg, var(--nowo-ui-primary-hover, color-mix(in srgb, var(--nowo-ui-primary) 85%, white)));
  --bs-btn-active-color: var(--nowo-ui-btn-primary-text, var(--nowo-ui-primary-contrast));
  --bs-btn-active-bg: var(--nowo-ui-btn-primary-hover-bg, var(--nowo-ui-primary-hover, color-mix(in srgb, var(--nowo-ui-primary) 85%, white)));
  --bs-btn-active-border-color: var(--nowo-ui-btn-primary-hover-bg, var(--nowo-ui-primary-hover, color-mix(in srgb, var(--nowo-ui-primary) 85%, white)));
  --bs-btn-disabled-color: var(--nowo-ui-btn-primary-text, var(--nowo-ui-primary-contrast));
  --bs-btn-disabled-bg: var(--nowo-ui-btn-primary-bg, var(--nowo-ui-primary));
  --bs-btn-disabled-border-color: var(--nowo-ui-btn-primary-bg, var(--nowo-ui-primary));
}

.nowo-ui-bs-tokens .btn-secondary,
.nowo-ui-bs-tokens .btn-outline-secondary {
  --bs-btn-color: var(--nowo-ui-btn-text, var(--nowo-ui-text));
  --bs-btn-bg: var(--nowo-ui-btn-bg, var(--nowo-ui-surface));
  --bs-btn-border-color: var(--nowo-ui-btn-border, var(--nowo-ui-border-strong));
  --bs-btn-hover-color: var(--nowo-ui-btn-hover-text, var(--nowo-ui-btn-text, var(--nowo-ui-text)));
  --bs-btn-hover-bg: var(--nowo-ui-btn-hover-bg, var(--nowo-ui-surface-muted));
  --bs-btn-hover-border-color: var(--nowo-ui-btn-hover-border, var(--nowo-ui-btn-border, var(--nowo-ui-border-strong)));
  --bs-btn-active-color: var(--nowo-ui-btn-hover-text, var(--nowo-ui-btn-text, var(--nowo-ui-text)));
  --bs-btn-active-bg: var(--nowo-ui-btn-hover-bg, var(--nowo-ui-surface-muted));
  --bs-btn-active-border-color: var(--nowo-ui-btn-hover-border, var(--nowo-ui-btn-border, var(--nowo-ui-border-strong)));
  --bs-btn-disabled-color: var(--nowo-ui-muted);
  --bs-btn-disabled-bg: var(--nowo-ui-btn-bg, var(--nowo-ui-surface));
  --bs-btn-disabled-border-color: var(--nowo-ui-btn-border, var(--nowo-ui-border-strong));
}

.nowo-ui-bs-tokens .btn-outline-primary {
  --bs-btn-color: var(--nowo-ui-btn-outline-text, var(--nowo-ui-primary));
  --bs-btn-bg: var(--nowo-ui-btn-outline-bg, transparent);
  --bs-btn-border-color: var(--nowo-ui-btn-outline-border, var(--nowo-ui-primary));
  --bs-btn-hover-color: var(--nowo-ui-btn-outline-text, var(--nowo-ui-primary));
  --bs-btn-hover-bg: var(--nowo-ui-btn-outline-hover-bg, color-mix(in srgb, var(--nowo-ui-primary) 10%, var(--nowo-ui-surface)));
  --bs-btn-hover-border-color: var(--nowo-ui-btn-outline-border, var(--nowo-ui-primary));
  --bs-btn-active-color: var(--nowo-ui-btn-outline-text, var(--nowo-ui-primary));
  --bs-btn-active-bg: var(--nowo-ui-btn-outline-hover-bg, color-mix(in srgb, var(--nowo-ui-primary) 10%, var(--nowo-ui-surface)));
  --bs-btn-active-border-color: var(--nowo-ui-btn-outline-border, var(--nowo-ui-primary));
}

.nowo-ui-bs-tokens .btn-outline-danger {
  --bs-btn-color: var(--nowo-ui-btn-danger-text, var(--nowo-ui-danger-text));
  --bs-btn-bg: var(--nowo-ui-btn-danger-bg, var(--nowo-ui-surface));
  --bs-btn-border-color: var(--nowo-ui-btn-danger-border, var(--nowo-ui-danger));
  --bs-btn-hover-color: var(--nowo-ui-btn-danger-text, var(--nowo-ui-danger-text));
  --bs-btn-hover-bg: var(--nowo-ui-btn-danger-hover-bg, var(--nowo-ui-danger-bg));
  --bs-btn-hover-border-color: var(--nowo-ui-btn-danger-border, var(--nowo-ui-danger));
  --bs-btn-active-color: var(--nowo-ui-btn-danger-text, var(--nowo-ui-danger-text));
  --bs-btn-active-bg: var(--nowo-ui-btn-danger-hover-bg, var(--nowo-ui-danger-bg));
  --bs-btn-active-border-color: var(--nowo-ui-btn-danger-border, var(--nowo-ui-danger));
}

.nowo-ui-bs-tokens .btn-link {
  --bs-btn-color: var(--nowo-ui-link, var(--nowo-ui-primary));
  --bs-btn-hover-color: var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary)));
  --bs-btn-active-color: var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary)));
}

.nowo-ui-bs-tokens .form-control,
.nowo-ui-bs-tokens .form-select {
  border-color: var(--nowo-ui-input-border, var(--nowo-ui-border-strong));
  border-radius: var(--nowo-ui-input-radius, var(--nowo-ui-radius));
  background-color: var(--nowo-ui-input-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-input-text, var(--nowo-ui-text));
}

.nowo-ui-bs-tokens .form-control::placeholder {
  color: var(--nowo-ui-input-placeholder, var(--nowo-ui-muted));
}

.nowo-ui-bs-tokens .form-control:focus,
.nowo-ui-bs-tokens .form-select:focus,
.nowo-ui-bs-tokens .form-check-input:focus {
  border-color: var(--nowo-ui-input-focus-border, var(--nowo-ui-primary));
  box-shadow: var(--nowo-ui-focus-ring, 0 0 0 0.2rem var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent)));
}

.nowo-ui-bs-tokens .form-check-input:checked {
  border-color: var(--nowo-ui-accent, var(--nowo-ui-primary));
  background-color: var(--nowo-ui-accent, var(--nowo-ui-primary));
}

.nowo-ui-bs-tokens .table {
  --bs-table-color: var(--nowo-ui-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--nowo-ui-table-border, var(--nowo-ui-border));
  --bs-table-striped-color: var(--nowo-ui-text);
  --bs-table-striped-bg: var(--nowo-ui-table-stripe-bg, var(--nowo-ui-surface-muted));
  --bs-table-hover-color: var(--nowo-ui-text);
  --bs-table-hover-bg: var(--nowo-ui-table-hover-bg, color-mix(in srgb, var(--nowo-ui-surface-muted) 80%, transparent));
}

.nowo-ui-bs-tokens .table > thead > tr > th {
  background-color: var(--nowo-ui-table-head-bg, transparent);
  color: var(--nowo-ui-table-head-text, currentColor);
}

.nowo-ui-bs-tokens .list-group {
  --bs-list-group-color: var(--nowo-ui-text);
  --bs-list-group-bg: var(--nowo-ui-list-item-bg, transparent);
  --bs-list-group-border-color: var(--nowo-ui-list-border, var(--nowo-ui-border));
  --bs-list-group-border-radius: var(--nowo-ui-list-radius, var(--nowo-ui-radius));
  --bs-list-group-action-hover-bg: var(--nowo-ui-list-item-hover-bg, var(--nowo-ui-surface-muted));
  --bs-list-group-active-bg: var(--nowo-ui-primary);
  --bs-list-group-active-border-color: var(--nowo-ui-primary);
  --bs-list-group-active-color: var(--nowo-ui-primary-contrast);
}

.nowo-ui-bs-tokens .pagination {
  --bs-pagination-color: var(--nowo-ui-pagination-text, var(--nowo-ui-text));
  --bs-pagination-bg: var(--nowo-ui-pagination-bg, var(--nowo-ui-surface));
  --bs-pagination-border-color: var(--nowo-ui-pagination-border, var(--nowo-ui-border-strong));
  --bs-pagination-border-radius: var(--nowo-ui-pagination-radius, var(--nowo-ui-radius));
  --bs-pagination-hover-color: var(--nowo-ui-pagination-hover-text, var(--nowo-ui-pagination-text, var(--nowo-ui-text)));
  --bs-pagination-hover-bg: var(--nowo-ui-pagination-hover-bg, var(--nowo-ui-surface-muted));
  --bs-pagination-hover-border-color: var(--nowo-ui-pagination-hover-border, var(--nowo-ui-pagination-border, var(--nowo-ui-border-strong)));
  --bs-pagination-focus-color: var(--nowo-ui-pagination-text, var(--nowo-ui-text));
  --bs-pagination-focus-bg: var(--nowo-ui-pagination-hover-bg, var(--nowo-ui-surface-muted));
  --bs-pagination-focus-box-shadow: var(--nowo-ui-focus-ring, 0 0 0 0.2rem var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent)));
  --bs-pagination-active-color: var(--nowo-ui-pagination-active-text, var(--nowo-ui-primary-contrast));
  --bs-pagination-active-bg: var(--nowo-ui-pagination-active-bg, var(--nowo-ui-primary));
  --bs-pagination-active-border-color: var(--nowo-ui-pagination-active-border, var(--nowo-ui-pagination-active-bg, var(--nowo-ui-primary)));
  --bs-pagination-disabled-color: var(--nowo-ui-muted);
  --bs-pagination-disabled-bg: var(--nowo-ui-pagination-bg, var(--nowo-ui-surface));
  --bs-pagination-disabled-border-color: var(--nowo-ui-pagination-border, var(--nowo-ui-border-strong));
}

.nowo-ui-bs-tokens .nav-tabs {
  --bs-nav-link-color: var(--nowo-ui-tab-text, var(--nowo-ui-muted));
  --bs-nav-link-hover-color: var(--nowo-ui-tab-hover-text, var(--nowo-ui-text));
  --bs-nav-tabs-border-color: var(--nowo-ui-tabs-border, var(--nowo-ui-border));
  --bs-nav-tabs-link-hover-border-color: var(--nowo-ui-tabs-border, var(--nowo-ui-border));
  --bs-nav-tabs-link-active-color: var(--nowo-ui-tab-active-text, var(--nowo-ui-text));
  --bs-nav-tabs-link-active-bg: var(--nowo-ui-tab-active-bg, var(--nowo-ui-surface));
  --bs-nav-tabs-link-active-border-color: var(--nowo-ui-tabs-border, var(--nowo-ui-border)) var(--nowo-ui-tabs-border, var(--nowo-ui-border)) var(--nowo-ui-tab-active-border, var(--nowo-ui-primary));
}

.nowo-ui-bs-tokens .card {
  --bs-card-bg: var(--nowo-ui-card-bg, var(--nowo-ui-surface));
  --bs-card-color: var(--nowo-ui-text);
  --bs-card-border-color: var(--nowo-ui-card-border, var(--nowo-ui-border));
  --bs-card-border-radius: var(--nowo-ui-card-radius, var(--nowo-ui-radius));
  --bs-card-cap-bg: var(--nowo-ui-surface-muted);
}

.nowo-ui-bs-tokens .modal {
  --bs-modal-bg: var(--nowo-ui-surface);
  --bs-modal-color: var(--nowo-ui-text);
  --bs-modal-border-color: var(--nowo-ui-border);
  --bs-modal-border-radius: var(--nowo-ui-modal-radius, var(--nowo-ui-radius));
  --bs-modal-header-border-color: var(--nowo-ui-border);
  --bs-modal-footer-border-color: var(--nowo-ui-border);
}

.nowo-ui-bs-tokens .progress {
  --bs-progress-bg: var(--nowo-ui-progress-track, var(--nowo-ui-surface-muted));
  --bs-progress-bar-bg: var(--nowo-ui-progress-bar, var(--nowo-ui-primary));
}

.nowo-ui-bs-tokens .alert-success {
  --bs-alert-color: var(--nowo-ui-success-text);
  --bs-alert-bg: var(--nowo-ui-success-bg);
  --bs-alert-border-color: var(--nowo-ui-success-border);
}

.nowo-ui-bs-tokens .alert-danger {
  --bs-alert-color: var(--nowo-ui-danger-text-strong);
  --bs-alert-bg: var(--nowo-ui-danger-bg);
  --bs-alert-border-color: var(--nowo-ui-danger-border);
}

.nowo-ui-bs-tokens .alert-warning {
  --bs-alert-color: var(--nowo-ui-warning-text);
  --bs-alert-bg: var(--nowo-ui-warning-bg);
  --bs-alert-border-color: var(--nowo-ui-warning-border);
}

.nowo-ui-bs-tokens .alert-info {
  --bs-alert-color: var(--nowo-ui-info-text);
  --bs-alert-bg: var(--nowo-ui-info-bg);
  --bs-alert-border-color: var(--nowo-ui-info-border);
}

/* Bootstrap colour utilities on kit badges use !important; the bridge answers in kind, scoped to .nowo-ui-badge. */
.nowo-ui-bs-tokens .nowo-ui-badge.badge {
  border: 1px solid var(--nowo-ui-border) !important;
  border-radius: var(--nowo-ui-badge-radius, 999px);
  background-color: var(--nowo-ui-surface-muted) !important;
  color: var(--nowo-ui-text) !important;
}

.nowo-ui-bs-tokens .nowo-ui-badge--success.badge {
  border-color: var(--nowo-ui-success-border) !important;
  background-color: var(--nowo-ui-success-bg) !important;
  color: var(--nowo-ui-success-text) !important;
}

.nowo-ui-bs-tokens .nowo-ui-badge--warning.badge {
  border-color: var(--nowo-ui-warning-border) !important;
  background-color: var(--nowo-ui-warning-bg) !important;
  color: var(--nowo-ui-warning-text) !important;
}

.nowo-ui-bs-tokens .nowo-ui-badge--danger.badge,
.nowo-ui-bs-tokens .nowo-ui-badge--error.badge {
  border-color: var(--nowo-ui-danger-border) !important;
  background-color: var(--nowo-ui-danger-bg) !important;
  color: var(--nowo-ui-danger-text-strong) !important;
}

.nowo-ui-bs-tokens .nowo-ui-badge--info.badge {
  border-color: var(--nowo-ui-info-border) !important;
  background-color: var(--nowo-ui-info-bg) !important;
  color: var(--nowo-ui-info-text) !important;
}

.nowo-ui-bs-tokens .nowo-ui-badge--neutral.badge {
  color: var(--nowo-ui-muted) !important;
}

/* --- Dark theme token defaults (zero specificity under data-nowo-ui-host-tokens, see the top of the file) --- */
[data-theme="dark"]:where(:not([data-nowo-ui-host-tokens], [data-nowo-ui-host-tokens] *)),
:where([data-nowo-ui-host-tokens][data-theme="dark"], [data-nowo-ui-host-tokens] [data-theme="dark"]) {
  --nowo-ui-primary: #60a5fa;
  --nowo-ui-primary-contrast: #0b1220;
  --nowo-ui-danger: #f87171;
  --nowo-ui-danger-text: #fecaca;
  --nowo-ui-danger-bg: #3f1d1d;
  --nowo-ui-danger-border: #7f1d1d;
  --nowo-ui-danger-text-strong: #fecaca;
  --nowo-ui-danger-solid: #ef4444;
  --nowo-ui-danger-contrast: #0b1220;
  --nowo-ui-success-bg: #052e1f;
  --nowo-ui-success-border: #065f46;
  --nowo-ui-success-text: #6ee7b7;
  --nowo-ui-warning-bg: #3b2a0b;
  --nowo-ui-warning-border: #78350f;
  --nowo-ui-warning-text: #fcd34d;
  --nowo-ui-info-bg: #082f49;
  --nowo-ui-info-border: #075985;
  --nowo-ui-info-text: #7dd3fc;
  --nowo-ui-surface: #0f172a;
  --nowo-ui-surface-muted: #1e293b;
  --nowo-ui-border: #334155;
  --nowo-ui-border-strong: #475569;
  --nowo-ui-text: #e2e8f0;
  --nowo-ui-muted: #94a3b8;
  --nowo-ui-link: var(--nowo-ui-primary);
  /* 2.27: the only component token with its own dark default (Theme::LIGHT_ONLY_TOKENS) */
  --nowo-ui-header-crumbs-panel-shadow: 0 8px 24px rgb(0 0 0 / 45%);
}


/* =============================================================================================
 * 1.17 — host chrome (opt-in by class / attribute; nothing here applies to existing markup).
 * Component tokens resolve through var() fallbacks (docs/THEMING.md — Corner tabs, tables, scrollbars).
 * ============================================================================================= */

/* --- Card corner tab (partials/_corner_tab.html.twig; table mode toggle, filter fold) ---
 * Stuck to the top-right corner of the nearest positioned ancestor: `.nowo-ui-corner-host` (or a kit card). */
.nowo-ui-corner-host,
.nowo-ui-card:has(.nowo-ui-corner-tab) {
  position: relative;
}

.nowo-ui-corner-tab {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--nowo-ui-corner-tab-width, 1.5rem);
  height: var(--nowo-ui-corner-tab-height, 1.375rem);
  margin: 0;
  padding: 0;
  border: var(--nowo-ui-border-width, 1px) solid color-mix(in srgb, var(--nowo-ui-corner-tab-accent, var(--nowo-ui-primary)) 35%, var(--nowo-ui-border));
  border-top: 0;
  border-right: 0;
  border-radius: 0 var(--nowo-ui-card-radius, var(--nowo-ui-radius)) 0 var(--nowo-ui-radius);
  background: color-mix(in srgb, var(--nowo-ui-corner-tab-accent, var(--nowo-ui-primary)) 10%, var(--nowo-ui-surface));
  color: var(--nowo-ui-corner-tab-accent, var(--nowo-ui-primary));
  font-size: var(--nowo-ui-corner-tab-icon, 0.875rem);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.nowo-ui-corner-tab:hover {
  background: color-mix(in srgb, var(--nowo-ui-corner-tab-accent, var(--nowo-ui-primary)) 18%, var(--nowo-ui-surface));
  color: var(--nowo-ui-corner-tab-accent, var(--nowo-ui-primary));
}

.nowo-ui-corner-tab:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

/* Under the host's content (fields, buttons, dropdowns) where they overlap: the host gets its own stacking context. */
.nowo-ui-corner-tab--under {
  z-index: -1;
}

.nowo-ui-corner-host:has(> .nowo-ui-corner-tab--under) {
  isolation: isolate;
}

.nowo-ui-corner-tab__icon,
.nowo-ui-responsive-table__icon,
.nowo-ui-filters-collapse__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--nowo-ui-corner-tab-icon, 0.875rem);
  height: var(--nowo-ui-corner-tab-icon, 0.875rem);
  font-size: var(--nowo-ui-corner-tab-icon, 0.875rem);
  line-height: 1;
}

:is(.nowo-ui-corner-tab__icon, .nowo-ui-responsive-table__icon, .nowo-ui-filters-collapse__icon, .nowo-ui-disclosure-icon__static, .nowo-ui-edge-tab__icon) > svg {
  width: 100%;
  height: 100%;
}

/* --- Responsive table (partials/_responsive_table.html.twig, Stimulus peer `responsive-table`) --- */
.nowo-ui-responsive-table {
  position: relative;
}

/* The corner toggle climbs to the card (or any .nowo-ui-corner-host) instead of the table wrapper. */
:where(.nowo-ui-corner-host, .nowo-ui-card) .nowo-ui-responsive-table--corner {
  position: static;
}

.nowo-ui-responsive-table__bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.375rem;
}

.nowo-ui-responsive-table--corner > .nowo-ui-responsive-table__bar {
  display: contents;
}

.nowo-ui-responsive-table__toggle:not(.nowo-ui-corner-tab) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-muted);
  cursor: pointer;
}

.nowo-ui-responsive-table__toggle:not(.nowo-ui-corner-tab):hover,
.nowo-ui-responsive-table__toggle:not(.nowo-ui-corner-tab)[aria-pressed='true'] {
  color: var(--nowo-ui-primary);
  border-color: color-mix(in srgb, var(--nowo-ui-primary) 45%, var(--nowo-ui-border));
}

.nowo-ui-responsive-table__toggle:not(.nowo-ui-corner-tab):focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

/* Static icon of the current mode until a morph-icon is ready; afterwards only the morph-icon. */
.nowo-ui-responsive-table__toggle .nowo-ui-responsive-table__icon--responsive,
.nowo-ui-responsive-table[data-table-mode='responsive'] .nowo-ui-responsive-table__toggle .nowo-ui-responsive-table__icon--scroll,
.nowo-ui-responsive-table__toggle.is-morph-ready .nowo-ui-responsive-table__icon,
.nowo-ui-responsive-table__toggle:not(.is-morph-ready) .nowo-ui-responsive-table__morph {
  display: none !important;
}

.nowo-ui-responsive-table[data-table-mode='responsive'] .nowo-ui-responsive-table__toggle:not(.is-morph-ready) .nowo-ui-responsive-table__icon--responsive {
  display: inline-flex !important;
}

.nowo-ui-row-detail-col,
.nowo-ui-row-detail-cell {
  display: none;
}

.nowo-ui-responsive-table[data-table-mode='responsive'] .nowo-ui-responsive-table__scroller {
  overflow-x: hidden;
}

.nowo-ui-responsive-table[data-table-mode='responsive'] table {
  width: 100%;
}

.nowo-ui-responsive-table[data-table-mode='responsive'] [data-rt-hidden] {
  display: none !important;
}

/* Text wraps at spaces so the required columns and the detail button fit (no horizontal scroll at 320px and above):
   cells AND their descendants — nowrap utilities (Tailwind .whitespace-nowrap, Bootstrap .text-nowrap) would
   otherwise keep the table wider than its scroller. Words never break here (`break-word` does not lower the
   min-content width), so the column fit hides columns before any word splits. */
.nowo-ui-responsive-table[data-table-mode='responsive'] :is(th, td),
.nowo-ui-responsive-table[data-table-mode='responsive'] :is(th, td) * {
  white-space: normal !important;
  overflow-wrap: break-word;
}

/* While the peer measures (`data-rt-measuring`, synchronous, inside one fit): words are unbreakable whatever the
   host or the last-resort rule says, so a cell's min-content is its longest word. */
.nowo-ui-responsive-table[data-rt-measuring] :is(th, td),
.nowo-ui-responsive-table[data-rt-measuring] :is(th, td) * {
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* AFTER the fit, only the required columns are left and they still overflow (long URLs, ids, a wide actions column).
   2.41 (MUX-20): the scroller scrolls sideways and words stay whole ("USUARI / O" was a word broken letter by letter).
   The 2.40 last resort — words break anywhere, no horizontal scroll down to 320px — is the partial's `overflow: 'break'`
   (data-rt-overflow-mode="break" on the root). */
.nowo-ui-responsive-table[data-table-mode='responsive'][data-rt-overflow]:not([data-rt-overflow-mode='break']) > .nowo-ui-responsive-table__scroller {
  overflow-x: auto;
}

.nowo-ui-responsive-table[data-rt-overflow-mode='break'][data-table-mode='responsive'][data-rt-overflow]:not([data-rt-measuring]) :is(th, td),
.nowo-ui-responsive-table[data-rt-overflow-mode='break'][data-table-mode='responsive'][data-rt-overflow]:not([data-rt-measuring]) :is(th, td) * {
  overflow-wrap: anywhere;
}

.nowo-ui-responsive-table[data-table-mode='responsive'][data-rt-has-hidden] :is(.nowo-ui-row-detail-col, .nowo-ui-row-detail-cell) {
  display: table-cell;
  width: 2.75rem;
  text-align: right;
  vertical-align: middle;
}

@media (pointer: coarse) {
  .nowo-ui-responsive-table[data-table-mode='responsive'][data-rt-has-hidden] tbody tr {
    cursor: pointer;
  }
}

@media (max-width: 30rem) {
  .nowo-ui-responsive-table[data-table-mode='responsive'] :is(th, td) {
    padding-right: 0.375rem;
    padding-left: 0.375rem;
  }

  .nowo-ui-responsive-table[data-table-mode='responsive'][data-rt-has-hidden] :is(.nowo-ui-row-detail-col, .nowo-ui-row-detail-cell) {
    width: 2.25rem;
  }
}

.nowo-ui-row-detail-btn,
.nowo-ui-row-detail__close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--nowo-ui-radius);
  background: transparent;
  color: var(--nowo-ui-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.nowo-ui-row-detail-btn:hover {
  color: var(--nowo-ui-primary);
  background: color-mix(in srgb, var(--nowo-ui-primary) 10%, transparent);
}

.nowo-ui-row-detail__close:hover {
  color: var(--nowo-ui-text);
  background: color-mix(in srgb, var(--nowo-ui-text) 8%, transparent);
}

.nowo-ui-row-detail-btn:focus-visible,
.nowo-ui-row-detail__close:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-row-detail-btn > svg,
.nowo-ui-row-detail__close > svg {
  width: 1.125rem;
  height: 1.125rem;
}

.nowo-ui-row-detail-btn[hidden] {
  display: none !important;
}

/* Row detail dialog: the confirm dialog chrome, scrollable content. 2.29: the medium width; 2.31: the content's
   height, capped (the size's height with --nowo-ui-dialog-fill: 1), the content scrolls under the header. */
.nowo-ui-row-detail .nowo-ui-row-detail__panel {
  width: 100%;
  height: auto;
  min-height: calc(var(--nowo-ui-dialog-max-h) * clamp(0, var(--nowo-ui-dialog-fill, 0), 1));
  max-height: var(--nowo-ui-dialog-max-h);
  display: flex;
  flex-direction: column;
}


.nowo-ui-row-detail__header {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.nowo-ui-row-detail__title {
  overflow-wrap: anywhere;
}

.nowo-ui-row-detail__content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.5rem 1.25rem 1.25rem;
  overflow-y: auto;
}

.nowo-ui-row-detail__list {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
  gap: 0.625rem 1rem;
  margin: 0;
}

.nowo-ui-row-detail__list dt {
  padding-top: 0.125rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--nowo-ui-muted);
}

.nowo-ui-row-detail__list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 30rem) {
  .nowo-ui-row-detail__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }

  .nowo-ui-row-detail__list dd {
    margin-bottom: 0.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nowo-ui-row-detail[open] .nowo-ui-row-detail__panel {
    animation: nowo-ui-row-detail-in var(--nowo-ui-motion-medium) var(--nowo-ui-motion-ease-out);
  }
}

[data-motion='reduce'] .nowo-ui-row-detail[open] .nowo-ui-row-detail__panel {
  animation: none;
}

@keyframes nowo-ui-row-detail-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Foldable filter card (partials/_filters_collapse.html.twig, Stimulus peer `filters-collapse`) ---
 * The fold tab sits in the form's top-right corner, stacked UNDER the fields (z-index -1 inside the form's own
 * stacking context), so dropdowns keep stacking normally. Folding hides the fields only: they keep their values. */
form:has(> .nowo-ui-filters-collapse) {
  position: relative;
  isolation: isolate;
}

.nowo-ui-filters-collapse {
  display: contents;
}

.nowo-ui-filters-collapse__toggle .nowo-ui-filters-collapse__icon--collapsed,
.nowo-ui-filters-collapse.is-collapsed .nowo-ui-filters-collapse__toggle .nowo-ui-filters-collapse__icon--expanded,
.nowo-ui-filters-collapse__toggle.is-morph-ready .nowo-ui-filters-collapse__icon,
.nowo-ui-filters-collapse__toggle:not(.is-morph-ready) .nowo-ui-filters-collapse__morph {
  display: none !important;
}

.nowo-ui-filters-collapse.is-collapsed .nowo-ui-filters-collapse__toggle:not(.is-morph-ready) .nowo-ui-filters-collapse__icon--collapsed {
  display: inline-flex !important;
}

.nowo-ui-filters-collapse__summary {
  flex-basis: 100%;
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--nowo-ui-muted);
}

.nowo-ui-filters-collapse__summary[hidden] {
  display: none !important;
}

/* Folded: only the tab and the summary line stay visible (the fields keep their values and still submit).
 * State-hide rules are !important (2.3.1): inside the nowo-ui cascade layer a normal declaration loses to any unlayered host
 * rule or utility class (.d-flex, .grid, .flex…) on the hidden element; an important layered one wins. */
form:has(> .nowo-ui-filters-collapse.is-collapsed) > :not(.nowo-ui-filters-collapse) {
  display: none !important;
}

form:has(> .nowo-ui-filters-collapse.is-collapsed) {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* --- Disclosure chevron (partials/_disclosure_icon.html.twig, Stimulus peer `disclosure-icon`) ---
 * Static icon of the host state — `aria-expanded` on the toggle or `<details open>` — then the morph-icon. */
.nowo-ui-disclosure-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.875rem;
  line-height: 1;
}

.nowo-ui-disclosure-icon__static {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
}

.nowo-ui-disclosure-icon__static--closed,
[aria-expanded='false'] > .nowo-ui-disclosure-icon .nowo-ui-disclosure-icon__static--open,
details:not([open]) > summary > .nowo-ui-disclosure-icon .nowo-ui-disclosure-icon__static--open,
.is-morph-ready > .nowo-ui-disclosure-icon .nowo-ui-disclosure-icon__static,
:not(.is-morph-ready) > .nowo-ui-disclosure-icon .nowo-ui-disclosure-icon__morph {
  display: none !important;
}

[aria-expanded='false']:not(.is-morph-ready) > .nowo-ui-disclosure-icon .nowo-ui-disclosure-icon__static--closed,
details:not([open]) > summary:not(.is-morph-ready) > .nowo-ui-disclosure-icon .nowo-ui-disclosure-icon__static--closed {
  display: inline-flex !important;
}

/* --- Page-edge tab (partials/_edge_tab.html.twig) ---
   Size tokens (2.45): --nowo-ui-edge-tab-width (2.25rem), --nowo-ui-edge-tab-height (2.75rem),
   --nowo-ui-edge-tab-hover-width (2.6rem), --nowo-ui-edge-tab-icon (1.15rem, the icon size) and --nowo-ui-edge-tab-gap
   (0.5rem); --nowo-ui-edge-tab-step defaults to height + gap (3.25rem). The launcher (partials/_edge_tabs_launcher)
   reads the same tokens, so every right-edge tab has one size. */
.nowo-ui-edge-tab {
  display: contents;
}

.nowo-ui-edge-tab__link {
  position: fixed;
  top: calc(var(--nowo-ui-edge-tab-top, calc(var(--nowo-ui-header-height, 3.5rem) + 0.75rem)) + var(--nowo-ui-edge-tab-slot, 0) * var(--nowo-ui-edge-tab-step, calc(var(--nowo-ui-edge-tab-height, 2.75rem) + var(--nowo-ui-edge-tab-gap, 0.5rem))));
  right: 0;
  z-index: var(--nowo-ui-edge-tab-z, 74);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--nowo-ui-edge-tab-width, 2.25rem);
  height: var(--nowo-ui-edge-tab-height, 2.75rem);
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-right: 0;
  border-radius: var(--nowo-ui-radius) 0 0 var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  box-shadow: -2px 2px 8px rgb(var(--nowo-ui-shadow-rgb, 15 23 42) / 10%);
  font-size: var(--nowo-ui-edge-tab-icon, 1.15rem);
  line-height: 1;
  text-decoration: none;
  transition: width 0.15s ease, color 0.15s ease;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='1'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 1;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='2'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 2;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='3'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 3;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='4'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 4;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='5'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 5;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='6'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 6;
}

.nowo-ui-edge-tab[data-nowo-ui-edge-tab-slot='7'] .nowo-ui-edge-tab__link {
  --nowo-ui-edge-tab-slot: 7;
}

.nowo-ui-edge-tab__link:hover {
  width: var(--nowo-ui-edge-tab-hover-width, 2.6rem);
  color: var(--nowo-ui-primary);
}

.nowo-ui-edge-tab__link:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-edge-tab__icon {
  display: inline-flex;
  width: var(--nowo-ui-edge-tab-icon, 1.15rem);
  height: var(--nowo-ui-edge-tab-icon, 1.15rem);
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .nowo-ui-edge-tab__link {
    transition: none;
  }
}

[data-motion='reduce'] .nowo-ui-edge-tab__link {
  transition: none;
}

@media print {
  .nowo-ui-edge-tab__link {
    display: none;
  }
}

/* --- Listing customizer (partials/_listing_customizer.html.twig, _listing_head / _listing_cells) --- */
button.nowo-ui-edge-tab__link {
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.nowo-ui-listing-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface-muted, var(--nowo-ui-surface));
  color: var(--nowo-ui-text);
  font-size: 0.875rem;
}

.nowo-ui-listing-customizer__tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
}

.nowo-ui-listing-customizer__tab {
  margin-bottom: calc(-1 * var(--nowo-ui-border-width, 1px));
  padding: 0.375rem 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--nowo-ui-muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.nowo-ui-listing-customizer__tab[aria-selected='true'] {
  border-bottom-color: var(--nowo-ui-primary);
  color: var(--nowo-ui-text);
  font-weight: 600;
}

.nowo-ui-listing-customizer__tab:focus-visible,
.nowo-ui-listing-customizer__move:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 1px;
}

.nowo-ui-listing-customizer__panel > p {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
}

.nowo-ui-listing-customizer__list {
  display: grid;
  gap: 0.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.nowo-ui-listing-customizer__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
}

.nowo-ui-listing-customizer__item.is-hidden .nowo-ui-listing-customizer__label {
  color: var(--nowo-ui-muted);
}

.nowo-ui-listing-customizer__item.is-stacked {
  margin-left: 1.25rem;
  border-style: dashed;
}

.nowo-ui-listing-customizer__item.is-dragging {
  opacity: 0.5;
}

.nowo-ui-listing-customizer__item.is-drop-target {
  border-color: var(--nowo-ui-primary);
}

.nowo-ui-listing-customizer__handle {
  display: inline-flex;
  color: var(--nowo-ui-muted);
  cursor: grab;
}

.nowo-ui-listing-customizer__label {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.nowo-ui-listing-customizer__required {
  color: var(--nowo-ui-muted);
  font-size: 0.75rem;
}

.nowo-ui-listing-customizer__move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: var(--nowo-ui-border-width, 1px) solid transparent;
  border-radius: var(--nowo-ui-radius);
  background: none;
  color: var(--nowo-ui-text);
  cursor: pointer;
}

.nowo-ui-listing-customizer__move:hover:not(:disabled) {
  border-color: var(--nowo-ui-border);
}

.nowo-ui-listing-customizer__move:disabled {
  opacity: 0.35;
  cursor: default;
}

.nowo-ui-listing-customizer__stack[aria-pressed='true'] {
  border-color: var(--nowo-ui-primary);
  color: var(--nowo-ui-primary);
}

/* 2.33 (UI-3): the scope selector of a scoped customizer, on top of the panel */
.nowo-ui-listing-customizer__scope {
  display: grid;
  gap: 0.35rem;
  margin-block-end: 0.75rem;
}

.nowo-ui-listing-customizer__scope > p {
  margin: 0;
  font-size: 0.8125rem;
}

.nowo-ui-listing-customizer__status {
  flex: 1 1 100%;
  min-height: 1.25rem;
  margin: 0;
  color: var(--nowo-ui-muted);
  font-size: 0.8125rem;
}

.nowo-ui-listing-customizer__status.is-error {
  color: var(--nowo-ui-danger-text, var(--nowo-ui-danger));
}

.nowo-ui-listing-customizer__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.nowo-ui-listing-cell__part + .nowo-ui-listing-cell__part {
  margin-top: 0.25rem;
}

th > .nowo-ui-listing-cell__part {
  display: block;
}

@media print {
  .nowo-ui-listing-customizer {
    display: none;
  }
}

/* --- Back link (2.7): "Back to …" above a page title (partials/_back_link.html.twig) --- */
.nowo-ui-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--nowo-ui-muted);
  text-decoration: none;
}

.nowo-ui-back-link:hover,
.nowo-ui-back-link:focus-visible {
  color: var(--nowo-ui-text);
}

.nowo-ui-back-link__icon {
  display: inline-flex;
  line-height: 1;
}

.nowo-ui-edge-link {
  margin: 0;
  font-size: 0.75rem;
  color: var(--nowo-ui-muted);
}

/* 2.13: button edge tab / inline button (partials/_edge_tab.html.twig `button: true`, e.g. the guided tour tab) */
button.nowo-ui-edge-tab__link {
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.nowo-ui-edge-link__button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* --- Thin scrollbars ---
 * `.nowo-ui-thin-scroll` on any scroller, or `data-nowo-ui-thin-scrollbars` on <html> for the page and every kit
 * scroller (shell, aside, main, modals, dialogs, table wrappers). Chromium 121+ ignores ::-webkit-scrollbar once the
 * standard scrollbar-width / scrollbar-color are set (and then draws the wide bar with arrow buttons), so the
 * standard properties are for engines without ::-webkit-scrollbar (Firefox) only. Hosts with their own selector
 * lists: the SCSS mixin assets/styles/_thin-scrollbars.scss. */
@supports not selector(::-webkit-scrollbar) {
  .nowo-ui-thin-scroll,
  html[data-nowo-ui-thin-scrollbars],
  [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller) {
    scrollbar-width: thin;
    scrollbar-color: var(--nowo-ui-scrollbar-thumb, color-mix(in srgb, var(--nowo-ui-text) 28%, transparent)) transparent;
  }
}

:is(.nowo-ui-thin-scroll, html[data-nowo-ui-thin-scrollbars], [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller))::-webkit-scrollbar {
  width: var(--nowo-ui-scrollbar-size, 6px);
  height: var(--nowo-ui-scrollbar-size, 6px);
}

:is(.nowo-ui-thin-scroll, html[data-nowo-ui-thin-scrollbars], [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller))::-webkit-scrollbar-button {
  display: none;
}

:is(.nowo-ui-thin-scroll, html[data-nowo-ui-thin-scrollbars], [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller))::-webkit-scrollbar-track,
:is(.nowo-ui-thin-scroll, html[data-nowo-ui-thin-scrollbars], [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller))::-webkit-scrollbar-corner {
  background: transparent;
}

:is(.nowo-ui-thin-scroll, html[data-nowo-ui-thin-scrollbars], [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller))::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: var(--nowo-ui-scrollbar-thumb, color-mix(in srgb, var(--nowo-ui-text) 28%, transparent));
  background-clip: padding-box;
}

:is(.nowo-ui-thin-scroll, html[data-nowo-ui-thin-scrollbars], [data-nowo-ui-thin-scrollbars] :is(body, .nowo-ui-aside, .nowo-ui-main, .nowo-ui-modal, .nowo-ui-modal .modal-body, .nowo-ui-row-detail__content, .nowo-ui-table-wrap, .nowo-ui-responsive-table__scroller))::-webkit-scrollbar-thumb:hover {
  background-color: var(--nowo-ui-scrollbar-thumb-hover, color-mix(in srgb, var(--nowo-ui-text) 45%, transparent));
}

/* =============================================================================================
 * 2.0 — page contract (REQ-UI-003): layouts, scaffolds and view-model partials. Semantic classes only,
 * painted from the base tokens; framework classes come from the theme slots.
 * ============================================================================================= */
.nowo-ui-page {
  min-height: 100vh;
  min-height: 100dvh;
}

.nowo-ui-page--guest {
  display: grid;
  place-items: start center;
  padding: 2rem 1rem;
}

.nowo-ui-page--guest > .nowo-ui-content {
  width: 100%;
  max-width: 28rem;
}

.nowo-ui-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--nowo-ui-muted);
}

/* The plain trail prints its separators (slot breadcrumb_separator); host overrides without them keep the CSS one */
.nowo-ui-breadcrumbs__item + .nowo-ui-breadcrumbs__item:not(:has(> .nowo-ui-breadcrumbs__separator))::before {
  content: "/";
  margin-right: 0.35rem;
}

.nowo-ui-breadcrumbs__separator {
  margin-right: 0.35rem;
}

.nowo-ui-breadcrumbs__link {
  color: inherit;
}

.nowo-ui-cell--center,
.nowo-ui-table :is(th, td).nowo-ui-cell--center {
  text-align: center;
}

.nowo-ui-cell--end,
.nowo-ui-table :is(th, td).nowo-ui-cell--end {
  text-align: end;
}

/* Numeric / end-aligned cells line up their digits (2.2) */
.nowo-ui-table td.nowo-ui-cell--end {
  font-variant-numeric: tabular-nums;
}

/* Row actions follow the actions column alignment (ListPage::actionsAlign) */
.nowo-ui-table__actions.nowo-ui-cell--center > .nowo-ui-row-actions {
  justify-content: center;
}

.nowo-ui-table__actions.nowo-ui-cell--end > .nowo-ui-row-actions {
  justify-content: flex-end;
}

.nowo-ui-table__cell--muted {
  color: var(--nowo-ui-muted);
}

/* Sortable column headers (2.20, partial `sort_header`): server-side link (`sort_link`) and client-side button
   (`sort_button`, Stimulus peer `table-sort`) look the same — the label, then the direction arrow (the neutral arrows,
   faint, while the column is not the sorted one). Positioned so the visually hidden hint never widens a scroller.
   Tokens: --nowo-ui-sort-hover (label colour on hover), --nowo-ui-sort-icon-opacity (idle arrow). */
.nowo-ui-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  margin: -0.125rem -0.25rem;
  padding: 0.125rem 0.25rem;
  border: 0;
  border-radius: var(--nowo-ui-radius);
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  text-decoration: none;
  cursor: pointer;
}

.nowo-ui-sort:hover {
  color: var(--nowo-ui-sort-hover, var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary))));
}

.nowo-ui-sort:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 1px;
}

.nowo-ui-sort__icon {
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.875em;
  line-height: 1;
  opacity: var(--nowo-ui-sort-icon-opacity, 0.45);
}

.nowo-ui-sort:hover .nowo-ui-sort__icon,
.nowo-ui-sort--asc .nowo-ui-sort__icon,
.nowo-ui-sort--desc .nowo-ui-sort__icon,
th[aria-sort] > .nowo-ui-sort .nowo-ui-sort__icon {
  opacity: 1;
}

.nowo-ui-sort--asc,
.nowo-ui-sort--desc,
th[aria-sort] > .nowo-ui-sort--button {
  font-weight: 600;
}

/* Client-side headers: the arrow and the hint follow the header's aria-sort (no script-built markup). */
.nowo-ui-sort__icon--asc,
.nowo-ui-sort__icon--desc,
.nowo-ui-sort__hint--desc,
th[aria-sort] .nowo-ui-sort__icon--none,
th[aria-sort='ascending'] .nowo-ui-sort__hint--asc,
th[data-sort-first='desc']:not([aria-sort]) .nowo-ui-sort__hint--asc {
  display: none;
}

th[aria-sort='ascending'] .nowo-ui-sort__icon--asc,
th[aria-sort='descending'] .nowo-ui-sort__icon--desc {
  display: inline-flex;
}

th[aria-sort='ascending'] .nowo-ui-sort__hint--desc,
th[data-sort-first='desc']:not([aria-sort]) .nowo-ui-sort__hint--desc {
  display: inline;
}

.nowo-ui-form__actions,
.nowo-ui-filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.nowo-ui-action__form {
  display: inline;
  margin: 0;
}

.nowo-ui-detail-list {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

/* Zero specificity: a host class on the detail_item slot (grid, flex, block) replaces it */
:where(.nowo-ui-detail-list__item) {
  display: contents;
}

/* Label over value (add the modifier through the detail_list slot or the partial's `modifier: 'stacked'`) */
.nowo-ui-detail-list--stacked {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.nowo-ui-detail-list--stacked > .nowo-ui-detail-list__item {
  display: grid;
  gap: 0.125rem;
}

.nowo-ui-detail-list__term {
  color: var(--nowo-ui-muted);
  font-weight: 500;
}

.nowo-ui-detail-list__value {
  margin: 0;
  overflow-wrap: anywhere;
}

.nowo-ui-detail-list--meta {
  margin: 1rem 0;
  font-size: 0.8125rem;
}

.nowo-ui-kpis,
.nowo-ui-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.nowo-ui-cards {
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.nowo-ui-kpi {
  padding: 0.75rem 1rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-kpi-radius, var(--nowo-ui-radius));
  /* Optional top accent (2.2): an inset shadow, clipped by the tile radius (a thick border-top tapers at rounded
     corners); --nowo-ui-kpi-accent-width (default 0) + --nowo-ui-kpi-accent */
  box-shadow: inset 0 var(--nowo-ui-kpi-accent-width, 0) 0 0 var(--nowo-ui-kpi-accent, var(--nowo-ui-primary));
  background: var(--nowo-ui-surface);
}

.nowo-ui-kpi__label,
.nowo-ui-kpi__hint {
  margin: 0;
  color: var(--nowo-ui-muted);
  font-size: 0.8125rem;
}

.nowo-ui-kpi__value {
  margin: 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.nowo-ui-kpi--success .nowo-ui-kpi__value {
  color: var(--nowo-ui-success-text);
}

.nowo-ui-kpi--warning .nowo-ui-kpi__value {
  color: var(--nowo-ui-warning-text);
}

.nowo-ui-kpi--danger .nowo-ui-kpi__value {
  color: var(--nowo-ui-danger-text);
}

.nowo-ui-kpi--info .nowo-ui-kpi__value {
  color: var(--nowo-ui-info-text);
}

.nowo-ui-wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  counter-reset: nowo-ui-wizard;
}

.nowo-ui-wizard-steps__item {
  counter-increment: nowo-ui-wizard;
  padding: 0.25rem 0.75rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

.nowo-ui-wizard-steps__item::before {
  content: counter(nowo-ui-wizard) ". ";
}

.nowo-ui-wizard-steps__item--active {
  border-color: var(--nowo-ui-primary);
  color: var(--nowo-ui-text);
  font-weight: 600;
}

.nowo-ui-wizard-steps__item--done {
  color: var(--nowo-ui-text);
}

.nowo-ui-wizard-page__progress {
  color: var(--nowo-ui-muted);
  font-size: 0.8125rem;
}

.nowo-ui-auth-panel {
  box-sizing: border-box;
  /* 2.3: centred, at most 28rem, in any guest layout (host layouts without .nowo-ui-page--guest too) */
  width: min(var(--nowo-ui-auth-panel-width, 28rem), 100%);
  margin-inline: auto;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
}

/* 2.3: full-width fields inside the auth panel (the `input` slot caps inputs at 20rem elsewhere) */
.nowo-ui-auth-panel :is(.nowo-ui-input, input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="range"], [type="color"]), select, textarea) {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}

.nowo-ui-auth-panel__brand {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.nowo-ui-auth-panel__brand--logo .nowo-ui-brand__logo {
  height: var(--nowo-ui-brand-region-logo-height, 2.5rem);
}

.nowo-ui-auth-panel__footer {
  padding: 0.75rem 1rem;
  border-top: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  font-size: 0.875rem;
}

/* List reset with !important (2.3): an unlayered Bootstrap reboot (`ul { padding-left: 2rem; margin-bottom: 1rem }`)
   beats normal declarations of the nowo-ui layer, never a layered !important. */
.nowo-ui-auth-panel__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.nowo-ui-auth-panel__links > li {
  margin: 0 !important;
}

/* Menu / popover (2.3, partial `menu`): native <details> disclosure; the panel floats under the toggle */
.nowo-ui-menu {
  position: relative;
  display: inline-block;
}

.nowo-ui-menu > summary {
  list-style: none;
  cursor: pointer;
}

.nowo-ui-menu > summary::-webkit-details-marker {
  display: none;
}

/* Icon + label spacing as a margin (a Bootstrap .btn toggle keeps its unlayered display: inline-block) */
.nowo-ui-menu__toggle > .nowo-ui-menu__label:not(:first-child) {
  margin-inline-start: 0.35rem;
}

.nowo-ui-menu__toggle:not(.btn, .button) {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--nowo-ui-border-strong);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  font-size: 0.875rem;
  line-height: 1.5;
}

.nowo-ui-menu__toggle:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

.nowo-ui-menu__panel,
.nowo-ui-popover {
  position: absolute;
  z-index: var(--nowo-ui-menu-z-index, var(--nowo-ui-z-modal, 1050));
  top: calc(100% + 0.25rem);
  inset-inline-start: 0;
  box-sizing: border-box;
  min-width: var(--nowo-ui-menu-min-width, 12rem);
  max-width: min(var(--nowo-ui-menu-max-width, 22rem), calc(100vw - 2rem));
  margin: 0 !important;
  padding: 0.25rem !important;
  list-style: none !important;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  box-shadow: 0 0.5rem 1.5rem rgb(var(--nowo-ui-shadow-rgb, 15 23 42) / 0.12);
}

.nowo-ui-popover {
  padding: 0.75rem !important;
}

.nowo-ui-menu--end > :is(.nowo-ui-menu__panel, .nowo-ui-popover) {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.nowo-ui-menu__panel > li {
  margin: 0;
}

.nowo-ui-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  padding: 0.4rem 0.65rem;
  border: 0;
  border-radius: calc(var(--nowo-ui-radius) * 0.75);
  background: none;
  color: var(--nowo-ui-text);
  font: inherit;
  font-size: 0.875rem;
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
}

.nowo-ui-menu__item:hover,
.nowo-ui-menu__item:focus-visible {
  background: var(--nowo-ui-surface-muted);
  color: var(--nowo-ui-text);
}

.nowo-ui-menu__item.is-current {
  font-weight: 600;
}

.nowo-ui-menu__item--danger,
.nowo-ui-menu__item--danger:hover {
  color: var(--nowo-ui-danger-text);
}

.nowo-ui-menu__entry {
  padding: 0.25rem;
}

/* Popover menus (2.4, `popover: true` on the menu / kebab partials or theme.popover_menus): the panel is a native
   [popover] in the browser top layer, so table scrollers and cards never clip it. nowo-ui-popover.js places it
   under the toggle (flipped above when there is no room); without the script it opens at the viewport corner. */
.nowo-ui-menu--popover {
  display: inline-block;
}

:is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu)[popover] {
  position: fixed;
  inset: auto;
  top: 0.5rem;
  left: 0.5rem;
  margin: 0 !important;
  overflow: visible;
}

.nowo-ui-menu--popover > .nowo-ui-menu__toggle {
  cursor: pointer;
  font: inherit;
}

.nowo-ui-kebab__summary[popovertarget] {
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.nowo-ui-kebab__menu[popover] :is(form) {
  margin: 0;
}

/* Tree view (2.24, partial `tree`): APG navigation treeview; nested groups indent, toggles are decorative */
.nowo-ui-tree,
.nowo-ui-tree__group {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nowo-ui-tree__group {
  padding-inline-start: 1rem;
}
.nowo-ui-tree__group[hidden] {
  display: none !important;
}
.nowo-ui-tree__row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.375rem;
}
.nowo-ui-tree__row.is-current {
  background: color-mix(in srgb, var(--nowo-ui-primary) 12%, transparent);
}
.nowo-ui-tree__toggle,
.nowo-ui-tree__spacer {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
}
.nowo-ui-tree__toggle {
  position: relative;
}
/* 2.24: the toggle only acts once nowo-ui-tree.js runs */
[data-nowo-ui-tree-ready] .nowo-ui-tree__toggle {
  cursor: pointer;
}
@media (pointer: coarse) {
  .nowo-ui-tree__toggle,
  .nowo-ui-tree__spacer {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
  }
}
.nowo-ui-tree__toggle::before {
  content: '';
  position: absolute;
  inset: 0.5rem 0.55rem;
  border: solid currentColor;
  border-width: 0 0.125rem 0.125rem 0;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.nowo-ui-tree__row:has([aria-expanded='true']) > .nowo-ui-tree__toggle::before {
  transform: rotate(45deg);
}
.nowo-ui-tree__toggle:dir(rtl)::before {
  transform: rotate(135deg);
}
.nowo-ui-tree__link {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  color: inherit;
  text-decoration: none;
}
.nowo-ui-tree__link[aria-current='page'] {
  font-weight: 600;
}
.nowo-ui-tree__link:focus-visible {
  /* 2.24: a solid ring (3:1 non-text contrast, also on the current row); --nowo-ui-focus-ring-color overrides */
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: -2px;
}
.nowo-ui-tree__badge {
  margin-inline-start: auto;
  font-size: 0.75em;
  /* 2.24: the card-intro mix (AA on the current row's tint too); --nowo-ui-tree-badge-text overrides */
  color: var(--nowo-ui-tree-badge-text, color-mix(in srgb, var(--nowo-ui-muted) 85%, var(--nowo-ui-text)));
}
.nowo-ui-tree__row[data-nowo-ui-tree-drop='before'] {
  box-shadow: inset 0 0.125rem 0 var(--nowo-ui-primary);
}
.nowo-ui-tree__row[data-nowo-ui-tree-drop='after'] {
  box-shadow: inset 0 -0.125rem 0 var(--nowo-ui-primary);
}
.nowo-ui-tree__row[data-nowo-ui-tree-drop='inside'] {
  outline: 2px dashed var(--nowo-ui-primary);
  outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
  .nowo-ui-tree__toggle::before {
    transition: none;
  }
}

/* Segmented control (2.4, partial `segmented`): two options of one checkbox as a radio group */
.nowo-ui-segmented {
  display: inline-flex;
  gap: 0.125rem;
  padding: 0.125rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-segmented__option {
  padding: 0.2rem 0.65rem;
  border: var(--nowo-ui-border-width, 1px) solid transparent;
  border-radius: calc(var(--nowo-ui-radius) * 0.75);
  background: transparent;
  color: var(--nowo-ui-muted);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  cursor: pointer;
}

.nowo-ui-segmented__option:hover {
  color: var(--nowo-ui-text);
}

.nowo-ui-segmented__option:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 1px;
}

.nowo-ui-segmented__option.is-active,
.nowo-ui-segmented__option[aria-checked="true"] {
  border-color: var(--nowo-ui-primary);
  background: color-mix(in srgb, var(--nowo-ui-primary) 14%, var(--nowo-ui-surface));
  color: var(--nowo-ui-text);
  font-weight: 600;
}

.nowo-ui-segmented__field {
  display: none !important;
}

/* Form errors (2.3, slots form_error / form_errors / input_invalid; UiKit form theme and the auth scaffold) */
.nowo-ui-form-error {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--nowo-ui-danger-text);
  font-size: 0.8125rem;
}

.nowo-ui-form-errors {
  margin: 0 0 1rem;
}

.nowo-ui-form-errors > ul {
  margin: 0;
  padding: 0.6rem 0.85rem;
  list-style: none;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-danger-border);
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-danger-bg);
  color: var(--nowo-ui-danger-text);
  font-size: 0.875rem;
}

.nowo-ui-input--invalid:not(.form-control) {
  border-color: var(--nowo-ui-danger);
}

.nowo-ui-danger-zone {
  padding: 0.75rem 1rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-danger-border);
  border-radius: var(--nowo-ui-radius);
}

.nowo-ui-danger-zone__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--nowo-ui-danger-text);
}

.nowo-ui-danger-zone__intro {
  margin: 0 0 0.75rem;
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

/*
 * KPI tile as one link (View\KpiTile::linkTile, slot kpi_link). Zero specificity (:where), so host link colours /
 * hover set through the kpi_link slot classes (or any host rule) win.
 */
:where(a.nowo-ui-kpi--link) {
  display: block;
  color: inherit;
  text-decoration: none;
}

:where(a.nowo-ui-kpi--link):hover,
:where(a.nowo-ui-kpi--link):focus-visible {
  border-color: var(--nowo-ui-primary);
}

:where(a.nowo-ui-kpi--link):focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring, var(--nowo-ui-primary));
  outline-offset: 2px;
}

/* List filter field widths (View\FilterField::width) */
.nowo-ui-filters__field--xs {
  flex: 0 1 8rem;
}

.nowo-ui-filters__field--sm {
  flex: 0 1 12rem;
}

.nowo-ui-filters__field--md {
  flex: 0 1 18rem;
}

.nowo-ui-filters__field--lg {
  flex: 1 1 26rem;
}

.nowo-ui-filters__field--full {
  flex: 1 1 100%;
}

.nowo-ui-filters__submit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Page-header actions at the end of the filter row (ListPage::headerActionsInFilters): right after the filter
 * actions, in the same group (the group does not grow; hosts whose filter fields grow add `flex-none` to the
 * filters_actions slot to keep the group on one line). */
.nowo-ui-filters__header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/*
 * Responsive list tables (page/list.html.twig, ListPage::responsive = cards): the table wrap is a size container;
 * Column::priority 3 / 2 columns hide below 60rem / 48rem of table width, and below 40rem every row becomes a card
 * of labelled cells (td[data-label]). CSS only.
 */
.nowo-ui-table-wrap[data-nowo-ui-responsive='cards'] {
  container: nowo-ui-table / inline-size;
}

@container nowo-ui-table (max-width: 59.99rem) {
  .nowo-ui-table--cards [data-nowo-ui-priority='3'] {
    display: none;
  }
}

@container nowo-ui-table (max-width: 47.99rem) {
  .nowo-ui-table--cards [data-nowo-ui-priority='2'] {
    display: none;
  }
}

@container nowo-ui-table (max-width: 39.99rem) {
  .nowo-ui-table--cards,
  .nowo-ui-table--cards > tbody,
  .nowo-ui-table--cards > tbody > tr,
  .nowo-ui-table--cards > tbody > tr > td {
    display: block;
    width: 100%;
  }

  .nowo-ui-table--cards > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .nowo-ui-table--cards > caption {
    display: block;
    text-align: start;
  }

  .nowo-ui-table--cards > tbody > tr {
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-table-border, var(--nowo-ui-border));
    border-radius: var(--nowo-ui-radius);
    background: var(--nowo-ui-surface);
  }

  .nowo-ui-table--cards > tbody > tr > td {
    box-sizing: border-box; /* its width is 100%, and its padding must stay inside */
    display: grid;
    grid-template-columns: minmax(6rem, 40%) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.4rem 0;
    text-align: start;
    overflow-wrap: anywhere;
  }

  .nowo-ui-table--cards > tbody > tr > td:last-child {
    border-bottom: 0;
  }

  /* 2.34: the <tfoot> of the `table` partial stacks as one block under the cards, its cells side by side */
  .nowo-ui-table--cards > tfoot {
    display: block;
    width: 100%;
  }

  .nowo-ui-table--cards > tfoot > tr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    padding: 0.25rem 0.75rem;
  }

  .nowo-ui-table--cards > tfoot > tr > :is(td, th) {
    display: block;
    padding: 0.25rem 0;
    overflow-wrap: anywhere;
  }

  .nowo-ui-table--cards > tbody > tr > td[data-label]::before {
    content: attr(data-label);
    pointer-events: none; /* drawn over the row's start: taps belong to the value */
    color: var(--nowo-ui-muted);
    font-weight: 600;
  }

  .nowo-ui-table--cards > tbody > tr > td:not([data-label]),
  .nowo-ui-table--cards > tbody > tr > td.nowo-ui-table__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .nowo-ui-table--cards > tbody > tr > td.nowo-ui-table__actions:not(.nowo-ui-cell--start, .nowo-ui-cell--center) .nowo-ui-row-actions {
    justify-content: flex-end;
  }

  /* 2.11 (re-audit OVR-11): the actions column loses its `width: 1%; white-space: nowrap` (the row actions collapsed
   * into a narrow column drawn over the previous cell) and its actions wrap. */
  .nowo-ui-table--cards > tbody > tr > td.nowo-ui-table__actions {
    width: 100%;
    white-space: normal;
  }

  .nowo-ui-table--cards > tbody > tr > td.nowo-ui-table__actions > .nowo-ui-row-actions {
    flex-wrap: wrap;
  }

  /* 2.11: a labelled cell with several children (icon + text, value + badges) or bare text spilled into the label
   * column of the label | value grid: the label is positioned instead and the value flows in the remaining width.
   * !important beats an inline indentation (DashboardMenu indents tree cells with an inline padding). */
  .nowo-ui-table--cards > tbody > tr > td[data-label]:not(.nowo-ui-table__actions) {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-inline-start: calc(40% + 0.75rem) !important;
    /* A right-aligned (numeric) column keeps its value and label at the start in a card */
    text-align: start;
  }

  .nowo-ui-table--cards > tbody > tr > td[data-label]:not(.nowo-ui-table__actions)::before {
    position: absolute;
    inset-inline-start: 0;
    width: 40%;
  }

  /* Inline content (badges, links, icons) keeps its own width inside the label | value grid */
  .nowo-ui-table--cards > tbody > tr > td > * {
    justify-self: start;
    max-width: 100%;
  }

  .nowo-ui-table--cards > tbody > tr > td.nowo-ui-table__actions > * {
    justify-self: stretch;
  }

  /* Inside a bordered panel (table_wrap slot class nowo-ui-table-wrap--flush): rows become divided sections, no
     second border around each card */
  .nowo-ui-table-wrap--flush > .nowo-ui-table--cards > tbody > tr {
    margin-bottom: 0;
    padding-inline: 0;
    border: 0;
    border-bottom: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-table-border, var(--nowo-ui-border));
    border-radius: 0;
    background: transparent;
  }

  .nowo-ui-table-wrap--flush > .nowo-ui-table--cards > tbody > tr:last-child {
    border-bottom: 0;
  }

  .nowo-ui-table--cards > tbody > tr > td[data-nowo-ui-priority] {
    display: grid;
  }
}

.nowo-ui-empty__title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.nowo-ui-empty__message {
  margin: 0;
}

.nowo-ui-empty__action {
  margin-top: 0.75rem;
}

/* =============================================================================================
 * 2.2 — default-theme polish (semantic classes, tokens with fallbacks; no markup needed beyond the 2.x slots).
 * ============================================================================================= */

/* Solid destructive button (slot btn_danger_solid: the confirm button of a danger Confirm) */
.nowo-ui-btn--danger.nowo-ui-btn--solid {
  background: var(--nowo-ui-btn-danger-solid-bg, var(--nowo-ui-danger-solid));
  border-color: var(--nowo-ui-btn-danger-solid-bg, var(--nowo-ui-danger-solid));
  color: var(--nowo-ui-btn-danger-solid-text, var(--nowo-ui-danger-contrast));
}

.nowo-ui-btn--danger.nowo-ui-btn--solid:not(.btn):hover {
  background: var(--nowo-ui-btn-danger-solid-hover-bg, color-mix(in srgb, var(--nowo-ui-danger-solid) 85%, var(--nowo-ui-text)));
  border-color: var(--nowo-ui-btn-danger-solid-hover-bg, color-mix(in srgb, var(--nowo-ui-danger-solid) 85%, var(--nowo-ui-text)));
  color: var(--nowo-ui-btn-danger-solid-text, var(--nowo-ui-danger-contrast));
}

.nowo-ui-btn--danger.nowo-ui-btn--solid:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* One primary colour: plain links inside UiKit regions follow --nowo-ui-link / --nowo-ui-primary (zero specificity:
   any host link rule wins) */
:where(.nowo-ui-content, .nowo-ui-card, .nowo-ui-dialog, .nowo-ui-confirm, .nowo-ui-detail-list) :where(a:not([class])) {
  color: var(--nowo-ui-link, var(--nowo-ui-primary));
  text-underline-offset: 2px;
}

:where(.nowo-ui-content, .nowo-ui-card, .nowo-ui-dialog, .nowo-ui-confirm, .nowo-ui-detail-list) :where(a:not([class])):hover {
  color: var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary)));
}

/* Badges sit flush at the start of cells, values and lists (the 1.x offset after inline text stays) */
:is(.nowo-ui-table td, .nowo-ui-detail-list__value, .nowo-ui-kpi, .nowo-ui-card__header, li) > .nowo-ui-badge:first-child {
  margin-left: 0;
}

/* List tables: header row hierarchy (scaffold head cells, slot table_head_cell) */
.nowo-ui-table > thead > tr > th.nowo-ui-table__head-cell {
  font-size: var(--nowo-ui-table-head-size, 0.75rem);
  font-weight: var(--nowo-ui-table-head-weight, 600);
  letter-spacing: var(--nowo-ui-table-head-tracking, 0.04em);
  text-transform: var(--nowo-ui-table-head-transform, uppercase);
  color: var(--nowo-ui-table-head-text, var(--nowo-ui-muted));
  border-bottom: var(--nowo-ui-table-head-border-width, 2px) solid var(--nowo-ui-table-head-border, var(--nowo-ui-border-strong));
  white-space: nowrap;
  vertical-align: bottom;
}

.nowo-ui-table__head-cell .nowo-ui-sort {
  color: inherit;
}

.nowo-ui-table__head-cell .nowo-ui-sort:hover {
  color: var(--nowo-ui-sort-hover, var(--nowo-ui-link-hover, var(--nowo-ui-link, var(--nowo-ui-primary))));
}

/* Zebra rows on the kit-painted stacks: the cells are painted too, so a cell background never hides the stripe
   (Bootstrap stripes through its own table-striped, added by the table slot) */
.nowo-ui-table--striped:not(.table) > tbody > tr:nth-child(even) > td {
  background-color: var(--nowo-ui-table-stripe-bg, var(--nowo-ui-surface-muted));
}

.nowo-ui-table:not(.table) > tbody > tr:hover > td {
  background-color: var(--nowo-ui-table-hover-bg, color-mix(in srgb, var(--nowo-ui-primary) 5%, var(--nowo-ui-surface)));
}

/* <caption> (slot table_caption): left, muted, small, above the table; ListPage::captionVisible = false hides it
   visually (kept for assistive tech) */
.nowo-ui-table__caption {
  caption-side: top;
  padding: 0 0 0.5rem;
  text-align: start;
  color: var(--nowo-ui-muted);
  font-size: 0.8125rem;
}

/* Vertical rhythm of the list scaffold: filters, table, pagination summary and what follows */
.nowo-ui-list-page {
  margin-bottom: 1.5rem;
}

.nowo-ui-list-page > .nowo-ui-pagination {
  margin-top: 1rem;
}

.nowo-ui-list-page > .nowo-ui-table-wrap + .nowo-ui-pagination,
.nowo-ui-list-page > .nowo-ui-table-wrap + .nowo-ui-list-page__confirms + .nowo-ui-pagination {
  margin-top: 1rem;
}

/* Forms: help text muted under its field, regular spacing between stacked rows (pages, cards and dialogs) */
:where(.nowo-ui-form, .nowo-ui-filters, .nowo-ui-dialog__body, .nowo-ui-confirm__body) :where(.help-text, .form-text, [id$='_help']) {
  display: block;
  margin-top: 0.25rem;
  color: var(--nowo-ui-help-text, var(--nowo-ui-muted));
  font-size: 0.8125rem;
}

/* 2.5: one spacing system for every form row. The form is a flex column whose gap is the row gap (no sibling
   margins, so a host gap on the `form` slot replaces it instead of adding to it); the actions row sits
   --nowo-ui-form-actions-gap below the last row; labels (.form-label / .nowo-ui-form__label) sit
   --nowo-ui-form-label-gap above their control; side-by-side fields (slot form_columns) use
   --nowo-ui-form-column-gap between columns. */
:where(form.nowo-ui-form, .nowo-ui-dialog__body form) {
  display: flex;
  flex-direction: column;
  gap: var(--nowo-ui-form-row-gap, 1rem);
}

/* A bare button / link directly in the form keeps its own width (flex items stretch otherwise) */
:where(form.nowo-ui-form, .nowo-ui-dialog__body form) > :where(button, a, input[type="submit"], input[type="button"]) {
  align-self: flex-start;
}

/* Dialog bodies without a form element: stacked rows as before */
.nowo-ui-dialog__body > :where(div, fieldset) + :where(div, fieldset) {
  margin-top: var(--nowo-ui-form-row-gap, 1rem);
}

:where(* + .nowo-ui-form__actions) {
  margin-top: var(--nowo-ui-form-actions-gap, 1rem);
}

/* Bootstrap's form theme puts `mb-3` (1rem, `!important`) on every row and flex items do not collapse margins: the
   gap gives that rem back instead of adding to it, so the space between rows stays --nowo-ui-form-row-gap */
:where(form.nowo-ui-form, .nowo-ui-dialog__body form):has(> .mb-3) {
  gap: max(0px, calc(var(--nowo-ui-form-row-gap, 1rem) - 1rem));
}

/* …and the `mb-3` of a last row no longer collapses through the form's bottom into what follows (e.g. the actions row
   of a settings section rendered after `</form>`): give it back */
:where(form.nowo-ui-form, .nowo-ui-dialog__body form):has(> .mb-3:nth-last-child(1 of :not([type="hidden"]))) {
  margin-bottom: -1rem;
}

/* A flex item does not let the bottom margin of its last descendants collapse through it (it did in the 2.4 block
   flow, inside the row margin, e.g. Bootstrap's `.form-check` 0.125rem): trim it so a row is as tall as before */
:where(form.nowo-ui-form, .nowo-ui-dialog__body form) > :where(:not(fieldset)) > :where(:last-child),
:where(form.nowo-ui-form, .nowo-ui-dialog__body form) > :where(:not(fieldset)) > :where(:last-child) > :where(:last-child) {
  margin-bottom: 0;
}

:where(form.nowo-ui-form, .nowo-ui-dialog__body form) > .nowo-ui-form__actions {
  margin-top: calc(var(--nowo-ui-form-actions-gap, 1rem) - var(--nowo-ui-form-row-gap, 1rem));
}

:where(form.nowo-ui-form, .nowo-ui-dialog__body form) :where(.form-label, .nowo-ui-form__label) {
  display: inline-block;
  margin-bottom: var(--nowo-ui-form-label-gap, 0.5rem);
}

.nowo-ui-form__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--nowo-ui-form-column-min, 12rem), 100%), 1fr));
  gap: var(--nowo-ui-form-row-gap, 1rem) var(--nowo-ui-form-column-gap, 1rem);
}

/* Second tab level (slot tabs_secondary): pills / sub-nav, visibly below the area nav */
.nowo-ui-tabs--secondary {
  gap: var(--nowo-ui-tabs-secondary-gap, 0.35rem);
  border-bottom: 0;
}

.nowo-ui-tabs--secondary > .nowo-ui-tabs__item {
  margin-bottom: 0;
  padding: 0.35rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--nowo-ui-tab-pill-radius, 999px);
  font-size: 0.875rem;
}

.nowo-ui-tabs--secondary > .nowo-ui-tabs__item:not(.nowo-ui-tabs__item--active):not(.is-active):hover {
  background: var(--nowo-ui-tab-pill-hover-bg, var(--nowo-ui-surface-muted));
}

.nowo-ui-tabs--secondary > :is(.nowo-ui-tabs__item--active, .nowo-ui-tabs__item.is-active) {
  border-color: var(--nowo-ui-tab-pill-active-border, color-mix(in srgb, var(--nowo-ui-primary) 35%, var(--nowo-ui-surface)));
  background: var(--nowo-ui-tab-pill-active-bg, color-mix(in srgb, var(--nowo-ui-primary) 12%, var(--nowo-ui-surface)));
  color: var(--nowo-ui-tab-pill-active-text, color-mix(in srgb, var(--nowo-ui-primary) 75%, var(--nowo-ui-text)));
}

/* Wizard step links (done steps): the step pill is the affordance, no underlined link inside it */
.nowo-ui-wizard-steps__item > a {
  color: inherit;
  text-decoration: none;
}

.nowo-ui-wizard-steps__item > a:hover {
  color: var(--nowo-ui-link, var(--nowo-ui-primary));
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Tooltip wrapper of a disabled action with Action::title (a disabled control shows no tooltip of its own) */
.nowo-ui-action__tip {
  display: inline-flex;
  cursor: not-allowed;
}

/* Progress (partial `progress`, slots progress / progress_meter): label, native <progress>, value */
.nowo-ui-progress-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin: 0 0 1rem;
}

.nowo-ui-progress-field__label {
  grid-column: 1 / -1;
  color: var(--nowo-ui-muted);
  font-size: 0.875rem;
}

.nowo-ui-progress-field__value {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--nowo-ui-muted);
}

.nowo-ui-progress-meter {
  width: 100%;
  height: var(--nowo-ui-progress-height, 0.5rem);
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
  background: var(--nowo-ui-progress-track, var(--nowo-ui-surface-muted));
  accent-color: var(--nowo-ui-progress-bar, var(--nowo-ui-primary));
}

.nowo-ui-progress-meter::-webkit-progress-bar {
  background: var(--nowo-ui-progress-track, var(--nowo-ui-surface-muted));
}

.nowo-ui-progress-meter::-webkit-progress-value {
  background: var(--nowo-ui-progress-bar, var(--nowo-ui-primary));
  border-radius: 999px;
}

.nowo-ui-progress-meter::-moz-progress-bar {
  background: var(--nowo-ui-progress-bar, var(--nowo-ui-primary));
  border-radius: 999px;
}

.nowo-ui-progress-field--indeterminate .nowo-ui-progress-meter {
  grid-column: 1 / -1;
}

/* Row-actions column: as narrow as its buttons and never stacked (cells shrink to min-content otherwise) */
.nowo-ui-table :is(th, td).nowo-ui-table__actions {
  width: 1%;
  white-space: nowrap;
}

.nowo-ui-table td.nowo-ui-table__actions > .nowo-ui-row-actions {
  flex-wrap: nowrap;
}

/* Locale tabs (2.5, partial `locale_tabs`): stacked fieldsets without JS, tabs once nowo-ui-tabs.js upgrades the root */
.nowo-ui-locale-tabs {
  display: grid;
  gap: var(--nowo-ui-locale-tabs-gap, 0.75rem);
  min-width: 0;
}

.nowo-ui-locale-tabs > .nowo-ui-locale-tabs__nav {
  margin-bottom: 0;
}

.nowo-ui-locale-tabs > [data-nowo-ui-tabs-list][hidden],
.nowo-ui-locale-tabs > [data-nowo-ui-tabs-panel][hidden] {
  display: none !important;
}

.nowo-ui-locale-tabs__nav > [role="tab"] {
  align-items: center;
  gap: 0.25rem;
  border-width: 0 0 2px;
  border-style: solid;
  border-color: transparent;
  font: inherit;
  cursor: pointer;
}

.nowo-ui-locale-tabs__nav > [role="tab"].nowo-ui-tabs__item {
  background: var(--nowo-ui-tab-bg, transparent);
}

.nowo-ui-locale-tabs__nav > [role="tab"][aria-selected="true"].nowo-ui-tabs__item {
  border-bottom-color: var(--nowo-ui-tab-active-border, var(--nowo-ui-primary));
}

.nowo-ui-locale-tabs__nav > [role="tab"][data-invalid],
.nowo-ui-locale-tabs__marker--invalid {
  color: var(--nowo-ui-danger);
}

.nowo-ui-locale-tabs__marker {
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1;
}

.nowo-ui-locale-tabs__marker--default {
  color: var(--nowo-ui-locale-tabs-default, var(--nowo-ui-primary));
}

.nowo-ui-locale-tabs__fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.nowo-ui-locale-tabs:not([data-nowo-ui-tabs-ready])[data-nowo-ui-tabs-upgrade] > .nowo-ui-locale-tabs__panel > .nowo-ui-locale-tabs__fieldset {
  padding: 0.75rem 1rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
}

.nowo-ui-locale-tabs__legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  float: none;
  width: auto;
  margin: 0 0 0.5rem;
  padding: 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.nowo-ui-locale-tabs__legend > .nowo-ui-locale-tabs__code {
  color: var(--nowo-ui-muted);
  font-weight: 500;
}

.nowo-ui-locale-tabs[data-nowo-ui-tabs-ready] > .nowo-ui-locale-tabs__panel > .nowo-ui-locale-tabs__fieldset > .nowo-ui-locale-tabs__legend,
.nowo-ui-locale-tabs:not([data-nowo-ui-tabs-upgrade]) > .nowo-ui-locale-tabs__panel > .nowo-ui-locale-tabs__fieldset > .nowo-ui-locale-tabs__legend {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --------------------------------------------------------------------------------------------------------------------
 * 2.6 — skip link, kit error pages, confirm dialog wrapper, app shell burger glyphs, compact pagination
 * ------------------------------------------------------------------------------------------------------------------ */

/* Skip link (REQ-A11Y-002): off-screen until focused, then a visible pill in the top-left corner. */
.nowo-ui-skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.5rem 0.875rem;
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  box-shadow: var(--nowo-ui-shadow-dialog, 0 8px 24px rgba(15, 23, 42, 0.18));
  transform: translateY(calc(-100% - 3rem));
  transition: transform 0.15s ease;
}

.nowo-ui-skip-link:focus,
.nowo-ui-skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: 2px;
}

/* Error pages (@NowoUiKit/error/*): one centred card, the code large and muted, illustration on top. */
.nowo-ui-error-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  color: var(--nowo-ui-text);
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-error-page__top {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0;
}

.nowo-ui-error-page__main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem 3rem;
}

.nowo-ui-error-page__main:focus {
  outline: none;
}

.nowo-ui-error-page__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 36rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--nowo-ui-surface);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
}

.nowo-ui-error-page__figure {
  margin: 0 0 1rem;
}

.nowo-ui-error-page__img {
  display: block;
  width: 100%;
  max-width: 28rem;
  height: auto;
  margin: 0 auto;
}

.nowo-ui-error-page__code {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--nowo-ui-muted);
}

.nowo-ui-error-page__title {
  margin: 0.5rem 0;
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: 1.5rem;
  line-height: 1.25;
}

.nowo-ui-error-page__lead {
  margin: 0 0 0.75rem;
}

.nowo-ui-error-page__hint {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--nowo-ui-muted);
}

.nowo-ui-error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* Confirm dialog wrapper (partial `confirm_dialog`): the native <dialog> box of the kit dialogs. 2.29: the dialog
   width (medium; lg / xl / wide = wide). 2.31: the content's height; a free `form` panel scrolls as a whole under
   100dvh - 2rem, the anatomy (`anatomy: true`) is capped at the size's height with only the body scrolling. With the
   fill token at 1 (2.29 / 2.30) a free panel with a field, list, table or fold is at least the size's height
   (min-height: a host panel inside the box, e.g. a taller wide one, still fits) and the anatomy has exactly it. */
.nowo-ui-confirm-dialog {
  box-sizing: border-box;
  width: var(--nowo-ui-dialog-w);
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1.25rem;
  overflow: auto;
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-modal-radius, var(--nowo-ui-radius));
  box-shadow: var(--nowo-ui-shadow-dialog, 0 16px 40px rgba(15, 23, 42, 0.2));
}

.nowo-ui-confirm-dialog:not([open]) {
  display: none !important;
}

.nowo-ui-confirm-dialog::backdrop {
  background: var(--nowo-ui-overlay, rgba(15, 23, 42, 0.45));
}

/* Opt-out of the kit box (2.6.1): `dialog_modifier: 'nowo-ui-confirm-dialog--plain'` for hosts whose <dialog> is a
 * transparent frame around their own panel. Keeps the closed-state hide and the backdrop. */
.nowo-ui-confirm-dialog.nowo-ui-confirm-dialog--plain {
  width: auto;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.nowo-ui-confirm-dialog[open]:not(.nowo-ui-confirm-dialog--plain):not(.nowo-ui-confirm-dialog--anatomy):has(input:not([type='hidden']), select, textarea, table, ul, ol, details) {
  min-height: calc(var(--nowo-ui-dialog-h) * clamp(0, var(--nowo-ui-dialog-fill, 0), 1));
}

/* Header / body / footer anatomy (2.29, `anatomy: true` of the confirm_dialog partial): the dialog classes, no box padding */
.nowo-ui-confirm-dialog.nowo-ui-confirm-dialog--anatomy {
  max-height: var(--nowo-ui-dialog-max-h);
  padding: 0;
}

.nowo-ui-confirm-dialog--anatomy > .nowo-ui-dialog__footer:not(:has(*)) {
  display: none;
}

/* App shell burger (@NowoUiKit/shell/_burger, icon: morph): the static glyph of the state paints before JS (menu when
 * the aside is hidden, X when it is shown), the <morph-icon> replaces it once hydrated (.is-morph-ready). */
.nowo-ui-app-shell__burger.is-morph-ready .nowo-ui-burger__icon,
.nowo-ui-app-shell__burger:not(.is-morph-ready) .nowo-ui-burger__morph,
.nowo-ui-app-shell__burger:not(.is-morph-ready):not([data-nowo-ui-burger-glyph='close']) .nowo-ui-burger__icon--close {
  display: none !important;
}

/* The X only stands for a fully expanded aside (data-nowo-ui-burger-glyph="close", rendered server side): never in the
 * icons rail, and never on phones, where the drawer starts closed whatever the desktop state is (2.6.1). */
@media (min-width: 901px) {
  .nowo-ui-app-shell__burger[data-nowo-ui-burger-glyph='close']:has(.nowo-ui-burger__icon--close):not(.is-morph-ready) .nowo-ui-burger__icon--open {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .nowo-ui-app-shell__burger:not(.is-morph-ready) .nowo-ui-burger__icon--close {
    display: none !important;
  }
}

.nowo-ui-burger__morph {
  display: inline-flex;
}

/* 2.33 (UI-4) morph swap for host toggles: a static icon (.nowo-ui-morph-swap__static) until the morph-icon is
 * hydrated, then only the morph-icon (.nowo-ui-morph-swap__morph, a real box of --nowo-ui-morph-size). The host element
 * carries .nowo-ui-morph-swap; the morphicons helpers add .is-morph-ready. !important inside the kit layer, so hosts
 * need none (a layered !important beats an unlayered one). */
.nowo-ui-morph-swap .nowo-ui-morph-swap__morph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  inline-size: var(--nowo-ui-morph-size, 1em);
  block-size: var(--nowo-ui-morph-size, 1em);
  color: inherit;
  line-height: 0;
}

.nowo-ui-morph-swap.is-morph-ready .nowo-ui-morph-swap__static,
.nowo-ui-morph-swap:not(.is-morph-ready) .nowo-ui-morph-swap__morph {
  display: none !important;
}

/* Compact pagination (View\Pagination variant `compact`): « Page n of m » + per-page select. */
.nowo-ui-pagination--compact .nowo-ui-pagination__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nowo-ui-pagination__page {
  font-size: 0.875rem;
  color: var(--nowo-ui-muted);
  white-space: nowrap;
}

.nowo-ui-pagination__per-page-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.nowo-ui-pagination__per-page-form .nowo-ui-pagination__info {
  margin: 0;
}

.nowo-ui-pagination__select {
  width: auto;
  min-height: 2rem;
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--nowo-ui-text);
  background-color: var(--nowo-ui-surface);
  border: 1px solid var(--nowo-ui-border-strong, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-radius);
}

/*
 * 2.23 pagination modes (View\Pagination mode infinite | responsive, `list-pagination` Stimulus peer): the "Load
 * more" region under the list (hidden until the peer shows it), the scroll sentinel and the loading state.
 */
.nowo-ui-pagination__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.nowo-ui-pagination__more[hidden],
[data-nowo-ui-pagination-mode] > .nowo-ui-pagination__nav[hidden] {
  display: none !important;
}

.nowo-ui-pagination__sentinel {
  display: block;
  width: 100%;
  height: 1px;
}

[data-nowo-ui-pagination-loading] .nowo-ui-pagination__more [data-nowo-ui-pagination-more] {
  cursor: progress;
  opacity: 0.7;
}

/* 2.23 visible-when peer: a row hidden for the current provider stays hidden whatever display its row class sets */
[data-nowo-ui-visible-when-field][hidden] {
  display: none !important;
}

/* =============================================================================================
 * 2.21 — detail page patterns (opt-in: PageHeader::status / actionsLayout split, ShowPage::stats,
 * DetailSection::layout facts, menu `square` / `menu_items`). Tokens: --nowo-ui-header-actions-gap,
 * --nowo-ui-stat-*, --nowo-ui-detail-facts-* (light / dark through the base tokens).
 * ============================================================================================= */

/* Title + status badge on one row (only rendered with PageHeader::status) */
.nowo-ui-page-header__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  min-width: 0;
}

.nowo-ui-page-header__title-row > .nowo-ui-page-header__title {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.nowo-ui-page-status {
  flex: none;
}

/* Split header actions: icon buttons, the primary button, the square "more" menu */
.nowo-ui-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nowo-ui-header-actions-gap, 0.35rem);
  min-width: 0;
}

/* POST actions (form wrappers) stay inline in the row */
.nowo-ui-header-actions > form {
  display: inline-flex;
  margin: 0;
}

/* Square menu toggle: painted by btn_secondary + btn_icon like the icon buttons next to it, so it shares their box */
.nowo-ui-menu__toggle--square {
  justify-content: center;
  cursor: pointer;
}

/* POST / confirm / dialog actions drawn as menu items (menu `menu_items: true`) */
.nowo-ui-menu__entry--item {
  padding: 0;
}

.nowo-ui-menu__entry--item > form {
  display: block;
  margin: 0;
}

/* Key figures row (partial stat_row): compact tiles, label over value */
.nowo-ui-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--nowo-ui-stat-min-width, 6.25rem), 1fr));
  gap: var(--nowo-ui-stat-gap, 0.5rem);
  margin: 0 0 1rem;
}

.nowo-ui-stat {
  min-width: 0;
  padding: var(--nowo-ui-stat-padding, 0.6rem 0.85rem);
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-stat-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-stat-radius, var(--nowo-ui-radius));
  background: var(--nowo-ui-stat-bg, var(--nowo-ui-surface));
}

.nowo-ui-stat__label {
  margin: 0;
  color: var(--nowo-ui-stat-label-color, var(--nowo-ui-muted));
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nowo-ui-stat__value {
  margin: 0.1rem 0 0;
  color: var(--nowo-ui-text);
  font-family: var(--nowo-ui-font-display, inherit);
  font-size: var(--nowo-ui-stat-value-size, 1.375rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.nowo-ui-stat__value > a {
  color: inherit;
}

.nowo-ui-stat__hint {
  margin: 0.15rem 0 0;
  color: var(--nowo-ui-muted);
  font-size: 0.75rem;
}

.nowo-ui-stat--success .nowo-ui-stat__value {
  color: var(--nowo-ui-success-text);
}

.nowo-ui-stat--warning .nowo-ui-stat__value {
  color: var(--nowo-ui-warning-text);
}

.nowo-ui-stat--danger .nowo-ui-stat__value {
  color: var(--nowo-ui-danger-text);
}

.nowo-ui-stat--info .nowo-ui-stat__value {
  color: var(--nowo-ui-info-text);
}

/* Compact details grid (DetailSection::layout facts, detail_list `modifier: 'facts'`): label over value, several per row */
.nowo-ui-detail-list.nowo-ui-detail-list--facts {
  grid-template-columns: repeat(auto-fit, minmax(var(--nowo-ui-detail-facts-min-width, 10rem), 1fr));
  gap: var(--nowo-ui-detail-facts-gap, 0.6rem 1.25rem);
  padding: var(--nowo-ui-detail-facts-padding, 0);
  border: var(--nowo-ui-detail-facts-border-width, 0) solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
}

.nowo-ui-detail-list--facts > .nowo-ui-detail-list__item {
  display: block;
  min-width: 0;
}

.nowo-ui-detail-list--facts .nowo-ui-detail-list__term {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nowo-ui-detail-list--facts .nowo-ui-detail-list__value {
  margin: 0.1rem 0 0;
  font-size: 0.875rem;
}

/*
 * Side panel / drawer (2.25, partials side_panel, side_panel_toggle, side_panel_container): an inline column beside
 * the content on wide screens, an overlay full-height drawer at <= 767 px (or always with data-layout="overlay").
 * Tokens: --nowo-ui-side-panel-width / -bg / -border / -shadow / -backdrop / -z.
 */
.nowo-ui-side-panel-container {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.nowo-ui-side-panel-container__main {
  flex: 1 1 auto;
  min-width: 0;
}

.nowo-ui-side-panel {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex: 0 0 var(--nowo-ui-side-panel-width, 22rem);
  width: var(--nowo-ui-side-panel-width, 22rem);
  max-width: 100%;
  /* 2.27.1: the dynamic viewport height (iOS Safari's toolbars), 100vh where dvh is unknown */
  max-height: 100vh;
  max-height: 100dvh;
  position: sticky;
  top: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--nowo-ui-side-panel-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-text);
  border: 1px solid var(--nowo-ui-side-panel-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-radius, 0.5rem);
}

.nowo-ui-side-panel--start {
  order: -1;
}

.nowo-ui-side-panel[hidden],
.nowo-ui-side-panel__backdrop[hidden],
.nowo-ui-side-panel-toggle__badge[hidden] {
  display: none !important;
}

.nowo-ui-side-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--nowo-ui-side-panel-border, var(--nowo-ui-border));
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}

.nowo-ui-side-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.nowo-ui-side-panel__title:focus-visible,
.nowo-ui-side-panel__close:focus-visible,
.nowo-ui-side-panel-toggle:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: 2px;
}

.nowo-ui-side-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  text-decoration: none;
}

.nowo-ui-side-panel__body {
  flex: 1 1 auto;
  padding: 1rem;
  /* 2.27.1: keep the last controls above the home indicator (needs viewport-fit=cover to be non-zero) */
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.nowo-ui-side-panel__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--nowo-ui-side-panel-z, var(--nowo-ui-z-overlay, 1040));
  background: var(--nowo-ui-side-panel-backdrop, rgb(0 0 0 / 40%));
}

.nowo-ui-side-panel--overlay {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(100%, var(--nowo-ui-side-panel-width, 22rem));
  inset-block-end: auto;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  border-block: 0;
  border-inline-end: 0;
  z-index: calc(var(--nowo-ui-side-panel-z, var(--nowo-ui-z-overlay, 1040)) + 1);
  box-shadow: var(--nowo-ui-side-panel-shadow, 0 0 1.5rem rgb(0 0 0 / 25%));
}

.nowo-ui-side-panel--overlay.nowo-ui-side-panel--start {
  inset-inline-end: auto;
  inset-inline-start: 0;
  border-inline-start: 0;
  border-inline-end: 1px solid var(--nowo-ui-side-panel-border, var(--nowo-ui-border));
}

.nowo-ui-side-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
}

.nowo-ui-side-panel-toggle__icon {
  display: inline-flex;
  line-height: 1;
}

@media (max-width: 767px) {
  .nowo-ui-side-panel-container {
    display: block;
  }

  .nowo-ui-side-panel {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: 100%;
    inset-block-end: auto;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    z-index: calc(var(--nowo-ui-side-panel-z, var(--nowo-ui-z-overlay, 1040)) + 1);
    box-shadow: var(--nowo-ui-side-panel-shadow, 0 0 1.5rem rgb(0 0 0 / 25%));
  }

  .nowo-ui-side-panel--start {
    inset-inline-end: auto;
    inset-inline-start: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nowo-ui-side-panel[data-drawer] {
    animation: nowo-ui-side-panel-in 0.18s ease-out;
  }

  .nowo-ui-side-panel--start[data-drawer],
  .nowo-ui-side-panel[data-drawer]:dir(rtl) {
    animation-name: nowo-ui-side-panel-in-start;
  }

  .nowo-ui-side-panel--start[data-drawer]:dir(rtl) {
    animation-name: nowo-ui-side-panel-in;
  }
}

@keyframes nowo-ui-side-panel-in {
  from {
    transform: translateX(1.5rem);
    opacity: 0;
  }
}

@keyframes nowo-ui-side-panel-in-start {
  from {
    transform: translateX(-1.5rem);
    opacity: 0;
  }
}

/*
 * Side panel drawer breakpoint (2.48, option drawer_below on side_panel / side_panel_container): `lg` docks the panel
 * only from 1200 px, `xl` from 1440 px; below, the same overlay drawer as under 768 px. Without the option nothing
 * changes (md). The container follows its own modifier, or (where :has() is known) its panel's.
 */
@media (max-width: 1199px) {
  .nowo-ui-side-panel-container:is(.nowo-ui-side-panel-container--drawer-lg, .nowo-ui-side-panel-container--drawer-xl, :has(> .nowo-ui-side-panel--drawer-lg, > .nowo-ui-side-panel--drawer-xl)) {
    display: block;
  }

  .nowo-ui-side-panel:is(.nowo-ui-side-panel--drawer-lg, .nowo-ui-side-panel--drawer-xl) {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(100%, var(--nowo-ui-side-panel-width, 22rem));
    inset-block-end: auto;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border-block: 0;
    border-inline-end: 0;
    z-index: calc(var(--nowo-ui-side-panel-z, var(--nowo-ui-z-overlay, 1040)) + 1);
    box-shadow: var(--nowo-ui-side-panel-shadow, 0 0 1.5rem rgb(0 0 0 / 25%));
  }

  .nowo-ui-side-panel--start:is(.nowo-ui-side-panel--drawer-lg, .nowo-ui-side-panel--drawer-xl) {
    inset-inline-end: auto;
    inset-inline-start: 0;
    border-inline-start: 0;
    border-inline-end: 1px solid var(--nowo-ui-side-panel-border, var(--nowo-ui-border));
  }
}

@media (max-width: 1439px) {
  .nowo-ui-side-panel-container:is(.nowo-ui-side-panel-container--drawer-xl, :has(> .nowo-ui-side-panel--drawer-xl)) {
    display: block;
  }

  .nowo-ui-side-panel.nowo-ui-side-panel--drawer-xl {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(100%, var(--nowo-ui-side-panel-width, 22rem));
    inset-block-end: auto;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border-block: 0;
    border-inline-end: 0;
    z-index: calc(var(--nowo-ui-side-panel-z, var(--nowo-ui-z-overlay, 1040)) + 1);
    box-shadow: var(--nowo-ui-side-panel-shadow, 0 0 1.5rem rgb(0 0 0 / 25%));
  }

  .nowo-ui-side-panel--start.nowo-ui-side-panel--drawer-xl {
    inset-inline-end: auto;
    inset-inline-start: 0;
    border-inline-start: 0;
    border-inline-end: 1px solid var(--nowo-ui-side-panel-border, var(--nowo-ui-border));
  }
}

/* Phones keep the full-width drawer of 2.25 whatever the breakpoint. */
@media (max-width: 767px) {
  .nowo-ui-side-panel:is(.nowo-ui-side-panel--drawer-lg, .nowo-ui-side-panel--drawer-xl) {
    width: 100%;
    border: 0;
  }
}

/*
 * Collapsible column rail (2.48, partial rail_toggle, js/nowo-ui-rail.js): the host column
 * ([data-nowo-ui-rail-host]) shrinks to --nowo-ui-rail-width while data-nowo-ui-rail="collapsed"; its
 * [data-nowo-ui-rail-body] parts are display: none (out of the tab order and the accessibility tree), the toggle stays
 * and shows the column's title vertically. The width change is animated only without reduced motion.
 */
[data-nowo-ui-rail-host] {
  min-inline-size: 0;
}

[data-nowo-ui-rail-host][data-nowo-ui-rail='collapsed'] {
  inline-size: var(--nowo-ui-rail-width, 2.75rem);
  max-inline-size: var(--nowo-ui-rail-width, 2.75rem);
  overflow: hidden;
}

[data-nowo-ui-rail-host][data-nowo-ui-rail='collapsed'] [data-nowo-ui-rail-body] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  [data-nowo-ui-rail-host]:not([data-motion='reduce'] *) {
    transition: inline-size var(--nowo-ui-motion-medium, 200ms) ease, max-inline-size var(--nowo-ui-motion-medium, 200ms) ease;
  }
}

.nowo-ui-rail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2rem;
  min-height: 2rem;
  text-decoration: none;
  /* chevron direction: start column, LTR, expanded = pointing to the start (collapse) */
  --nowo-ui-rail-toggle-flip: 1;
}

.nowo-ui-rail-toggle:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: 2px;
}

.nowo-ui-rail-toggle__icon {
  display: inline-flex;
  line-height: 1;
  transform: scaleX(var(--nowo-ui-rail-toggle-flip));
}

.nowo-ui-rail-toggle--end,
.nowo-ui-rail-toggle--start:dir(rtl),
[data-nowo-ui-rail='collapsed'] .nowo-ui-rail-toggle--start:dir(ltr) {
  --nowo-ui-rail-toggle-flip: -1;
}

.nowo-ui-rail-toggle--end:dir(rtl),
[data-nowo-ui-rail='collapsed'] .nowo-ui-rail-toggle--start:dir(rtl),
[data-nowo-ui-rail='collapsed'] .nowo-ui-rail-toggle--end:dir(ltr) {
  --nowo-ui-rail-toggle-flip: 1;
}

[data-nowo-ui-rail='collapsed'] .nowo-ui-rail-toggle--end:dir(rtl) {
  --nowo-ui-rail-toggle-flip: -1;
}

.nowo-ui-rail-toggle__title {
  display: none;
}

[data-nowo-ui-rail-host][data-nowo-ui-rail='collapsed'] .nowo-ui-rail-toggle {
  flex-direction: column;
  padding-block: 0.5rem;
}

[data-nowo-ui-rail-host][data-nowo-ui-rail='collapsed'] .nowo-ui-rail-toggle__title {
  display: inline-block;
  writing-mode: vertical-rl;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/*
 * Page header tabs_inline (2.48): the tabs and the toolbar on one row under the title; the toolbar goes to the end and
 * wraps under the tabs when the row is short.
 */
.nowo-ui-page-header__bar {
  flex: 1 0 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.nowo-ui-page-header__bar > .nowo-ui-page-header__nav {
  flex: 1 1 16rem;
}

.nowo-ui-page-header__bar > :not(.nowo-ui-page-header__nav) {
  flex: 0 0 auto;
  margin-inline-start: auto;
  margin-bottom: 0;
}

/*
 * Reading column and overflow helpers (2.48). `.nowo-ui-readable`: centred, at most --nowo-ui-reading-width (75ch).
 * `[data-nowo-ui-scroll-region]`, and `pre` / `table` inside rendered content (`.nowo-ui-rendered-content` or
 * `[data-nowo-ui-rendered-content]`), scroll sideways instead of widening the page; nothing inside an editable area
 * (`contenteditable` other than "false") is touched. `.nowo-ui-grid-fit`: a one-column grid whose children may shrink
 * below their content (min-width: 0), the fix for a wide code line or table widening a card; set your own
 * grid-template-columns on it for more columns. All at zero specificity: host rules win.
 */
:where(.nowo-ui-readable) {
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: var(--nowo-ui-reading-width, 75ch);
  min-inline-size: 0;
  margin-inline: auto;
}

:where([data-nowo-ui-scroll-region]):not(:where([contenteditable]:not([contenteditable='false'])), :where([contenteditable]:not([contenteditable='false'])) *) {
  max-inline-size: 100%;
  overflow-x: auto;
}

:where(.nowo-ui-rendered-content, [data-nowo-ui-rendered-content]) :where(pre):not(:where([contenteditable]:not([contenteditable='false'])), :where([contenteditable]:not([contenteditable='false'])) *) {
  max-inline-size: 100%;
  overflow-x: auto;
}

:where(.nowo-ui-rendered-content, [data-nowo-ui-rendered-content]) :where(table):not(:where([contenteditable]:not([contenteditable='false'])), :where([contenteditable]:not([contenteditable='false'])) *) {
  display: block;
  inline-size: max-content;
  max-inline-size: 100%;
  overflow-x: auto;
}

:where(.nowo-ui-grid-fit) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-inline-size: 0;
}

:where(.nowo-ui-grid-fit) > * {
  min-inline-size: 0;
}

/*
 * Compact header (2.27, shells' header_context option / nowo_ui_shell_header_context block; partials header_context,
 * header_crumbs, page_actions): the page-actions trigger, the home link and a one-line breadcrumb in the top bar,
 * between its start and end. Nothing here applies without the slot (has-header-context / the new classes).
 * One line at every width, never a horizontal scroll: ancestors shrink first, the current level last (down to
 * --nowo-ui-header-crumbs-current-min). Separators come from a token (never text in the DOM). With
 * js/nowo-ui-header-crumbs.js the middle levels collapse behind "…"; on phones (<= 30rem) only "‹" and the current
 * level show (CSS only, the same without JavaScript).
 * Tokens: --nowo-ui-header-context-gap, --nowo-ui-header-crumbs-font-size / -color / -current-color /
 * -current-weight / -separator / -separator-rtl / -item-max / -current-min / -focus-inset / -panel-bg /
 * -panel-border / -panel-shadow, --nowo-ui-main-padding-top-compact.
 */
.has-header-context > .nowo-ui-header {
  min-width: 0;
}

.has-header-context > .nowo-ui-header > :is(.nowo-ui-header__start, .nowo-ui-header__end) {
  flex: 0 0 auto;
}

.nowo-ui-header__context {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
}

.nowo-ui-header-context {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--nowo-ui-header-context-gap, 0.35rem);
  min-width: 0;
}

.nowo-ui-header-context > :is(.nowo-ui-page-actions, .nowo-ui-header-context__home) {
  flex: 0 0 auto;
}

.nowo-ui-header-context__home {
  text-decoration: none;
}

.nowo-ui-header-crumbs {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  font-size: var(--nowo-ui-header-crumbs-font-size, 0.875rem);
  line-height: 1.5;
}

.nowo-ui-header-crumbs__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: var(--nowo-ui-header-crumbs-focus-inset, 2px);
  list-style: none;
}

/* Ancestors shrink (much) faster than the current level, which keeps --nowo-ui-header-crumbs-current-min; "…" never
   shrinks. Each label ends with an ellipsis when cut and carries its full text in `title`. */
.nowo-ui-header-crumbs__item {
  display: flex;
  flex: 0 100 auto;
  align-items: center;
  min-width: 0;
}

.nowo-ui-header-crumbs__item:not(.nowo-ui-header-crumbs__item--current) {
  max-width: var(--nowo-ui-header-crumbs-item-max, 12rem);
}

.nowo-ui-header-crumbs__item--current {
  flex-shrink: 1;
  min-width: var(--nowo-ui-header-crumbs-current-min, 4rem);
}

.nowo-ui-header-crumbs__item--more {
  flex-shrink: 0;
}

.nowo-ui-header-crumbs__item[hidden] {
  display: none !important;
}

.nowo-ui-header-crumbs__item + .nowo-ui-header-crumbs__item::before {
  content: var(--nowo-ui-header-crumbs-separator, "/");
  flex: 0 0 auto;
  padding-inline: 0.4rem;
  color: var(--nowo-ui-header-crumbs-color, var(--nowo-ui-muted));
}

.nowo-ui-header-crumbs__item + .nowo-ui-header-crumbs__item:dir(rtl)::before {
  content: var(--nowo-ui-header-crumbs-separator-rtl, var(--nowo-ui-header-crumbs-separator, "/"));
}

.nowo-ui-header-crumbs__link,
.nowo-ui-header-crumbs__current,
.nowo-ui-header-crumbs__text {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nowo-ui-header-crumbs__link,
.nowo-ui-header-crumbs__text {
  color: var(--nowo-ui-header-crumbs-color, var(--nowo-ui-muted));
}

.nowo-ui-header-crumbs__link {
  text-decoration: none;
}

.nowo-ui-header-crumbs__link:hover {
  color: var(--nowo-ui-text);
  text-decoration: underline;
}

.nowo-ui-header-crumbs__current {
  color: var(--nowo-ui-header-crumbs-current-color, var(--nowo-ui-text));
  font-weight: var(--nowo-ui-header-crumbs-current-weight, 600);
}

:is(.nowo-ui-header-crumbs__link, .nowo-ui-header-crumbs__more, .nowo-ui-header-crumbs__up):focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: calc(-1 * var(--nowo-ui-header-crumbs-focus-inset, 2px));
  border-radius: calc(var(--nowo-ui-radius) * 0.5);
}

.nowo-ui-header-crumbs__menu {
  display: inline-flex;
}

.nowo-ui-header-crumbs__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 0.35rem;
  border: 0;
  border-radius: calc(var(--nowo-ui-radius) * 0.75);
  background: none;
  color: var(--nowo-ui-header-crumbs-color, var(--nowo-ui-muted));
  font: inherit;
  cursor: pointer;
}

.nowo-ui-header-crumbs__more:hover,
.nowo-ui-header-crumbs__more[aria-expanded="true"] {
  background: var(--nowo-ui-surface-muted);
  color: var(--nowo-ui-text);
}

.nowo-ui-header-crumbs[data-collapsed="true"] .nowo-ui-header-crumbs__item--middle {
  display: none;
}

.nowo-ui-header-crumbs__panel {
  box-sizing: border-box;
  min-width: 10rem;
  max-width: min(22rem, calc(100vw - 1rem));
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  border: 1px solid var(--nowo-ui-header-crumbs-panel-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-header-crumbs-panel-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-text);
  box-shadow: var(--nowo-ui-header-crumbs-panel-shadow, 0 8px 24px rgb(15 23 42 / 12%));
}

.nowo-ui-header-crumbs__panel[popover] {
  position: fixed;
  inset: auto;
  top: 0.5rem;
  left: 0.5rem;
  overflow: visible;
}

.nowo-ui-header-crumbs__panel-link,
.nowo-ui-header-crumbs__panel-text {
  display: block;
  overflow: hidden;
  padding: 0.4rem 0.65rem;
  border-radius: calc(var(--nowo-ui-radius) * 0.75);
  color: var(--nowo-ui-text);
  font-size: var(--nowo-ui-header-crumbs-font-size, 0.875rem);
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nowo-ui-header-crumbs__panel-link:hover,
.nowo-ui-header-crumbs__panel-link:focus-visible {
  background: var(--nowo-ui-surface-muted);
}

.nowo-ui-header-crumbs__panel-link:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: -2px;
}

.nowo-ui-header-crumbs__up {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  min-height: 1.75rem;
  color: var(--nowo-ui-header-crumbs-color, var(--nowo-ui-muted));
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
}

.nowo-ui-header-crumbs__up-glyph:dir(rtl) {
  display: inline-block;
  transform: scaleX(-1);
}

@media (max-width: 30rem) {
  .nowo-ui-header-crumbs__up {
    display: inline-flex;
  }

  .nowo-ui-header-crumbs__item:not(.nowo-ui-header-crumbs__item--current) {
    display: none;
  }

  /* no separator before the lone current level (beats the separator rules, :dir(rtl) included) */
  .nowo-ui-header-crumbs .nowo-ui-header-crumbs__item.nowo-ui-header-crumbs__item--current::before {
    content: none;
  }

  .has-header-context > .nowo-ui-header {
    gap: 0.5rem;
    padding-inline: 0.5rem;
  }
}

/* The page under a compact bar: content right under the bar; a compact page header with nothing visible collapses. */
.nowo-ui-shell.has-header-context .nowo-ui-main {
  padding-block-start: var(--nowo-ui-main-padding-top-compact, 0.75rem);
}

.nowo-ui-page-header--compact .nowo-ui-page-header__text {
  position: relative;
}

.nowo-ui-page-header[data-nowo-ui-page-header-empty] {
  min-height: 0;
  margin: 0;
  padding: 0;
}

/*
 * Page header variants (2.39, UI-6; HeaderPresentation inline | no_intro | no_title | no_header): `inline` lays the
 * intro on the title's row, on one baseline, and wraps it under the title when the row is short
 * (--nowo-ui-page-header-inline-gap, --nowo-ui-page-header-inline-intro-min); the hidden-title variants position the
 * text box, so the visually hidden h1 never widens a scroller. no_intro renders no intro at all.
 */
.nowo-ui-page-header--inline .nowo-ui-page-header__text:has(> .nowo-ui-page-header__intro) {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--nowo-ui-page-header-inline-gap, 0.75rem);
}

.nowo-ui-page-header--inline .nowo-ui-page-header__text:has(> .nowo-ui-page-header__intro) > * {
  flex: 1 1 100%;
}

.nowo-ui-page-header--inline .nowo-ui-page-header__text > :is(.nowo-ui-page-header__title, .nowo-ui-page-header__title-row) {
  flex: 0 1 auto;
  min-width: 0;
  margin-block-end: 0;
}

.nowo-ui-page-header--inline .nowo-ui-page-header__text > .nowo-ui-page-header__intro {
  flex: 1 1 var(--nowo-ui-page-header-inline-intro-min, 16rem);
  min-width: 0;
  margin-block-start: 0;
}

:is(.nowo-ui-page-header--no-title, .nowo-ui-page-header--no-header) :is(.nowo-ui-page-header__text, .nowo-ui-page-header__title-row) {
  position: relative;
}

/*
 * Remote form dialog (2.28, partials/_remote_form_dialog.html.twig, nowo-ui-remote-form-core.ts): the body is a flex
 * column that scrolls between the header and the footer (2.29: the fragment's form actions are moved into the dialog
 * footer); the wide size, and on phones the screen width with a 16 px gutter (--nowo-ui-remote-dialog-phone-inset,
 * 1rem since 2.29; 0 = full screen).
 */
.nowo-ui-dialog--remote-form[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nowo-ui-dialog--remote-form > .nowo-ui-dialog__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.nowo-ui-dialog--remote-form .nowo-ui-dialog__title:focus {
  outline: none;
}

.nowo-ui-dialog--remote-form .nowo-ui-dialog__title:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, var(--nowo-ui-primary));
  outline-offset: 2px;
}

.nowo-ui-remote-form__status {
  margin: 0;
  color: var(--nowo-ui-muted);
}

.nowo-ui-remote-form__alert {
  margin: 0 0 0.75rem;
  color: var(--nowo-ui-danger-text, var(--nowo-ui-danger));
}

@media (max-width: 40rem) {
  .nowo-ui-dialog--remote-form {
    --nowo-ui-dialog-w: calc(100vw - 2 * var(--nowo-ui-remote-dialog-phone-inset, 1rem));
    --nowo-ui-dialog-h: calc(100dvh - 2 * var(--nowo-ui-remote-dialog-phone-inset, 1rem));
    --nowo-ui-dialog-max-h: var(--nowo-ui-dialog-h);
    max-width: none;
    margin: var(--nowo-ui-remote-dialog-phone-inset, 1rem);
    border-radius: var(--nowo-ui-remote-dialog-phone-radius, var(--nowo-ui-modal-radius, var(--nowo-ui-radius)));
  }

  /* 2.34: a remote form side panel (`placement`) keeps the whole screen: the gutter is the centred dialog's */
  .nowo-ui-dialog--remote-form:is(.nowo-ui-dialog--end, .nowo-ui-dialog--start) {
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
  }

  .nowo-ui-dialog--remote-form > .nowo-ui-dialog__footer:last-child,
  .nowo-ui-dialog--remote-form > .nowo-ui-dialog__body:has(+ .nowo-ui-dialog__footer[hidden]) {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

/*
 * Sortable (js/nowo-ui-sortable.js, behaviour only): a handle drags on touch without scrolling; a whole item needs
 * a long press, so a swipe on it still scrolls. The dragged item leaves the flow but stays rendered and focusable until
 * the drop; `!important` because a host rule outside the layer must not bring it back mid-drag.
 */
[data-nowo-ui-sortable-handle],
.nowo-ui-sortable__handle {
  cursor: grab;
  touch-action: none;
}
[data-nowo-ui-sortable-item]:not(:has([data-nowo-ui-sortable-handle])) {
  cursor: grab;
}
[data-nowo-ui-sortable-item].is-dragging {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}
.nowo-ui-sortable__placeholder {
  box-sizing: border-box;
  list-style: none;
  background: var(--nowo-ui-sortable-drop-bg, color-mix(in srgb, var(--nowo-ui-primary) 10%, transparent));
  border: 2px dashed var(--nowo-ui-sortable-drop-line, var(--nowo-ui-primary));
  border-radius: var(--nowo-ui-radius, 0.375rem);
}
[data-nowo-ui-sortable-list].is-drop-target {
  outline: 1px solid var(--nowo-ui-sortable-drop-line, var(--nowo-ui-primary));
  outline-offset: 2px;
}
.nowo-ui-sortable__ghost {
  z-index: var(--nowo-ui-sortable-z, var(--nowo-ui-z-popover, 1080));
  list-style: none;
  box-shadow: var(--nowo-ui-sortable-ghost-shadow, 0 0.5rem 1.5rem rgb(0 0 0 / 25%));
}
html[data-nowo-ui-sortable-active],
html[data-nowo-ui-sortable-active] * {
  cursor: grabbing !important;
  -webkit-user-select: none;
  user-select: none;
}
@media (any-pointer: coarse) {
  /* iOS would open its link and selection callout during the long press. `any-`: a touch laptop's first pointer is fine. */
  [data-nowo-ui-sortable-item]:not(:has([data-nowo-ui-sortable-handle])) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Emoji picker (partial `emoji_picker`, js/nowo-ui-emoji-picker.js): without the script, only the input shows. */
.nowo-ui-emoji-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nowo-ui-emoji-picker > input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.nowo-ui-emoji-picker__toggle {
  flex: none;
}
.nowo-ui-emoji-picker__toggle[hidden],
.nowo-ui-emoji-picker__panel[hidden] {
  display: none !important;
}
.nowo-ui-emoji-picker__panel {
  position: fixed;
  inset: auto;
  z-index: var(--nowo-ui-emoji-picker-z, var(--nowo-ui-z-popover, 1080));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(var(--nowo-ui-emoji-picker-width, 20rem), calc(100vw - 1rem));
  padding: 0.5rem;
  margin: 0;
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 25%);
}
.nowo-ui-emoji-picker__grid {
  flex: 0 1 auto;
  min-height: 0;
  max-height: var(--nowo-ui-emoji-picker-height, 14rem);
  margin-top: 0.5rem;
  overflow-y: auto;
}
.nowo-ui-emoji-picker__row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}
.nowo-ui-emoji-picker__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--nowo-ui-radius);
}
.nowo-ui-emoji-picker__cell:hover {
  background: color-mix(in srgb, var(--nowo-ui-primary) 10%, transparent);
}
.nowo-ui-emoji-picker__cell.is-selected {
  background: color-mix(in srgb, var(--nowo-ui-primary) 15%, transparent);
}
.nowo-ui-emoji-picker__cell.is-active {
  outline: 2px solid var(--nowo-ui-primary);
  outline-offset: -2px;
}
@media (forced-colors: active) {
  .nowo-ui-emoji-picker__cell.is-selected {
    border: 2px solid CanvasText;
  }
}
.nowo-ui-emoji-picker__status {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--nowo-ui-muted) 85%, var(--nowo-ui-text));
}

/* Image crop (js/nowo-ui-image-crop.js, inputs with data-nowo-ui-image-crop): the dialog the script builds. The canvas is sized
   through its attributes; the mask and the frame line are read from these properties, so a theme can set them per mode. */
.nowo-ui-image-crop {
  --nowo-ui-image-crop-mask: rgb(15 23 42 / 60%);
  --nowo-ui-image-crop-frame: rgb(255 255 255 / 95%);
  width: min(var(--nowo-ui-image-crop-width, 32rem), calc(100vw - 2rem));
}
.nowo-ui-image-crop__help {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--nowo-ui-muted);
}
.nowo-ui-image-crop__stage {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 60dvh);
  aspect-ratio: 1;
  margin-inline: auto;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: var(--nowo-ui-surface-muted);
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
}
.nowo-ui-image-crop__stage:active {
  cursor: grabbing;
}
.nowo-ui-image-crop__stage:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}
.nowo-ui-image-crop__canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.nowo-ui-image-crop__zoom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.nowo-ui-image-crop__zoom-label {
  flex: none;
  font-size: 0.875rem;
}
.nowo-ui-image-crop__range {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.75rem;
  accent-color: var(--nowo-ui-primary);
}
.nowo-ui-image-crop__progress {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--nowo-ui-muted);
}
.nowo-ui-image-crop__progress[hidden] {
  display: none !important;
}
.nowo-ui-image-crop__error {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--nowo-ui-danger-text-strong);
}
.nowo-ui-image-crop__error[hidden] {
  display: none !important;
}
@media (forced-colors: active) {
  .nowo-ui-image-crop__stage {
    border-color: CanvasText;
  }
}

/* Image input (2.47, partial `image_input`, FileType option nowo_ui_image_input, js/nowo-ui-image-input.js): one box with the
   stored image, the default (badge) or the local preview. Without the script the file input stays visible; with it
   (`.is-enhanced`) the input is visually hidden and the Replace button opens it. The backdrop shows through transparent art. */
.nowo-ui-image-input {
  --nowo-ui-image-input-size: 12rem;
  --nowo-ui-image-input-backdrop-light: rgb(255 255 255);
  --nowo-ui-image-input-backdrop-dark: rgb(17 24 39);
  --nowo-ui-image-input-checker: color-mix(in srgb, var(--nowo-ui-text) 10%, var(--nowo-ui-surface));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  justify-items: start;
  max-width: 100%;
}
.nowo-ui-image-input__frame {
  position: relative;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: min(100%, var(--nowo-ui-image-input-size));
  min-height: calc(var(--nowo-ui-image-input-size) * 0.5);
  max-height: var(--nowo-ui-image-input-size);
  overflow: hidden;
  border: 1px solid var(--nowo-ui-border);
  border-radius: var(--nowo-ui-radius);
  background-color: var(--nowo-ui-surface);
}
.nowo-ui-image-input--checkerboard .nowo-ui-image-input__frame {
  background-image: conic-gradient(var(--nowo-ui-image-input-checker) 25%, transparent 0 50%, var(--nowo-ui-image-input-checker) 0 75%, transparent 0);
  background-size: 1rem 1rem;
}
.nowo-ui-image-input--light .nowo-ui-image-input__frame {
  background-color: var(--nowo-ui-image-input-backdrop-light);
}
.nowo-ui-image-input--dark .nowo-ui-image-input__frame {
  background-color: var(--nowo-ui-image-input-backdrop-dark);
}
.nowo-ui-image-input__frame.is-dragover {
  border-style: dashed;
  border-color: var(--nowo-ui-primary);
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}
.nowo-ui-image-input__preview {
  display: block;
  max-width: 100%;
  max-height: var(--nowo-ui-image-input-size);
  object-fit: contain;
}
.nowo-ui-image-input__empty {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--nowo-ui-muted);
  text-align: center;
}
.nowo-ui-image-input__badge {
  position: absolute;
  inset-block-start: 0.375rem;
  inset-inline-start: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--nowo-ui-text);
  background: var(--nowo-ui-surface);
  border: 1px solid var(--nowo-ui-border);
  border-radius: 999px;
}
.nowo-ui-image-input__drop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nowo-ui-text);
  text-align: center;
  background: color-mix(in srgb, var(--nowo-ui-surface) 85%, transparent);
}
.nowo-ui-image-input__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}
.nowo-ui-image-input__controls > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.nowo-ui-image-input__preview[hidden],
.nowo-ui-image-input__empty[hidden],
.nowo-ui-image-input__badge[hidden],
.nowo-ui-image-input__drop[hidden],
.nowo-ui-image-input__button[hidden],
.nowo-ui-image-input__remove-field[hidden] {
  display: none !important;
}
.nowo-ui-image-input.is-enhanced .nowo-ui-image-input__file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.nowo-ui-image-input__status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (forced-colors: active) {
  .nowo-ui-image-input__frame,
  .nowo-ui-image-input__badge {
    border-color: CanvasText;
  }
}

/* Show more (partial `show_more`, js/nowo-ui-show-more.js): the fold exists only once the script runs. */
[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nowo-ui-show-more--lines-1[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}
.nowo-ui-show-more--lines-2[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.nowo-ui-show-more--lines-3[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.nowo-ui-show-more--lines-4[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.nowo-ui-show-more--lines-5[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  -webkit-line-clamp: 5;
  line-clamp: 5;
}
.nowo-ui-show-more--lines-6[data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
  -webkit-line-clamp: 6;
  line-clamp: 6;
}
.nowo-ui-show-more__toggle[hidden] {
  display: none !important;
}
@media print {
  [data-nowo-ui-show-more-ready]:not(.is-expanded) > .nowo-ui-show-more__content {
    display: block;
    overflow: visible;
  }
  .nowo-ui-show-more__toggle {
    display: none !important;
  }
}

/* =============================================================================================
 * 2.41 — phone mode (Beacon mobile UX audit 2026-11-09, MUX-01 / 04 / 20 / 22 / 40 / 150 / 161). Everything below
 * applies on touch screens or narrow viewports, or to new opt-in classes / attributes, except the kit select geometry
 * (MUX-40), which every engine gets.
 * ============================================================================================= */

/* MUX-40 — single-line selects. WebKit (Safari, iOS) draws a native `menulist` with its own inner padding inside the
   box the author sizes: with an explicit height (filter bars, toolbars) and the kit padding the text sat below the box
   and its top or bottom half was cut. Kit selects drop the native appearance, keep one line box (line-height 1.25)
   and draw their chevron with two gradients in `currentColor` (light / dark follow the text colour). Hook classes:
   `.nowo-ui-select` (opt-in, any host select, e.g. through FormKit `field_types.choice.attr.class`), and the selects
   the kit already paints (`select.nowo-ui-input`, the pagination per-page select). Bootstrap `.form-select` keeps its
   own chevron. Unlayered host CSS that sets the `background` shorthand on the same select drops the chevron: set
   `background-color` instead. Token: --nowo-ui-select-chevron-gutter (room for the chevron, default 2rem). */
.nowo-ui-select {
  box-sizing: border-box;
  max-width: 100%;
  min-height: var(--nowo-ui-control-height, 2.375rem);
  padding-block: var(--nowo-ui-input-py, 0.35rem);
  padding-inline-start: var(--nowo-ui-input-px, 0.6rem);
  border: 1px solid var(--nowo-ui-input-border, var(--nowo-ui-border-strong));
  border-radius: var(--nowo-ui-input-radius, var(--nowo-ui-radius));
  background-color: var(--nowo-ui-input-bg, var(--nowo-ui-surface));
  color: var(--nowo-ui-input-text, var(--nowo-ui-text));
  font: inherit;
  font-size: var(--nowo-ui-input-font-size, inherit);
}

select.nowo-ui-pagination__select {
  --nowo-ui-select-chevron-gutter: 1.75rem;
}

:is(.nowo-ui-select, select.nowo-ui-input:not(.form-select), select.nowo-ui-pagination__select):not([multiple], [size]) {
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.25;
  padding-inline-end: var(--nowo-ui-select-chevron-gutter, 2rem);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right calc(var(--nowo-ui-select-chevron-gutter, 2rem) / 2 + 0.05rem) center, right calc(var(--nowo-ui-select-chevron-gutter, 2rem) / 2 - 0.25rem) center;
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

:is(.nowo-ui-select, select.nowo-ui-input:not(.form-select), select.nowo-ui-pagination__select):not([multiple], [size]):dir(rtl) {
  background-position: left calc(var(--nowo-ui-select-chevron-gutter, 2rem) / 2 - 0.25rem) center, left calc(var(--nowo-ui-select-chevron-gutter, 2rem) / 2 + 0.05rem) center;
}

/* iOS zooms the page into any focused field under 16px: kit fields keep at least 1rem there. */
@supports (-webkit-touch-callout: none) {
  :is(.nowo-ui-select, .nowo-ui-input, select.nowo-ui-pagination__select) {
    font-size: max(1rem, var(--nowo-ui-input-font-size, 1rem));
  }
}

/* MUX-04 — touch targets. On touch screens the kit's small controls are at least --nowo-ui-control-size-touch tall
   (default 44px; same glyph size, more box). A host opts out with `--nowo-ui-control-size-touch: 0px`. */
@media (pointer: coarse) {
  :root {
    --nowo-ui-control-size-touch: 2.75rem;
  }

  :is(.nowo-ui-btn--icon, .nowo-ui-tabs__item, .nowo-ui-pagination__link, .nowo-ui-sort, .nowo-ui-row-detail-btn, .nowo-ui-burger, .nowo-ui-guest-header__sign-in) {
    min-height: var(--nowo-ui-control-size-touch);
  }

  :is(.nowo-ui-btn--icon, .nowo-ui-pagination__link, .nowo-ui-row-detail-btn, .nowo-ui-burger) {
    min-width: var(--nowo-ui-control-size-touch);
  }
}

/* MUX-161 — no text under --nowo-ui-font-size-min (default 0.75rem = 12px) on phones and touch screens: badges and
   the kit's small meta labels. Other bundles read the same token for their meta text. */
@media (max-width: 40rem), (pointer: coarse) {
  .nowo-ui-badge {
    font-size: max(var(--nowo-ui-font-size-min, 0.75rem), var(--nowo-ui-badge-font-size, 0.75rem));
  }

  :is(.nowo-ui-stat__label, .nowo-ui-detail-list--facts .nowo-ui-detail-list__term, .nowo-ui-avatar--sm) {
    font-size: max(var(--nowo-ui-font-size-min, 0.75rem), 0.6875rem);
  }
}

/* MUX-01 — page-edge tabs launcher (partials/_edge_tabs_launcher + js/nowo-ui-edge-tabs.js). The edge tabs fold behind
   one launcher at the first slot only once the runtime marked <html> ready (no JavaScript: the 2.40 tabs) and only
   for a launcher without `hidden` (2.41.1, JC-I12; host CSS must not hide it where it applies). `when`:
   phone (viewports up to 40rem, touch screens up to 64rem) or always. Open, the tabs stack under the launcher. With
   `gutter`, the folded launcher's width stays free on the right of .nowo-ui-main (and of any host element that reads
   var(--nowo-ui-edge-tabs-gutter, 0)). 2.42 (MUX-01): a tab whose panel is open (`aria-expanded='true'`) or marked
   `data-nowo-ui-edge-tab-pinned` never folds: folded, it keeps its own `top` (slot formula, not the open stacking). */
.nowo-ui-edge-tabs-launcher {
  position: fixed;
  top: var(--nowo-ui-edge-tab-top, calc(var(--nowo-ui-header-height, 3.5rem) + 0.75rem));
  right: 0;
  z-index: var(--nowo-ui-edge-tab-z, 74);
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--nowo-ui-edge-tab-width, 2.25rem);
  height: var(--nowo-ui-edge-tab-height, 2.75rem);
  padding: 0;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-border);
  border-right: 0;
  border-radius: var(--nowo-ui-radius) 0 0 var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
  color: var(--nowo-ui-text);
  box-shadow: -2px 2px 8px rgb(var(--nowo-ui-shadow-rgb, 15 23 42) / 10%);
  font: inherit;
  font-size: var(--nowo-ui-edge-tab-icon, 1.15rem);
  line-height: 1;
  cursor: pointer;
  transition: width 0.15s ease, color 0.15s ease;
}

.nowo-ui-edge-tabs-launcher:hover {
  width: var(--nowo-ui-edge-tab-hover-width, 2.6rem);
  color: var(--nowo-ui-primary);
}

.nowo-ui-edge-tabs-launcher[aria-expanded='true'] {
  color: var(--nowo-ui-primary);
}

/* 2.45: `icon: 'chevron'` — a chevron pointing left while folded turns to point down while open. 2.46: a morph. The
   kit's own inline SVG (two stroke arms, .nowo-ui-edge-tabs-chevron) moves each arm's end points from the left
   chevron to the down chevron with a CSS `d` transition (--nowo-ui-edge-tabs-icon-duration, 240ms, and
   --nowo-ui-edge-tabs-icon-easing, a slight overshoot); closing runs it back. A browser without the CSS `d` property
   rotates the icon instead (the 2.45 turn), with the same tokens. Nothing moves under reduced motion. */
.nowo-ui-edge-tabs-chevron {
  display: block;
  overflow: visible;
}

.nowo-ui-edge-tabs-chevron__arm {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@supports (d: path('M0 0')) {
  .nowo-ui-edge-tabs-chevron__arm {
    transition: d var(--nowo-ui-edge-tabs-icon-duration, 240ms) var(--nowo-ui-edge-tabs-icon-easing, cubic-bezier(0.34, 1.56, 0.64, 1));
  }

  .nowo-ui-edge-tabs-chevron__arm--upper {
    d: path('M15 6L9 12');
  }

  .nowo-ui-edge-tabs-chevron__arm--lower {
    d: path('M9 12L15 18');
  }

  .nowo-ui-edge-tabs-launcher[aria-expanded='true'] .nowo-ui-edge-tabs-chevron__arm--upper {
    d: path('M6 9L12 15');
  }

  .nowo-ui-edge-tabs-launcher[aria-expanded='true'] .nowo-ui-edge-tabs-chevron__arm--lower {
    d: path('M12 15L18 9');
  }
}

@supports not (d: path('M0 0')) {
  .nowo-ui-edge-tabs-launcher--chevron .nowo-ui-edge-tab__icon {
    transition: transform var(--nowo-ui-edge-tabs-icon-duration, 240ms) var(--nowo-ui-edge-tabs-icon-easing, cubic-bezier(0.34, 1.56, 0.64, 1));
  }

  .nowo-ui-edge-tabs-launcher--chevron[aria-expanded='true'] .nowo-ui-edge-tab__icon {
    transform: rotate(-90deg);
  }
}

.nowo-ui-edge-tabs-launcher:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
}

:root[data-nowo-ui-edge-tabs-ready]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])) .nowo-ui-edge-tabs-launcher {
  display: inline-flex;
}

:root[data-nowo-ui-edge-tabs-ready]:not([data-nowo-ui-edge-tabs-open]):has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])) .nowo-ui-edge-tab__link:not([aria-expanded='true'], [data-nowo-ui-edge-tab-pinned], [data-nowo-ui-edge-tabs-folding]) {
  display: none !important;
}

:root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-open]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])) .nowo-ui-edge-tab__link, :root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-closing]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])) .nowo-ui-edge-tab__link[data-nowo-ui-edge-tabs-folding] {
  top: calc(var(--nowo-ui-edge-tab-top, calc(var(--nowo-ui-header-height, 3.5rem) + 0.75rem)) + (var(--nowo-ui-edge-tab-slot, 0) + 1) * var(--nowo-ui-edge-tab-step, calc(var(--nowo-ui-edge-tab-height, 2.75rem) + var(--nowo-ui-edge-tab-gap, 0.5rem))) + var(--nowo-ui-edge-tabs-launcher-gap, 0px));
}

:root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-open]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])) .nowo-ui-edge-tab__link:not([aria-expanded='true'], [data-nowo-ui-edge-tab-pinned]) {
  animation: nowo-ui-edge-tab-unfold var(--nowo-ui-edge-tabs-motion-duration, 260ms) var(--nowo-ui-edge-tabs-motion-easing, cubic-bezier(0.22, 1, 0.36, 1)) calc(var(--nowo-ui-edge-tabs-order, 0) * var(--nowo-ui-edge-tabs-motion-stagger, var(--nowo-ui-edge-tabs-stagger, 30ms))) both;
  transform-origin: 100% 50%;
}

:root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-closing]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])) .nowo-ui-edge-tab__link[data-nowo-ui-edge-tabs-folding] {
  animation: nowo-ui-edge-tab-fold var(--nowo-ui-edge-tabs-motion-duration, 260ms) var(--nowo-ui-edge-tabs-motion-close-easing, var(--nowo-ui-motion-ease-in, ease-in)) calc(var(--nowo-ui-edge-tabs-order, 0) * var(--nowo-ui-edge-tabs-motion-stagger, var(--nowo-ui-edge-tabs-stagger, 30ms))) both;
  transform-origin: 100% 50%;
}

:root[data-nowo-ui-edge-tabs-ready]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])[data-nowo-ui-edge-tabs-gutter]) {
  --nowo-ui-edge-tabs-gutter: var(--nowo-ui-edge-tab-width, 2.25rem);
}

:root[data-nowo-ui-edge-tabs-ready]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='always']:not([hidden])[data-nowo-ui-edge-tabs-gutter]) .nowo-ui-main {
  padding-inline-end: calc(1.25rem + var(--nowo-ui-edge-tabs-gutter));
}

@media (max-width: 40rem), (pointer: coarse) and (max-width: 64rem) {
  :root[data-nowo-ui-edge-tabs-ready]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])) .nowo-ui-edge-tabs-launcher {
    display: inline-flex;
  }

  :root[data-nowo-ui-edge-tabs-ready]:not([data-nowo-ui-edge-tabs-open]):has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])) .nowo-ui-edge-tab__link:not([aria-expanded='true'], [data-nowo-ui-edge-tab-pinned], [data-nowo-ui-edge-tabs-folding]) {
    display: none !important;
  }

  :root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-open]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])) .nowo-ui-edge-tab__link, :root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-closing]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])) .nowo-ui-edge-tab__link[data-nowo-ui-edge-tabs-folding] {
    top: calc(var(--nowo-ui-edge-tab-top, calc(var(--nowo-ui-header-height, 3.5rem) + 0.75rem)) + (var(--nowo-ui-edge-tab-slot, 0) + 1) * var(--nowo-ui-edge-tab-step, calc(var(--nowo-ui-edge-tab-height, 2.75rem) + var(--nowo-ui-edge-tab-gap, 0.5rem))) + var(--nowo-ui-edge-tabs-launcher-gap, 0px));
  }

  :root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-open]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])) .nowo-ui-edge-tab__link:not([aria-expanded='true'], [data-nowo-ui-edge-tab-pinned]) {
    animation: nowo-ui-edge-tab-unfold var(--nowo-ui-edge-tabs-motion-duration, 260ms) var(--nowo-ui-edge-tabs-motion-easing, cubic-bezier(0.22, 1, 0.36, 1)) calc(var(--nowo-ui-edge-tabs-order, 0) * var(--nowo-ui-edge-tabs-motion-stagger, var(--nowo-ui-edge-tabs-stagger, 30ms))) both;
    transform-origin: 100% 50%;
  }

  :root[data-nowo-ui-edge-tabs-ready][data-nowo-ui-edge-tabs-closing]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])) .nowo-ui-edge-tab__link[data-nowo-ui-edge-tabs-folding] {
    animation: nowo-ui-edge-tab-fold var(--nowo-ui-edge-tabs-motion-duration, 260ms) var(--nowo-ui-edge-tabs-motion-close-easing, var(--nowo-ui-motion-ease-in, ease-in)) calc(var(--nowo-ui-edge-tabs-order, 0) * var(--nowo-ui-edge-tabs-motion-stagger, var(--nowo-ui-edge-tabs-stagger, 30ms))) both;
    transform-origin: 100% 50%;
  }

  :root[data-nowo-ui-edge-tabs-ready]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])[data-nowo-ui-edge-tabs-gutter]) {
    --nowo-ui-edge-tabs-gutter: var(--nowo-ui-edge-tab-width, 2.25rem);
  }

  :root[data-nowo-ui-edge-tabs-ready]:has(.nowo-ui-edge-tabs-launcher[data-nowo-ui-edge-tabs-when='phone']:not([hidden])[data-nowo-ui-edge-tabs-gutter]) .nowo-ui-main {
    padding-inline-end: calc(1.25rem + var(--nowo-ui-edge-tabs-gutter));
  }
}

@media print {
  .nowo-ui-edge-tabs-launcher {
    display: none !important;
  }
}

/* 2.45: unfold / fold. Open, each tab slides down from the launcher (opacity and translateY(-step × (slot + 1)) to
   none), one --nowo-ui-edge-tabs-stagger (30ms) later per tab (--nowo-ui-edge-tabs-order, set by the runtime). 2.46:
   softer by default and tunable on its own: --nowo-ui-edge-tabs-motion-duration (260ms), -motion-easing (decelerate,
   cubic-bezier(0.22, 1, 0.36, 1)), -motion-close-easing (ease-in), -motion-scale (from 0.96) and -motion-stagger
   (defaults to --nowo-ui-edge-tabs-stagger, 30ms). Closing
   runs the reverse (the last tab first) while <html> carries data-nowo-ui-edge-tabs-closing, the folding tabs inert
   and aria-hidden; then they are hidden again. No animation under reduced motion. */
@keyframes nowo-ui-edge-tab-unfold {
  from {
    opacity: 0;
    transform: translateY(calc(-1 * (var(--nowo-ui-edge-tab-slot, 0) + 1) * var(--nowo-ui-edge-tab-step, calc(var(--nowo-ui-edge-tab-height, 2.75rem) + var(--nowo-ui-edge-tab-gap, 0.5rem))))) scale(var(--nowo-ui-edge-tabs-motion-scale, 0.96));
  }
}

@keyframes nowo-ui-edge-tab-fold {
  to {
    opacity: 0;
    transform: translateY(calc(-1 * (var(--nowo-ui-edge-tab-slot, 0) + 1) * var(--nowo-ui-edge-tab-step, calc(var(--nowo-ui-edge-tab-height, 2.75rem) + var(--nowo-ui-edge-tab-gap, 0.5rem))))) scale(var(--nowo-ui-edge-tabs-motion-scale, 0.96));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nowo-ui-edge-tab__link:not([data-motion='full'] *) {
    animation: none !important;
  }

  :is(.nowo-ui-edge-tabs-launcher, .nowo-ui-edge-tabs-launcher .nowo-ui-edge-tab__icon, .nowo-ui-edge-tabs-chevron__arm):not([data-motion='full'] *) {
    transition: none;
  }
}

[data-motion='reduce'] .nowo-ui-edge-tab__link {
  animation: none !important;
}

:is([data-motion='reduce'] .nowo-ui-edge-tabs-launcher, [data-motion='reduce'] .nowo-ui-edge-tabs-launcher .nowo-ui-edge-tab__icon, [data-motion='reduce'] .nowo-ui-edge-tabs-chevron__arm) {
  transition: none;
}

/* MUX-20 / MUX-22 — phone cards of the `responsive_table` partial (`phone_layout: 'cards'`; the peer sets
   data-rt-cards in Responsive mode on a phone, and data-rt-label on every row cell). Per column
   data-nowo-ui-phone: primary = the card title (first, no label), meta = a small muted line without a label,
   hide = out of the card. */
.nowo-ui-responsive-table[data-rt-cards] > .nowo-ui-responsive-table__scroller {
  overflow-x: visible;
}

.nowo-ui-responsive-table[data-rt-cards] :is(table, tbody, tr, td) {
  display: block;
  width: 100%;
}

.nowo-ui-responsive-table[data-rt-cards] thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: var(--nowo-ui-border-width, 1px) solid var(--nowo-ui-table-border, var(--nowo-ui-border));
  border-radius: var(--nowo-ui-radius);
  background: var(--nowo-ui-surface);
}

/* A labelled cell: the label sits in the first 38% (positioned), the value — several children too (action buttons,
   badges) — flows in the rest. */
.nowo-ui-responsive-table[data-rt-cards] tbody > tr > td {
  position: relative;
  box-sizing: border-box;
  min-height: 1.5rem;
  padding: 0.3rem 0;
  border: 0;
  text-align: start;
  overflow-wrap: break-word;
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr > td[data-rt-label] {
  padding-inline-start: calc(38% + 0.75rem);
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr > td[data-rt-label]::before {
  content: attr(data-rt-label);
  position: absolute;
  inset-inline-start: 0;
  width: 38%;
  color: var(--nowo-ui-muted);
  font-weight: 600;
  pointer-events: none;
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr > td[data-nowo-ui-phone='primary'] {
  order: -1;
  padding-inline-start: 0;
  font-weight: 600;
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr > td[data-nowo-ui-phone='meta'] {
  padding-inline-start: 0;
  padding-block: 0.125rem;
  color: var(--nowo-ui-muted);
  font-size: max(var(--nowo-ui-font-size-min, 0.75rem), 0.8125rem);
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr > td:is([data-nowo-ui-phone='primary'], [data-nowo-ui-phone='meta'])::before {
  content: none;
}

.nowo-ui-responsive-table[data-rt-cards] tbody > tr > :is(td[data-nowo-ui-phone='hide'], [data-responsive-detail]) {
  display: none;
}

/* MUX-20 — the same places in the ListPage card mode (container under 40rem; Column::phone). A row with such cells
   becomes a flex column, so its primary cell can lead. */
@container nowo-ui-table (max-width: 39.99rem) {
  .nowo-ui-table--cards > tbody > tr:has(> td[data-nowo-ui-phone]) {
    display: flex;
    flex-direction: column;
  }

  .nowo-ui-table--cards > tbody > tr > td[data-nowo-ui-phone='primary'] {
    order: -1;
    font-weight: 600;
  }

  .nowo-ui-table--cards > tbody > tr > td[data-nowo-ui-phone='meta'] {
    color: var(--nowo-ui-muted);
    font-size: max(var(--nowo-ui-font-size-min, 0.75rem), 0.8125rem);
  }

  .nowo-ui-table--cards > tbody > tr > td[data-label]:is([data-nowo-ui-phone='primary'], [data-nowo-ui-phone='meta']):not(.nowo-ui-table__actions) {
    padding-inline-start: 0 !important;
  }

  .nowo-ui-table--cards > tbody > tr > td:is([data-nowo-ui-phone='primary'], [data-nowo-ui-phone='meta'])::before {
    content: none;
  }

  .nowo-ui-table--cards > tbody > tr > td[data-nowo-ui-phone='hide'] {
    display: none !important;
  }
}

/* MUX-150 — guest header (partials/_guest_header, block nowo_ui_guest_header of the guest layout): the brand linked
   home and the sign-in link on public pages. */
.nowo-ui-guest-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 auto 1rem;
  padding: 0.75rem 0;
}

.nowo-ui-guest-header__brand {
  color: var(--nowo-ui-text);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}

a.nowo-ui-guest-header__brand:hover {
  color: var(--nowo-ui-link, var(--nowo-ui-primary));
}

a.nowo-ui-guest-header__brand:focus-visible {
  outline: 2px solid var(--nowo-ui-focus-ring-color, color-mix(in srgb, var(--nowo-ui-primary) 35%, transparent));
  outline-offset: 2px;
  border-radius: 2px;
}

.nowo-ui-guest-header__nav {
  display: flex;
  gap: 0.5rem;
}

/*
 * Motion: one scale for opening and closing (docs/THEMING.md, "Motion"). Zero specificity, so a host's value wins wherever it sets it.
 * Closing is CSS only: state changes at once (`close()`, `hidden`, `hidePopover()`), so focus, Escape, the top layer and scripts see it
 * closed, and `transition-behavior: allow-discrete` keeps it painted while it fades. A browser without it closes at once. No
 * `!important` here. The state rules' `display: none !important` stay: a running transition overrides them, and they still win at rest.
 */
:where(:root) {
  --nowo-ui-motion-small: 150ms;
  --nowo-ui-motion-small-close: 110ms;
  --nowo-ui-motion-medium: 200ms;
  --nowo-ui-motion-medium-close: 150ms;
  --nowo-ui-motion-ease-out: cubic-bezier(0.2, 0, 0, 1);
  --nowo-ui-motion-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --nowo-ui-motion-lift: 4px;
  --nowo-ui-motion-scale: 0.98;
}

/* Reduced motion keeps a short fade and no movement. */
@media (prefers-reduced-motion: reduce) {
  :where(:root) {
    --nowo-ui-motion-small: 80ms;
    --nowo-ui-motion-small-close: 80ms;
    --nowo-ui-motion-medium: 80ms;
    --nowo-ui-motion-medium-close: 80ms;
    --nowo-ui-motion-lift: 0px;
    --nowo-ui-motion-scale: 1;
  }
}

:where([data-motion='reduce']) {
  --nowo-ui-motion-small: 80ms;
  --nowo-ui-motion-small-close: 80ms;
  --nowo-ui-motion-medium: 80ms;
  --nowo-ui-motion-medium-close: 80ms;
  --nowo-ui-motion-lift: 0px;
  --nowo-ui-motion-scale: 1;
}

:where([data-motion='full']) {
  --nowo-ui-motion-small: 150ms;
  --nowo-ui-motion-small-close: 110ms;
  --nowo-ui-motion-medium: 200ms;
  --nowo-ui-motion-medium-close: 150ms;
  --nowo-ui-motion-lift: 4px;
  --nowo-ui-motion-scale: 0.98;
}

/* Centred dialogs and their backdrop. While it closes a dialog is no longer modal, so it keeps its place and layout here. */
:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm) {
  transition-property: opacity, transform, overlay, display;
  transition-duration: var(--nowo-ui-motion-medium-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
  transition-behavior: allow-discrete;
}

:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm):not([open]) {
  position: fixed;
  inset: 0;
  opacity: 0;
  transform: scale(var(--nowo-ui-motion-scale));
}

.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start):not([open]),
.nowo-ui-confirm-dialog--anatomy:not([open]) {
  flex-direction: column;
  height: fit-content;
  min-height: calc(var(--nowo-ui-dialog-max-h) * clamp(0, var(--nowo-ui-dialog-fill, 0), 1));
  overflow: hidden;
}

.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start, .nowo-ui-dialog--remote-form):not([open]):not(:has(input:not([type='hidden']), select, textarea, table, ul, ol, details)),
.nowo-ui-confirm-dialog--anatomy:not([open]):not(:has(input:not([type='hidden']), select, textarea, table, ul, ol, details)) {
  min-height: 0;
}

:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)[open] {
  opacity: 1;
  transform: none;
  transition-duration: var(--nowo-ui-motion-medium);
  transition-timing-function: var(--nowo-ui-motion-ease-out);
}

@starting-style {
  :is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)[open] {
    opacity: 0;
    transform: scale(var(--nowo-ui-motion-scale));
  }
}

:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)::backdrop {
  opacity: 0;
  transition-property: opacity, overlay, display;
  transition-duration: var(--nowo-ui-motion-medium-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
  transition-behavior: allow-discrete;
}

:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)[open]::backdrop {
  opacity: 1;
  transition-duration: var(--nowo-ui-motion-medium);
  transition-timing-function: var(--nowo-ui-motion-ease-out);
}

@starting-style {
  :is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)[open]::backdrop {
    opacity: 0;
  }
}

/* The kit's own closes fade under this mark, then really close (nowo-ui-motion-core.ts). */
:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)[open][data-nowo-ui-closing] {
  opacity: 0;
  transform: scale(var(--nowo-ui-motion-scale));
  pointer-events: none;
  transition-duration: var(--nowo-ui-motion-medium-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
}

:is(.nowo-ui-dialog:not(.nowo-ui-dialog--end, .nowo-ui-dialog--start), .nowo-ui-confirm-dialog, .nowo-ui-confirm)[open][data-nowo-ui-closing]::backdrop {
  opacity: 0;
  transition-duration: var(--nowo-ui-motion-medium-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
}

/* Menus, popovers and panels in the top layer: kebab, kit menu, page actions, date range, emoji picker. */
:is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu)[popover],
.nowo-ui-date-range__panel,
.nowo-ui-emoji-picker__panel {
  transition-property: opacity, transform, overlay, display;
  transition-duration: var(--nowo-ui-motion-small-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
  transition-behavior: allow-discrete;
}

@supports selector(:popover-open) {
  :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu)[popover]:not(:popover-open),
  :is(.nowo-ui-date-range__panel, .nowo-ui-emoji-picker__panel)[popover]:not(:popover-open) {
    opacity: 0;
    transform: translateY(var(--nowo-ui-motion-lift));
  }

  :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu, .nowo-ui-date-range__panel, .nowo-ui-emoji-picker__panel)[popover]:popover-open {
    opacity: 1;
    transform: none;
    transition-duration: var(--nowo-ui-motion-small);
    transition-timing-function: var(--nowo-ui-motion-ease-out);
  }

  @starting-style {
    :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu, .nowo-ui-date-range__panel, .nowo-ui-emoji-picker__panel)[popover]:popover-open {
      opacity: 0;
      transform: translateY(var(--nowo-ui-motion-lift));
    }
  }
}

/* The kit's own closes of these panels: after the rules above, which they must beat. */
:is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu, .nowo-ui-date-range__panel, .nowo-ui-emoji-picker__panel)[data-nowo-ui-closing][data-nowo-ui-closing] {
  opacity: 0;
  transform: translateY(var(--nowo-ui-motion-lift));
  pointer-events: none;
  transition-duration: var(--nowo-ui-motion-small-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
}

/* The same panels where there is no Popover API: `hidden` decides. */
:is(.nowo-ui-date-range__panel, .nowo-ui-emoji-picker__panel)[hidden] {
  opacity: 0;
}

/* Menus on <details>: the content stays while it fades where the browser has ::details-content. */
details:not([open]) > :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu) {
  opacity: 0;
  transform: translateY(var(--nowo-ui-motion-lift));
}

details > :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu) {
  transition: opacity var(--nowo-ui-motion-small-close) var(--nowo-ui-motion-ease-in), transform var(--nowo-ui-motion-small-close) var(--nowo-ui-motion-ease-in);
}

details[open] > :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu) {
  opacity: 1;
  transform: none;
  transition-duration: var(--nowo-ui-motion-small);
  transition-timing-function: var(--nowo-ui-motion-ease-out);
}

@starting-style {
  details[open] > :is(.nowo-ui-menu__panel, .nowo-ui-popover, .nowo-ui-kebab__menu) {
    opacity: 0;
    transform: translateY(var(--nowo-ui-motion-lift));
  }
}

:is(.nowo-ui-menu, .nowo-ui-kebab__details)::details-content {
  transition: content-visibility var(--nowo-ui-motion-small-close) allow-discrete;
}

/* Panels: tabs fade in; the old panel goes at once, as two panels at the same time would stack. */
:is([data-nowo-ui-tabs-ready] > [data-nowo-ui-tabs-panel], [data-tabs-target='tab'][data-state='active']) {
  transition: opacity var(--nowo-ui-motion-small) var(--nowo-ui-motion-ease-out);
}

@starting-style {
  :is([data-nowo-ui-tabs-ready] > [data-nowo-ui-tabs-panel], [data-tabs-target='tab'][data-state='active']) {
    opacity: 0;
  }
}

/* collapse-panel and filters collapse: fade, then the space goes. Not at first paint. */
[data-collapse-panel-target='body'][data-nowo-ui-motion-ready],
form:has(> .nowo-ui-filters-collapse[data-nowo-ui-motion-ready]) > :not(.nowo-ui-filters-collapse) {
  transition-property: opacity, display;
  transition-duration: var(--nowo-ui-motion-small);
  transition-timing-function: var(--nowo-ui-motion-ease-out);
  transition-behavior: allow-discrete;
}

[data-collapse-panel-target='body'][data-nowo-ui-motion-ready][hidden],
form:has(> .nowo-ui-filters-collapse.is-collapsed[data-nowo-ui-motion-ready]) > :not(.nowo-ui-filters-collapse) {
  opacity: 0;
  transition-duration: var(--nowo-ui-motion-small-close);
  transition-timing-function: var(--nowo-ui-motion-ease-in);
}

@starting-style {
  [data-collapse-panel-target='body'][data-nowo-ui-motion-ready]:not([hidden]),
  form:has(> .nowo-ui-filters-collapse[data-nowo-ui-motion-ready]:not(.is-collapsed)) > :not(.nowo-ui-filters-collapse) {
    opacity: 0;
  }
}

/* The icon-tab tooltip fades in; it has no element to stay on when it goes. */
[data-tab-style='icon'] .nowo-ui-tabs__item[data-rail-label]:not(.nowo-ui-tabs__item--active, .is-active, [aria-current='page']):is(:hover, :focus-visible)::after {
  transition: opacity var(--nowo-ui-motion-small) var(--nowo-ui-motion-ease-out);
}

@starting-style {
  [data-tab-style='icon'] .nowo-ui-tabs__item[data-rail-label]:not(.nowo-ui-tabs__item--active, .is-active, [aria-current='page']):is(:hover, :focus-visible)::after {
    opacity: 0;
  }
}
}
