/* ==========================================================================
   Paperboat — style aplikacji.
   Tokeny kolorów na :root (jasny) i html[data-theme="dark"]; wielkość tekstu
   przez html[data-size]. Komponenty DevExpress (Fluent) dostają akcent z serwera,
   tu dopasowujemy krój, promienie i szczegóły do marki.
   ========================================================================== */

:root {
  --pb-font: "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  --pb-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --pb-bg: #F5F6FA;
  --pb-side: #FBFBFD;
  --pb-surface: #FFFFFF;
  --pb-s2: #F1F3F8;
  --pb-s3: #E9ECF3;
  --pb-input: #FFFFFF;
  --pb-line: #E4E7EF;
  --pb-line2: #EEF0F5;
  --pb-text: #1C2030;
  --pb-muted: #6B7185;
  --pb-faint: #9CA2B3;
  --pb-accent: #5F7DE8;
  --pb-accent-strong: #4C69D6;
  --pb-accent-soft: #E8EDFD;
  --pb-on-accent: #FFFFFF;
  --pb-shadow: 0 1px 2px rgba(28, 32, 48, .05), 0 6px 20px rgba(28, 32, 48, .05);
  --pb-shadow-lg: 0 18px 48px -18px rgba(28, 32, 48, .35);
  --pb-radius: 14px;
  --pb-radius-sm: 10px;

  --mint-bg: #DFF5EE; --mint-fg: #1E7A5D; --mint-1: #86E0C5; --mint-2: #43B792;
  --peach-bg: #FFEADC; --peach-fg: #A5512A; --peach-1: #FFC29B; --peach-2: #EF8858;
  --lav-bg: #ECE8FD; --lav-fg: #5846B6; --lav-1: #C2B6F9; --lav-2: #8A77E5;
  --sky-bg: #E0F0FD; --sky-fg: #23659E; --sky-1: #92CFF8; --sky-2: #4C9DDF;
  --butter-bg: #FCF1D3; --butter-fg: #86610C; --butter-1: #FFDB82; --butter-2: #E6AC2A;
  --rose-bg: #FDE5EB; --rose-fg: #A63A58; --rose-1: #F8AEC0; --rose-2: #E3708E;
  --slate-bg: #EDEFF4; --slate-fg: #4D556A; --slate-1: #C0C6D4; --slate-2: #7B859A;
  --acc-bg: #E8EDFD; --acc-fg: #3F5BC4; --acc-1: #A9B9FB; --acc-2: #5F7DE8;

  --pb-ok: #43B792;
  --pb-danger: #E3708E;

  font-size: 14px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --pb-bg: #14161C;
  --pb-side: #181B22;
  --pb-surface: #1D2029;
  --pb-s2: #232733;
  --pb-s3: #2A2F3C;
  --pb-input: #191C24;
  --pb-line: #2D3240;
  --pb-line2: #262A36;
  --pb-text: #E8EAF1;
  --pb-muted: #9AA0B4;
  --pb-faint: #6F7689;
  --pb-accent: #8EA3F5;
  --pb-accent-strong: #A7B7F8;
  --pb-accent-soft: #262D4A;
  --pb-on-accent: #111827;
  --pb-shadow: none;
  --pb-shadow-lg: 0 18px 48px -18px rgba(0, 0, 0, .6);

  --mint-bg: rgba(79, 195, 161, .16); --mint-fg: #7DDCBF;
  --peach-bg: rgba(240, 138, 93, .16); --peach-fg: #FFB48C;
  --lav-bg: rgba(140, 121, 230, .2); --lav-fg: #BDB1F8;
  --sky-bg: rgba(78, 159, 224, .17); --sky-fg: #92CBF6;
  --butter-bg: rgba(234, 176, 46, .16); --butter-fg: #F5D07A;
  --rose-bg: rgba(229, 115, 144, .17); --rose-fg: #F6A7BA;
  --slate-bg: rgba(150, 160, 180, .14); --slate-fg: #BFC5D3;
  --acc-bg: rgba(142, 163, 245, .16); --acc-fg: #AFC0FA;

  color-scheme: dark;
}

html[data-size="small"] { font-size: 12.5px; }
html[data-size="large"] { font-size: 15.5px; }

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--pb-bg);
  color: var(--pb-text);
  font-family: var(--pb-font);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body, button, input, textarea, select,
[class^="dxbl"], [class*=" dxbl"] { font-family: var(--pb-font); }

a { color: var(--pb-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--pb-accent); outline-offset: 2px; }

.pb-mono, .pb-docno { font-family: var(--pb-mono); font-weight: 500; letter-spacing: -.01em; }
.pb-muted { color: var(--pb-muted); }
.pb-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-spacer { flex: 1; }
.pb-row { display: flex; align-items: center; gap: .6em; }
.pb-wrap { flex-wrap: wrap; }
.pb-grow { flex: 1; min-width: 0; }
.pb-hidden { display: none !important; }

/* ------------------------------------------------------------------ ikony */

.pb-ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

.pb-ai {
  --ai-size: 1.75em;
  --c1: var(--acc-1); --c2: var(--acc-2);
  width: var(--ai-size); height: var(--ai-size); border-radius: calc(var(--ai-size) * .29);
  background: linear-gradient(165deg, var(--c1), var(--c2));
  display: inline-grid; place-items: center; flex: none; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.pb-ai svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.pb-c-mint { --c1: var(--mint-1); --c2: var(--mint-2); --cbg: var(--mint-bg); --cfg: var(--mint-fg); }
.pb-c-peach { --c1: var(--peach-1); --c2: var(--peach-2); --cbg: var(--peach-bg); --cfg: var(--peach-fg); }
.pb-c-lav { --c1: var(--lav-1); --c2: var(--lav-2); --cbg: var(--lav-bg); --cfg: var(--lav-fg); }
.pb-c-sky { --c1: var(--sky-1); --c2: var(--sky-2); --cbg: var(--sky-bg); --cfg: var(--sky-fg); }
.pb-c-butter { --c1: var(--butter-1); --c2: var(--butter-2); --cbg: var(--butter-bg); --cfg: var(--butter-fg); }
.pb-c-rose { --c1: var(--rose-1); --c2: var(--rose-2); --cbg: var(--rose-bg); --cfg: var(--rose-fg); }
.pb-c-slate { --c1: var(--slate-1); --c2: var(--slate-2); --cbg: var(--slate-bg); --cfg: var(--slate-fg); }
.pb-c-acc { --c1: var(--acc-1); --c2: var(--acc-2); --cbg: var(--acc-bg); --cfg: var(--acc-fg); }

.pb-dot { width: .55em; height: .55em; border-radius: 50%; background: var(--c2); flex: none; }

.pb-avatar {
  --av-size: 2.1em;
  width: var(--av-size); height: var(--av-size); border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  font-weight: 700; font-size: .82em; color: #fff; letter-spacing: .02em;
  background: linear-gradient(160deg, var(--c1), var(--c2));
}

/* ------------------------------------------------------------------ przyciski i drobne elementy */

.pb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  height: 2.35em; padding: 0 .95em; border-radius: .65em;
  border: 1px solid var(--pb-line); background: var(--pb-surface); color: var(--pb-text);
  font: inherit; font-weight: 650; font-size: .93em; white-space: nowrap; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.pb-btn:hover { background: var(--pb-s2); text-decoration: none; }
.pb-btn:disabled { opacity: .5; cursor: default; }
.pb-btn.primary { background: var(--pb-accent); border-color: var(--pb-accent); color: var(--pb-on-accent); }
.pb-btn.primary:hover { background: var(--pb-accent-strong); }
.pb-btn.success { background: var(--pb-ok); border-color: var(--pb-ok); color: #fff; }
.pb-btn.success:hover { filter: brightness(.96); }
.pb-btn.danger { color: var(--rose-fg); }
.pb-btn.danger:hover { background: var(--rose-bg); border-color: transparent; }
.pb-btn.ghost { border-color: transparent; background: transparent; color: var(--pb-muted); }
.pb-btn.ghost:hover { background: var(--pb-s2); color: var(--pb-text); }
.pb-btn.sm { height: 2em; padding: 0 .7em; font-size: .86em; }
.pb-btn.lg { height: 2.8em; padding: 0 1.4em; font-size: 1em; }

.pb-icon-btn {
  width: 2.3em; height: 2.3em; border-radius: .65em; display: inline-grid; place-items: center; flex: none;
  color: var(--pb-muted); border: 1px solid transparent; background: transparent; cursor: pointer; position: relative; padding: 0;
  font: inherit;
}
.pb-icon-btn:hover { background: var(--pb-s2); color: var(--pb-text); text-decoration: none; }
.pb-icon-btn.bordered { border-color: var(--pb-line); background: var(--pb-surface); }
.pb-icon-btn.sm { width: 1.9em; height: 1.9em; }
.pb-icon-btn:disabled { opacity: .35; cursor: default; }

.pb-badge {
  position: absolute; top: -.2em; right: -.25em; min-width: 1.45em; height: 1.45em; padding: 0 .35em;
  border-radius: 99px; background: var(--rose-2); color: #fff; font-size: .68em; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--pb-surface);
}

.pb-pill {
  display: inline-flex; align-items: center; gap: .38em; padding: .14em .64em; border-radius: 99px;
  font-size: .8em; font-weight: 650; white-space: nowrap; background: var(--slate-bg); color: var(--slate-fg);
}
.pb-pill i { width: .45em; height: .45em; border-radius: 50%; background: currentColor; opacity: .8; }
.pb-pill-mint { background: var(--mint-bg); color: var(--mint-fg); }
.pb-pill-peach { background: var(--peach-bg); color: var(--peach-fg); }
.pb-pill-lav { background: var(--lav-bg); color: var(--lav-fg); }
.pb-pill-sky { background: var(--sky-bg); color: var(--sky-fg); }
/* Kto jeszcze ma otwarty dokument */
.pb-doc-viewers { gap: .6em; white-space: normal; flex-wrap: wrap; }
.pb-doc-viewer { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
.pb-pill-butter { background: var(--butter-bg); color: var(--butter-fg); }
.pb-pill-rose { background: var(--rose-bg); color: var(--rose-fg); }
.pb-pill-acc { background: var(--acc-bg); color: var(--acc-fg); }

.pb-tag { display: inline-flex; align-items: center; gap: .3em; padding: .05em .55em; border-radius: .45em; font-size: .86em; font-weight: 600; background: var(--cbg, var(--slate-bg)); color: var(--cfg, var(--slate-fg)); }

.pb-seg { display: inline-flex; border: 1px solid var(--pb-line); border-radius: .7em; padding: 2px; background: var(--pb-surface); }
.pb-seg button {
  border: none; background: transparent; color: var(--pb-muted); font: inherit; font-weight: 650; font-size: .86em;
  padding: .28em .7em; border-radius: .5em; cursor: pointer; min-width: 2.2em;
}
.pb-seg button small { font-size: .75em; }
.pb-seg button[aria-pressed="true"], .pb-seg button.is-on { background: var(--pb-accent-soft); color: var(--pb-accent); }

.pb-chip {
  display: inline-flex; align-items: center; gap: .4em; height: 2.05em; padding: 0 .8em; border-radius: 99px;
  border: 1px solid var(--pb-line); font-size: .86em; font-weight: 600; background: var(--pb-surface); color: var(--pb-text); cursor: pointer; font-family: inherit;
}
.pb-chip:hover { background: var(--pb-s2); }
.pb-chip.is-on { background: var(--pb-text); color: var(--pb-bg); border-color: var(--pb-text); }
.pb-chip .pb-count { font-size: .9em; opacity: .65; }

.pb-kbd { font-family: var(--pb-font); font-size: .78em; border: 1px solid var(--pb-line); border-radius: .35em; padding: 0 .4em; color: var(--pb-muted); background: var(--pb-surface); }

.pb-link { font-weight: 600; }

.pb-spinner {
  width: 1.6em; height: 1.6em; border-radius: 50%; display: inline-block;
  border: 2.5px solid var(--pb-accent-soft); border-top-color: var(--pb-accent); animation: pb-spin .8s linear infinite;
}
.pb-spinner.sm { width: 1.1em; height: 1.1em; border-width: 2px; }
@keyframes pb-spin { to { transform: rotate(360deg); } }

.pb-alert { display: flex; gap: .6em; align-items: flex-start; padding: .7em .9em; border-radius: var(--pb-radius-sm); font-size: .92em; background: var(--cbg); color: var(--cfg); }
.pb-alert .pb-ic { margin-top: .12em; }

/* ------------------------------------------------------------------ ekran startowy */

.pb-splash {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; z-index: 1000;
  background: var(--pb-bg); transition: opacity .25s ease, visibility .25s;
}
.pb-splash-name { font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; }
.pb-splash-bar { width: 120px; height: 3px; border-radius: 3px; background: var(--pb-accent-soft); overflow: hidden; }
.pb-splash-bar span { display: block; width: 40%; height: 100%; background: var(--pb-accent); border-radius: 3px; animation: pb-bar 1.1s ease-in-out infinite; }
@keyframes pb-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
body:has(.pb-ready) .pb-splash { opacity: 0; visibility: hidden; pointer-events: none; }

/* ------------------------------------------------------------------ powłoka */

.pb-shell { display: grid; grid-template-columns: 16.5em minmax(0, 1fr); height: 100vh; transition: grid-template-columns .2s ease; }
.pb-shell.is-collapsed { grid-template-columns: 4.3em minmax(0, 1fr); }

.pb-side {
  background: var(--pb-side); border-right: 1px solid var(--pb-line);
  padding: 1em .75em; display: flex; flex-direction: column; gap: .9em; min-height: 0; overflow: hidden;
}
.pb-brand { display: flex; align-items: center; gap: .4em; padding: 0 .2em; }
.pb-brand-link { display: flex; align-items: center; gap: .6em; font-weight: 800; font-size: 1.2em; letter-spacing: -.03em; color: var(--pb-text); min-width: 0; }
.pb-brand-link:hover { text-decoration: none; }
.pb-brand-link svg { flex: none; }
.pb-side-toggle { margin-left: auto; }

.pb-side-find {
  display: flex; align-items: center; gap: .5em; height: 2.3em; padding: 0 .7em; border-radius: .65em;
  background: var(--pb-s2); color: var(--pb-faint);
}
.pb-side-find input { border: none; outline: none; background: transparent; color: var(--pb-text); font: inherit; font-size: .92em; width: 100%; min-width: 0; }
.pb-side-find input::placeholder { color: var(--pb-faint); }

.pb-nav { display: flex; flex-direction: column; gap: .1em; overflow-y: auto; overflow-x: hidden; min-height: 0; margin: 0 -.3em; padding: 0 .3em; }
.pb-nav-loading { display: grid; place-items: center; padding: 2em 0; }
.pb-nav-section { font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pb-faint); padding: 1em .6em .35em; white-space: nowrap; }
.pb-nav-item {
  display: flex; align-items: center; gap: .65em; padding: .4em .55em; border-radius: .65em;
  color: var(--pb-text); font-size: .95em; font-weight: 500; white-space: nowrap;
}
.pb-nav-item:hover { background: var(--pb-s2); text-decoration: none; }
.pb-nav-item.is-active { background: var(--pb-accent-soft); font-weight: 650; }
.pb-nav-text { overflow: hidden; text-overflow: ellipsis; }
.pb-nav-count { margin-left: auto; font-size: .78em; font-weight: 800; color: #fff; background: var(--rose-2); border-radius: 99px; padding: 0 .5em; min-width: 1.6em; text-align: center; }

.pb-me {
  margin-top: auto; display: flex; align-items: center; gap: .6em; padding: .55em; border-radius: .85em;
  background: var(--pb-surface); border: 1px solid var(--pb-line); color: var(--pb-text); min-width: 0;
}
.pb-me:hover { text-decoration: none; border-color: var(--pb-accent); }
.pb-me-text { display: grid; min-width: 0; }
.pb-me-text b { font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-me-text span { font-size: .78em; color: var(--pb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pb-shell.is-collapsed .pb-brand-link span,
.pb-shell.is-collapsed .pb-side-find,
.pb-shell.is-collapsed .pb-nav-text,
.pb-shell.is-collapsed .pb-nav-section,
.pb-shell.is-collapsed .pb-me-text { display: none; }
.pb-shell.is-collapsed .pb-brand { flex-direction: column; }
.pb-shell.is-collapsed .pb-side-toggle { margin: 0; }
.pb-shell.is-collapsed .pb-nav-item { justify-content: center; padding: .45em 0; position: relative; }
.pb-shell.is-collapsed .pb-nav-count { position: absolute; top: 0; right: .1em; font-size: .62em; }
.pb-shell.is-collapsed .pb-me { justify-content: center; padding: .4em 0; }

.pb-main { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; }

.pb-top {
  display: flex; align-items: center; gap: .6em; padding: .55em 1.1em; min-height: 3.5em;
  border-bottom: 1px solid var(--pb-line); background: var(--pb-surface);
}
.pb-top-menu { display: none; }
.pb-tabs { display: flex; gap: .25em; min-width: 0; overflow: hidden; flex: 1; }
.pb-tab { display: flex; align-items: center; border-radius: .6em; max-width: 15em; min-width: 0; color: var(--pb-muted); }
.pb-tab a { display: flex; align-items: center; gap: .5em; padding: .38em .2em .38em .7em; color: inherit; font-size: .88em; font-weight: 550; min-width: 0; }
.pb-tab a:hover { text-decoration: none; color: var(--pb-text); }
.pb-tab-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-tab.is-active { background: var(--pb-s2); color: var(--pb-text); }
.pb-tab-close { border: none; background: transparent; color: var(--pb-faint); cursor: pointer; padding: .3em .45em; border-radius: .4em; display: grid; opacity: 0; }
.pb-tab:hover .pb-tab-close, .pb-tab.is-active .pb-tab-close { opacity: 1; }
.pb-tab-close:hover { color: var(--pb-text); background: var(--pb-s3); }
.pb-tab-close .pb-ic { width: .85em; height: .85em; }
.pb-top-right { margin-left: auto; display: flex; align-items: center; gap: .35em; }
/* Wielofirmowość: wybór firmy, w której operator pracuje. */
.pb-company {
  display: inline-flex; align-items: center; gap: .4em; height: 2.05em; padding: 0 .3em 0 .7em; margin-right: .3em; border-radius: 99px;
  border: 1px solid var(--pb-line); background: var(--pb-surface); color: var(--pb-text); font-size: .86em; font-weight: 600;
}
.pb-company select {
  border: 0; background: transparent; color: inherit; font: inherit; max-width: 16em; height: 100%; padding-right: .3em; cursor: pointer; outline: none;
}
.pb-company select option { background: var(--pb-surface); color: var(--pb-text); font-weight: 400; }
.pb-company:focus-within { border-color: var(--pb-accent); }

.pb-content { overflow: auto; min-height: 0; padding: 1.3em 1.6em 2em; }

@media (max-width: 900px) {
  .pb-shell, .pb-shell.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .pb-side { position: fixed; inset: 0 auto 0 0; width: 17em; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--pb-shadow-lg); }
  .pb-shell.is-collapsed .pb-side { transform: none; }
  .pb-shell.is-collapsed .pb-nav-text, .pb-shell.is-collapsed .pb-nav-section, .pb-shell.is-collapsed .pb-me-text, .pb-shell.is-collapsed .pb-brand-link span, .pb-shell.is-collapsed .pb-side-find { display: revert; }
  .pb-shell.is-collapsed .pb-nav-item { justify-content: flex-start; padding: .4em .55em; }
  .pb-top-menu { display: grid; }
  .pb-tabs, .pb-size-seg { display: none; }
  .pb-content { padding: 1em; }
}

/* ------------------------------------------------------------------ strony */

.pb-page { display: grid; gap: 1.1em; align-content: start; }
.pb-page-head { display: flex; align-items: center; gap: .9em; flex-wrap: wrap; }
.pb-page-titles { min-width: 0; flex: 1; }
.pb-crumbs { font-size: .8em; color: var(--pb-muted); display: flex; gap: .4em; align-items: center; }
.pb-h1 { font-size: 1.6em; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.pb-h2 { font-size: 1.15em; font-weight: 750; letter-spacing: -.01em; }
.pb-sub { color: var(--pb-muted); font-size: .92em; margin: .15em 0 0; }
.pb-page-actions { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }

.pb-card { background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: var(--pb-radius); box-shadow: var(--pb-shadow); min-width: 0; }
.pb-card-head { display: flex; align-items: center; gap: .6em; padding: .85em 1.1em; border-bottom: 1px solid var(--pb-line2); font-weight: 700; }
.pb-card-head .pb-more { margin-left: auto; font-size: .86em; font-weight: 600; }
.pb-card-body { padding: 1.1em; }
.pb-card-foot { display: flex; align-items: center; gap: .6em; padding: .75em 1.1em; border-top: 1px solid var(--pb-line2); }

.pb-center { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1em; padding: 2em; }

.pb-state { display: grid; justify-items: center; text-align: center; gap: .5em; padding: 2.5em 1.5em; color: var(--pb-muted); }
.pb-state-icon { width: 3.2em; height: 3.2em; border-radius: 1em; display: grid; place-items: center; background: var(--cbg, var(--pb-s2)); color: var(--cfg, var(--pb-muted)); }
.pb-state-icon .pb-ic { width: 1.5em; height: 1.5em; }
.pb-state-title { font-weight: 700; color: var(--pb-text); font-size: 1.05em; }
.pb-state-text { max-width: 42ch; font-size: .92em; }

/* ------------------------------------------------------------------ pulpit */

.pb-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.pb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9em; }
.pb-stat { padding: 1em 1.1em; display: grid; grid-template-columns: auto 1fr; gap: .15em .85em; align-items: center; color: inherit; }
.pb-stat:hover { text-decoration: none; border-color: var(--pb-accent); }
.pb-stat .pb-ai { grid-row: span 2; --ai-size: 2.5em; }
.pb-stat b { font-size: 1.7em; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pb-stat span { font-size: .85em; color: var(--pb-muted); }
.pb-home2 { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1em; align-items: start; }
@media (max-width: 1100px) { .pb-home2 { grid-template-columns: minmax(0, 1fr); } .pb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pb-task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 7.5em; gap: .85em; align-items: center; padding: .7em 1.1em; border-bottom: 1px solid var(--pb-line2); color: inherit; }
.pb-task:last-child { border-bottom: none; }
.pb-task:hover { background: var(--pb-s2); text-decoration: none; }
.pb-task-t1 { display: flex; gap: .6em; align-items: baseline; min-width: 0; }
.pb-task-t1 span { font-weight: 600; font-size: .93em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-task-t2 { font-size: .82em; color: var(--pb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-task-amt { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .93em; }
.pb-task-due { justify-self: end; }
@media (max-width: 700px) { .pb-task { grid-template-columns: auto minmax(0, 1fr); } .pb-task-amt, .pb-task-due { display: none; } }

.pb-springboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1em .6em; padding: 1.2em; }
.pb-springboard a { display: grid; justify-items: center; gap: .45em; font-size: .78em; font-weight: 600; text-align: center; color: var(--pb-text); }
.pb-springboard a:hover { text-decoration: none; }
.pb-springboard a:hover .pb-ai { transform: translateY(-2px); }
.pb-springboard .pb-ai { --ai-size: 3.3em; transition: transform .15s; }
.pb-springboard .is-soon { opacity: .45; pointer-events: none; }

.pb-bars { display: grid; gap: .85em; padding: 1em 1.1em 1.2em; }
.pb-bar { display: grid; gap: .3em; font-size: .88em; }
.pb-bar-track { height: .5em; border-radius: 99px; background: var(--pb-s2); overflow: hidden; }
.pb-bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--c2); }

/* ------------------------------------------------------------------ listy (DxGrid) */

.pb-list-tools { display: flex; align-items: center; justify-content: space-between; gap: .8em; flex-wrap: wrap; }
.pb-chips { display: flex; gap: .4em; flex-wrap: wrap; }
.pb-find {
  display: flex; align-items: center; gap: .5em; height: 2.35em; width: 18em; max-width: 100%; padding: 0 .75em; border-radius: .65em;
  border: 1px solid var(--pb-line); background: var(--pb-input); color: var(--pb-faint);
}
.pb-find input { border: none; outline: none; background: transparent; color: var(--pb-text); font: inherit; font-size: .92em; width: 100%; }
.pb-grid-card { overflow: hidden; }
.pb-grid-card .dxbl-grid { border: none; }
.pb-grid .dxbl-grid-header-row th, .pb-grid .dxbl-grid-header-content { font-weight: 650; color: var(--pb-muted); }
.pb-grid tr.pb-row-open { cursor: pointer; }
.pb-list-foot { display: flex; gap: 1em; align-items: center; font-size: .82em; color: var(--pb-muted); padding: 0 .2em; }

/* ------------------------------------------------------------------ dokument */

.pb-doc-head { display: flex; align-items: center; gap: .9em; flex-wrap: wrap; }
.pb-doc-head .pb-ai { --ai-size: 2.8em; }
.pb-doc-title { display: flex; align-items: baseline; gap: .6em; flex-wrap: wrap; font-size: 1.4em; font-weight: 800; letter-spacing: -.02em; }
.pb-doc-title .pb-docno { font-size: .75em; color: var(--pb-muted); }
/* Dokument bez numeru: identyfikator z adresu, wyciszony — nie udaje numeru. */
.pb-docno.pb-docno-id { color: var(--pb-muted); font-weight: 400; }
.pb-doc-meta { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; margin-top: .25em; font-size: .92em; }
.pb-src { display: inline-flex; align-items: center; gap: .3em; font-size: .82em; font-weight: 600; color: var(--pb-muted); }
.pb-src b { font-size: .8em; font-weight: 800; letter-spacing: .04em; padding: .05em .4em; border-radius: .3em; background: var(--pb-s2); color: var(--pb-text); }
.pb-doc-actions { margin-left: auto; display: flex; gap: .5em; flex-wrap: wrap; }

.pb-steps { display: flex; align-items: center; padding: .8em 1.1em; gap: .4em; overflow-x: auto; }
.pb-step { display: flex; align-items: center; gap: .5em; font-size: .85em; font-weight: 600; white-space: nowrap; }
.pb-step-c { width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--pb-line); color: var(--pb-faint); font-size: .85em; background: var(--pb-surface); flex: none; }
.pb-step-c .pb-ic { width: .95em; height: .95em; stroke-width: 3; }
.pb-step small { display: block; font-weight: 500; color: var(--pb-muted); font-size: .88em; }
.pb-step.is-done .pb-step-c { background: var(--pb-ok); border-color: var(--pb-ok); color: #fff; }
.pb-step.is-now .pb-step-c { background: var(--pb-accent); border-color: var(--pb-accent); color: var(--pb-on-accent); box-shadow: 0 0 0 4px var(--pb-accent-soft); }
.pb-step.is-rejected .pb-step-c { background: var(--pb-danger); border-color: var(--pb-danger); color: #fff; }
.pb-step.is-todo { color: var(--pb-muted); }
.pb-step-line { flex: 1; min-width: 1.5em; height: 2px; background: var(--pb-line); border-radius: 2px; }
.pb-step-line.is-done { background: var(--pb-ok); }

.pb-instructions { display: flex; gap: .7em; align-items: flex-start; padding: .8em 1em; border-radius: var(--pb-radius-sm); background: var(--pb-accent-soft); color: var(--pb-text); font-size: .92em; }
.pb-instructions .pb-ic { color: var(--pb-accent); margin-top: .1em; }

.pb-doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) .6em var(--pb-att-width, 26em); gap: .2em; align-items: start; }
.pb-doc-grid > .pb-splitter { align-self: stretch; }
.pb-doc-grid.no-att { grid-template-columns: minmax(0, 1fr); }
.pb-doc-grid.att-wide { --pb-att-width: 40em; }
.pb-doc-grid.att-collapsed { --pb-att-width: 3.4em; }
@media (max-width: 1250px) { .pb-doc-grid, .pb-doc-grid.att-wide { grid-template-columns: minmax(0, 1fr); } .pb-doc-grid > .pb-splitter { display: none; } }

.pb-subtabs { display: flex; gap: 1.3em; padding: 0 1.1em; border-bottom: 1px solid var(--pb-line2); overflow-x: auto; }
.pb-subtabs button { border: none; background: transparent; padding: .8em 0; font: inherit; font-size: .92em; font-weight: 600; color: var(--pb-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.pb-subtabs button:hover { color: var(--pb-text); }
.pb-subtabs button.is-on { color: var(--pb-text); border-color: var(--pb-accent); }
.pb-subtabs em { font-style: normal; font-size: .8em; background: var(--pb-s2); border-radius: 99px; padding: 0 .45em; margin-left: .3em; }

.pb-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .9em 1em; padding: 1.1em; }
.pb-form.nested { padding: 0; }
.pb-span-1 { grid-column: span 1; } .pb-span-2 { grid-column: span 2; } .pb-span-3 { grid-column: span 3; } .pb-span-4 { grid-column: span 4; }
.pb-span-5 { grid-column: span 5; } .pb-span-6 { grid-column: span 6; } .pb-span-7 { grid-column: span 7; } .pb-span-8 { grid-column: span 8; }
.pb-span-9 { grid-column: span 9; } .pb-span-10 { grid-column: span 10; } .pb-span-11 { grid-column: span 11; } .pb-span-12 { grid-column: span 12; }
@media (max-width: 800px) { .pb-form > * { grid-column: span 12 !important; } }

.pb-field { display: grid; gap: .3em; min-width: 0; align-content: start; }
.pb-field-label { font-size: .8em; font-weight: 650; color: var(--pb-muted); display: flex; align-items: center; gap: .35em; }
.pb-field-label .req { color: var(--pb-danger); }
.pb-field-help { font-size: .76em; color: var(--pb-faint); }
.pb-field-error { font-size: .78em; color: var(--rose-fg); font-weight: 600; }
.pb-field.has-error .dxbl-text-edit, .pb-field.has-error .dxbl-memo-edit { border-color: var(--pb-danger) !important; }
.pb-field .dxbl-text-edit, .pb-field .dxbl-memo-edit, .pb-field .dxbl-tagbox { width: 100%; }
.pb-readonly {
  min-height: 2.35em; padding: .45em .75em; border-radius: .6em; background: var(--pb-s2); display: flex; align-items: center; gap: .5em;
  font-size: .95em; min-width: 0; overflow-wrap: anywhere; flex-wrap: wrap;
}
.pb-readonly.memo { align-items: flex-start; white-space: pre-line; min-height: 4em; }
.pb-readonly.calc { font-weight: 700; font-variant-numeric: tabular-nums; }
.pb-readonly .pb-faint { color: var(--pb-faint); }
.pb-fx { font-family: var(--pb-mono); font-size: .72em; font-weight: 500; color: var(--pb-accent); background: var(--pb-accent-soft); padding: 0 .35em; border-radius: .3em; }
.pb-check-field { display: flex; align-items: center; min-height: 2.35em; padding-top: 1.35em; }

.pb-group { grid-column: span 12; display: grid; gap: .8em; }
.pb-group-title { display: flex; align-items: center; gap: .6em; font-weight: 700; font-size: .92em; }
.pb-group-title::after { content: ""; flex: 1; height: 1px; background: var(--pb-line2); }
.pb-label-node { font-size: .9em; color: var(--pb-muted); align-self: center; }

.pb-ref { display: flex; gap: .4em; align-items: center; }
.pb-ref .dxbl-combobox, .pb-ref > .dxbl-text-edit { flex: 1; min-width: 0; }

/* pozycje */
.pb-items { display: grid; gap: .5em; }
.pb-items-head { display: flex; align-items: center; gap: .6em; font-weight: 700; font-size: .92em; }
.pb-items-table-wrap { border: 1px solid var(--pb-line); border-radius: .8em; overflow-x: auto; }
table.pb-items-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92em; }
.pb-items-table th { text-align: left; font-size: .8em; font-weight: 650; color: var(--pb-muted); padding: .6em .7em; background: var(--pb-s2); border-bottom: 1px solid var(--pb-line); white-space: nowrap; }
.pb-items-table th.num { text-align: right; }
.pb-items-table td { padding: .25em .35em; border-bottom: 1px solid var(--pb-line2); vertical-align: middle; }
.pb-items-table td.ro { padding: .5em .7em; }
.pb-items-table td.lp { color: var(--pb-faint); width: 2.6em; text-align: center; }
.pb-items-table td.act { width: 6.8em; white-space: nowrap; text-align: right; }
.pb-items-table tfoot td { font-weight: 750; background: var(--pb-s2); border-bottom: none; padding: .6em .7em; }
.pb-items-table tr:hover td { background: color-mix(in srgb, var(--pb-accent-soft) 45%, transparent); }
.pb-items-table .dxbl-text-edit { border-color: transparent; background: transparent; }
.pb-items-table .dxbl-text-edit:hover, .pb-items-table .dxbl-text-edit.dxbl-focused { border-color: var(--pb-line); background: var(--pb-input); }
.pb-items-add { display: flex; gap: .5em; }
.pb-items-empty { padding: 1.2em; text-align: center; color: var(--pb-muted); font-size: .9em; }

/* załączniki */
.pb-att { display: grid; grid-template-rows: auto minmax(0, 1fr); position: sticky; top: 0; height: calc(100vh - 6.5em); min-height: 24em; overflow: hidden; }
.pb-att.is-fitted { height: var(--pb-att-h); }
.pb-att-head { display: flex; align-items: center; gap: .5em; padding: .7em .8em .7em 1em; border-bottom: 1px solid var(--pb-line2); font-weight: 700; }
.pb-att-head .pb-row { margin-left: auto; gap: .2em; }
.pb-att-list { padding: .45em; display: grid; gap: .15em; border-bottom: 1px solid var(--pb-line2); max-height: 13em; overflow-y: auto; }
.pb-att-item { display: flex; align-items: center; gap: .6em; padding: .45em .5em; border-radius: .65em; font-size: .88em; cursor: pointer; border: 1px solid transparent; }
.pb-att-item:hover { background: var(--pb-s2); }
.pb-att-item.is-on { background: var(--pb-accent-soft); }
.pb-att-item.is-drop { border-color: var(--pb-accent); border-style: dashed; }
.pb-ft { font-size: .66em; font-weight: 800; letter-spacing: .03em; color: #fff; border-radius: .35em; padding: .3em .35em; min-width: 3.2em; text-align: center; background: var(--c2); text-transform: uppercase; }
.pb-att-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pb-att-name small { display: block; font-weight: 500; color: var(--pb-muted); font-size: .86em; }
.pb-att-move { display: flex; gap: .05em; }
.pb-att-drop {
  margin: .45em; padding: .9em; border: 1.5px dashed var(--pb-line); border-radius: .8em; text-align: center; color: var(--pb-muted); font-size: .86em;
  display: grid; gap: .3em; justify-items: center; position: relative; transition: border-color .12s, background .12s;
}
.pb-att-drop.is-over { border-color: var(--pb-accent); background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-att-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pb-att-collapsed { display: grid; justify-items: center; gap: .5em; padding: .6em 0; }
.pb-att-collapsed .pb-count { font-size: .75em; font-weight: 800; color: var(--pb-muted); }

.pb-viewer { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; background: var(--pb-s2); border-radius: 0 0 var(--pb-radius) var(--pb-radius); }
.pb-viewer-tools { display: flex; align-items: center; gap: .3em; padding: .35em .6em; border-bottom: 1px solid var(--pb-line2); font-size: .85em; color: var(--pb-muted); background: var(--pb-surface); }
.pb-viewer-tools .pb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--pb-text); }
.pb-viewer-body { min-height: 0; overflow: auto; position: relative; }
.pb-frame { width: 100%; height: 100%; min-height: 28em; border: 0; display: block; background: #fff; }
.pb-image-stage { display: grid; place-items: center; padding: 1em; min-height: 100%; }
.pb-image-stage img { max-width: 100%; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); border-radius: .3em; transform-origin: center; transition: transform .15s; }
.pb-text-view { margin: 0; padding: 1em 1.2em; font-family: var(--pb-mono); font-size: .82em; white-space: pre-wrap; word-break: break-word; }
.pb-sheet { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.pb-sheet-tabs { display: flex; gap: .2em; padding: .3em; background: var(--pb-surface); border-top: 1px solid var(--pb-line2); overflow-x: auto; }
.pb-sheet-tab { border: 1px solid var(--pb-line); background: var(--pb-surface); border-radius: .5em; padding: .15em .7em; font: inherit; font-size: .82em; cursor: pointer; }
.pb-sheet-tab.is-on { background: var(--pb-accent-soft); border-color: var(--pb-accent); color: var(--pb-accent); }
.pb-mail-head { padding: .8em 1em; background: var(--pb-surface); display: grid; gap: .3em; font-size: .88em; border-bottom: 1px solid var(--pb-line2); }
.pb-mail-subject { font-weight: 700; font-size: 1.05em; }
.pb-mail-grid { display: grid; grid-template-columns: auto 1fr; gap: .1em .8em; }
.pb-mail-grid span:nth-child(odd) { color: var(--pb-muted); }
.pb-richedit { height: 100%; min-height: 28em; }

/* historia */
.pb-timeline { display: grid; padding: .6em 1.1em 1.1em; }
.pb-tl { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); gap: .7em; padding: .55em 0; position: relative; }
.pb-tl::before { content: ""; position: absolute; left: 1.2em; top: 2.6em; bottom: -.5em; width: 2px; background: var(--pb-line2); }
.pb-tl:last-child::before { display: none; }
.pb-tl-icon { width: 2.4em; height: 2.4em; border-radius: 50%; display: grid; place-items: center; background: var(--cbg); color: var(--cfg); z-index: 1; }
.pb-tl-text { font-size: .92em; }
.pb-tl-meta { font-size: .78em; color: var(--pb-muted); }
.pb-changes { margin-top: .3em; display: grid; gap: .15em; font-size: .82em; }
.pb-changes s { color: var(--pb-faint); }

.pb-comments { display: grid; gap: .8em; padding: 1.1em; }
.pb-comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7em; }
.pb-comment-bubble { background: var(--pb-s2); border-radius: .2em 1em 1em 1em; padding: .6em .85em; font-size: .92em; white-space: pre-line; }
.pb-comment-meta { font-size: .78em; color: var(--pb-muted); margin-bottom: .2em; }

/* ------------------------------------------------------------------ logowanie i kreator */

.pb-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--pb-bg); }
.pb-login-hero {
  position: relative; overflow: hidden; color: #fff; padding: 3em; display: grid; align-content: space-between;
  background: radial-gradient(120% 90% at 10% 10%, #B9C5FF 0%, #8196F0 45%, #6A7CE6 100%);
}
html[data-theme="dark"] .pb-login-hero { background: radial-gradient(120% 90% at 10% 10%, #4A5AA8 0%, #333F7E 50%, #20284F 100%); }
.pb-login-hero h1 { font-size: 3.6em; font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.pb-login-hero p { font-size: 1.25em; font-weight: 600; margin: .5em 0 0; opacity: .95; }
.pb-login-hero .pb-login-foot { font-size: .85em; opacity: .8; }
.pb-waves { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; opacity: .35; pointer-events: none; }
.pb-waves path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.pb-boat { animation: pb-bob 5s ease-in-out infinite; transform-origin: center; }
@keyframes pb-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .pb-boat { animation: none; } }
.pb-login-panel { display: grid; place-items: center; padding: 2em; position: relative; }
.pb-login-card { width: min(26em, 100%); display: grid; gap: 1em; }
.pb-login-card h2 { font-size: 1.7em; font-weight: 800; letter-spacing: -.03em; }
.pb-login-card .pb-sub { margin-top: -.6em; }
.pb-login-tools { position: absolute; top: 1.2em; right: 1.2em; display: flex; gap: .3em; }
.pb-login-mobile { display: none; align-items: center; gap: .6em; font-weight: 800; font-size: 1.3em; }
@media (max-width: 900px) { .pb-login { grid-template-columns: 1fr; } .pb-login-hero { display: none; } .pb-login-mobile { display: flex; } }

.pb-wizard { min-height: 100vh; display: grid; place-items: start center; padding: 3em 1.2em; background: var(--pb-bg); }
.pb-wizard-card { width: min(46em, 100%); display: grid; gap: 1.2em; }
.pb-wizard-brand { display: flex; align-items: center; gap: .7em; font-weight: 800; font-size: 1.4em; letter-spacing: -.03em; }
.pb-wizard-steps { display: flex; gap: .5em; flex-wrap: wrap; }
.pb-wizard-step { display: flex; align-items: center; gap: .45em; font-size: .86em; font-weight: 650; color: var(--pb-muted); padding: .3em .7em; border-radius: 99px; background: var(--pb-surface); border: 1px solid var(--pb-line); }
.pb-wizard-step.is-on { color: var(--pb-accent); border-color: var(--pb-accent); background: var(--pb-accent-soft); }
.pb-wizard-step.is-done { color: var(--mint-fg); background: var(--mint-bg); border-color: transparent; }

.pb-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9em 1em; }
.pb-form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .pb-form-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ ustawienia */

.pb-settings { display: grid; grid-template-columns: 15em minmax(0, 1fr); gap: 1.2em; align-items: start; }
.pb-settings-nav { display: grid; gap: .15em; position: sticky; top: 0; }
.pb-settings-nav a { display: flex; align-items: center; gap: .6em; padding: .5em .6em; border-radius: .65em; color: var(--pb-text); font-weight: 550; font-size: .94em; }
.pb-settings-nav a:hover { background: var(--pb-s2); text-decoration: none; }
.pb-settings-nav a.is-on { background: var(--pb-accent-soft); font-weight: 650; }
.pb-settings-nav .pb-ai { --ai-size: 1.6em; }
@media (max-width: 900px) { .pb-settings { grid-template-columns: 1fr; } .pb-settings-nav { position: static; grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); } }

.pb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(16em, 1fr)); gap: .9em; }
.pb-tile { padding: 1em 1.1em; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .2em .9em; align-items: center; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.pb-tile:hover { border-color: var(--pb-accent); text-decoration: none; }
.pb-tile .pb-ai { grid-row: span 2; --ai-size: 2.6em; }
.pb-tile b { font-size: 1.02em; }
.pb-tile span { font-size: .84em; color: var(--pb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.pb-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93em; }
.pb-table th { text-align: left; font-size: .8em; font-weight: 650; color: var(--pb-muted); padding: .65em .8em; border-bottom: 1px solid var(--pb-line); white-space: nowrap; }
.pb-table td { padding: .6em .8em; border-bottom: 1px solid var(--pb-line2); vertical-align: middle; }
.pb-table tr:last-child td { border-bottom: none; }
.pb-table tr.is-sel td { background-color: var(--pb-accent-soft); }
.pb-table tr.clickable { cursor: pointer; }
.pb-table tr.clickable:hover td { background-color: var(--pb-s2); }
.pb-table td.c, .pb-table th.c { text-align: center; }
.pb-table-wrap { overflow-x: auto; }

.pb-switch { display: inline-flex; align-items: center; gap: .6em; cursor: pointer; font-size: .92em; font-weight: 550; user-select: none; }
.pb-switch input { appearance: none; width: 2.2em; height: 1.25em; border-radius: 99px; background: var(--pb-line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.pb-switch input::after { content: ""; position: absolute; top: .15em; left: .15em; width: .95em; height: .95em; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.pb-switch input:checked { background: var(--pb-ok); }
.pb-switch input:checked::after { left: 1.1em; }

.pb-check { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: .4em; border: 1.5px solid var(--pb-line); background: var(--pb-input); cursor: pointer; color: #fff; padding: 0; }
.pb-check.is-on { background: var(--pb-ok); border-color: var(--pb-ok); }
.pb-check .pb-ic { width: .8em; height: .8em; stroke-width: 3; }

.pb-code { font-family: var(--pb-mono); font-size: .84em; background: var(--pb-s2); border: 1px solid var(--pb-line); border-radius: .55em; padding: .5em .65em; line-height: 1.6; overflow-x: auto; }

.pb-props { display: grid; }
.pb-props-group { padding: .9em 1em; display: grid; gap: .75em; border-bottom: 1px solid var(--pb-line2); }
.pb-props-group:last-child { border-bottom: none; }
.pb-props-title { font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pb-faint); display: flex; align-items: center; gap: .5em; }
.pb-props-title .pb-spacer + * { text-transform: none; letter-spacing: 0; }

/* ------------------------------------------------------------------ kreator formularza */

.pb-designer { display: grid; grid-template-columns: 15em minmax(0, 1fr) 20em; gap: 1em; align-items: start; }
@media (max-width: 1300px) { .pb-designer { grid-template-columns: 13em minmax(0, 1fr) 17em; } }
.pb-toolbox { padding: .7em; display: grid; gap: .15em; position: sticky; top: 0; max-height: calc(100vh - 7em); overflow-y: auto; }
.pb-toolbox-label { font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pb-faint); padding: .8em .4em .3em; }
.pb-tool {
  display: flex; align-items: center; gap: .6em; padding: .42em .45em; border-radius: .6em; font-size: .9em; font-weight: 550; cursor: grab;
  border: 1px solid transparent; background: transparent; color: var(--pb-text); font-family: inherit; text-align: left; width: 100%;
}
.pb-tool:hover { background: var(--pb-s2); border-color: var(--pb-line); }
.pb-tool .pb-ai { --ai-size: 1.6em; }
.pb-tool .grip { margin-left: auto; color: var(--pb-faint); }
.pb-tool.is-used { opacity: .45; }

.pb-canvas {
  padding: 1.1em; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .7em; align-content: start; min-height: 20em;
  background-image: radial-gradient(var(--pb-line) 1px, transparent 1px); background-size: 1.1em 1.1em; border-radius: 0 0 var(--pb-radius) var(--pb-radius);
}
.pb-slot {
  border: 1.5px dashed var(--pb-line); border-radius: .7em; padding: .5em .65em .55em; background: var(--pb-surface); display: grid; gap: .3em;
  cursor: pointer; position: relative; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
.pb-slot:hover { border-color: var(--pb-faint); }
.pb-slot-label { font-size: .76em; font-weight: 650; color: var(--pb-muted); display: flex; gap: .4em; align-items: center; min-width: 0; }
.pb-slot-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-slot-fake { min-height: 1.9em; font-size: .84em; color: var(--pb-faint); border: 1px solid var(--pb-line2); border-radius: .5em; padding: .3em .6em; display: flex; align-items: center; gap: .4em; background: var(--pb-input); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pb-slot.is-sel { border: 2px solid var(--pb-accent); box-shadow: 0 0 0 4px var(--pb-accent-soft); }
.pb-slot.is-dragging { opacity: .35; }
.pb-slot.is-over-before::before, .pb-slot.is-over-after::after {
  content: ""; position: absolute; top: -2px; bottom: -2px; width: 4px; border-radius: 4px; background: var(--pb-accent);
}
.pb-slot.is-over-before::before { left: -.5em; }
.pb-slot.is-over-after::after { right: -.5em; }
.pb-slot-group { grid-column: span 12; border-style: solid; border-color: var(--pb-line2); background: color-mix(in srgb, var(--pb-surface) 70%, transparent); }
.pb-slot-group > .pb-canvas { padding: .3em 0 .2em; background: none; min-height: 3.5em; }
.pb-slot-tools { position: absolute; top: .3em; right: .3em; display: none; gap: .1em; background: var(--pb-surface); border-radius: .5em; box-shadow: var(--pb-shadow); }
.pb-slot:hover > .pb-slot-tools, .pb-slot.is-sel > .pb-slot-tools { display: flex; }
.pb-drop-end { grid-column: span 12; border: 1.5px dashed var(--pb-line); border-radius: .7em; min-height: 2.6em; display: grid; place-items: center; color: var(--pb-faint); font-size: .84em; }
.pb-drop-end.is-over { border-color: var(--pb-accent); background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-mini-table { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); font-size: .74em; border: 1px solid var(--pb-line); border-radius: .45em; overflow: hidden; }
.pb-mini-table span { padding: .35em .5em; border-right: 1px solid var(--pb-line2); color: var(--pb-muted); background: var(--pb-s2); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-mini-table span.fx { color: var(--pb-accent); }

.pb-designer-tabs { display: flex; gap: .3em; padding: .5em .7em 0; border-bottom: 1px solid var(--pb-line2); flex-wrap: wrap; align-items: flex-end; }
.pb-designer-tab { display: flex; align-items: center; gap: .3em; padding: .45em .8em; border-radius: .6em .6em 0 0; font-size: .9em; font-weight: 600; color: var(--pb-muted); cursor: pointer; border: 1px solid transparent; border-bottom: none; background: transparent; font-family: inherit; }
.pb-designer-tab.is-on { background: var(--pb-surface); border-color: var(--pb-line2); color: var(--pb-text); margin-bottom: -1px; }
.pb-designer-tab input { border: none; background: transparent; font: inherit; color: inherit; width: 8em; outline: none; }

/* ------------------------------------------------------------------ projektant obiegu */

.pb-flow { display: grid; grid-template-columns: 13em minmax(0, 1fr) 21em; gap: 1em; align-items: start; }
@media (max-width: 1300px) { .pb-flow { grid-template-columns: 12em minmax(0, 1fr) 18em; } }
.pb-flow-canvas { position: relative; overflow: auto; height: calc(100vh - 13em); min-height: 30em; border-radius: 0 0 var(--pb-radius) var(--pb-radius);
  background-color: var(--pb-surface);
  background-image: radial-gradient(var(--pb-line) 1px, transparent 1px); background-size: 20px 20px; }
.pb-flow-canvas svg { display: block; user-select: none; touch-action: none; font-family: var(--pb-font); }
.pb-flow-canvas.is-connecting { cursor: crosshair; }
.wf-node { cursor: grab; }
.wf-node:active { cursor: grabbing; }
.wf-node .body { fill: var(--pb-surface); stroke: var(--pb-line); stroke-width: 1.3; }
.wf-node.is-sel .body { stroke: var(--pb-accent); stroke-width: 2.2; }
.wf-node .halo { fill: none; stroke: var(--pb-accent-soft); stroke-width: 8; opacity: 0; }
.wf-node.is-sel .halo { opacity: 1; }
.wf-node .t { fill: var(--pb-text); font-size: 13px; font-weight: 700; }
.wf-node .s { fill: var(--pb-muted); font-size: 10.5px; font-weight: 500; }
.wf-node .port { fill: var(--pb-surface); stroke: var(--pb-accent); stroke-width: 1.8; opacity: 0; cursor: crosshair; transition: opacity .1s; }
.wf-node:hover .port, .wf-node.is-sel .port, .is-connecting .wf-node .port { opacity: 1; }
.wf-node .gw { fill: var(--butter-bg); stroke: var(--butter-2); stroke-width: 1.6; }
.wf-node .par { fill: var(--lav-bg); stroke: var(--lav-2); stroke-width: 1.6; }
.wf-node .ev { fill: var(--pb-surface); stroke: var(--pb-ok); stroke-width: 2.6; }
.wf-node .ev.end { stroke: var(--pb-danger); stroke-width: 4; }
.wf-node .ev.end.ok { stroke: var(--pb-ok); }
.wf-node.is-sel .ev, .wf-node.is-sel .gw, .wf-node.is-sel .par { stroke: var(--pb-accent); }
.wf-edge { fill: none; stroke: var(--pb-faint); stroke-width: 1.7; cursor: pointer; }
.wf-edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.wf-edge.is-back { stroke: var(--rose-2); stroke-dasharray: 6 4; opacity: .8; }
.wf-edge.is-sel { stroke: var(--pb-accent); stroke-width: 2.4; }
.wf-edge.is-temp { stroke: var(--pb-accent); stroke-dasharray: 5 4; }
.wf-label rect { fill: var(--pb-surface); stroke: var(--pb-line); }
.wf-label text { fill: var(--pb-text); font-size: 10.5px; font-weight: 650; }
.wf-label.cond rect { fill: var(--pb-accent-soft); stroke: none; }
.wf-label.cond text { fill: var(--pb-accent); }
.wf-label.danger rect { fill: var(--rose-bg); stroke: none; }
.wf-label.danger text { fill: var(--rose-fg); }
.wf-label.ok rect { fill: var(--mint-bg); stroke: none; }
.wf-label.ok text { fill: var(--mint-fg); }
.wf-arrow { fill: var(--pb-faint); }
.wf-arrow.back { fill: var(--rose-2); }
.wf-arrow.sel { fill: var(--pb-accent); }
.pb-flow-tools { display: flex; align-items: center; gap: .35em; padding: .45em .7em; border-bottom: 1px solid var(--pb-line2); font-size: .86em; color: var(--pb-muted); flex-wrap: wrap; }
.pb-problems { display: grid; gap: .3em; }
.pb-problems li { font-size: .88em; }

.pb-perm-table td:first-child { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ struktura */

.pb-org { display: grid; grid-template-columns: 19em minmax(0, 1fr); gap: 1em; align-items: start; }
@media (max-width: 1000px) { .pb-org { grid-template-columns: 1fr; } }
.pb-tree { padding: .5em; display: grid; gap: .1em; font-size: .92em; }
.pb-tree-item { display: flex; align-items: center; gap: .5em; padding: .38em .5em; border-radius: .55em; cursor: pointer; }
.pb-tree-item:hover { background: var(--pb-s2); }
.pb-tree-item.is-sel { background: var(--pb-accent-soft); font-weight: 650; }
.pb-tree-item small { margin-left: auto; color: var(--pb-muted); font-size: .8em; }
.pb-tree-item .pb-ai { --ai-size: 1.45em; }
.pb-members { display: flex; gap: .9em 1.4em; flex-wrap: wrap; padding: 1em 1.1em; }
.pb-member { display: flex; align-items: center; gap: .55em; font-size: .9em; }
.pb-member small { display: block; color: var(--pb-muted); font-size: .85em; }

/* ------------------------------------------------------------------ DevExpress: drobne dopasowania */

.dxbl-popup .dxbl-modal-header, .dxbl-popup-header { font-weight: 700; }
.dxbl-toast { font-family: var(--pb-font); }
.pb-popup-body { display: grid; gap: 1em; }
.pb-popup-foot { display: flex; gap: .5em; justify-content: flex-end; width: 100%; }

/* ------------------------------------------------------------------ poprawki po pierwszych testach */
h1:focus, h1:focus-visible { outline: none; }
.pb-subtabs { overflow-y: hidden; scrollbar-width: thin; }
.pb-page-titles { min-width: 14em; }
.pb-items-table { min-width: 760px; }
.pb-items-table td.col-text { min-width: 14em; }
.pb-num-edit input { text-align: right; }
.pb-steps { overflow: visible; flex-wrap: wrap; row-gap: .6em; }
.pb-items-table .dxbl-combobox, .pb-items-table .dxbl-dropdown-edit { min-width: 6.2em; }
.pb-items-table .pb-num-edit { min-width: 6.5em; }

.pb-tab { cursor: grab; }
.pb-tab.is-drop { box-shadow: inset 3px 0 0 var(--pb-accent); }

/* ------------------------------------------------------------------ listy: kafelki, panel, formatowanie */
.pb-kpis { display: flex; gap: .7em; flex-wrap: wrap; }
.pb-kpi {
  display: flex; align-items: center; gap: .7em; min-width: 9.5em; padding: .55em 1em .55em .55em; border-radius: var(--pb-radius);
  border: 1px solid var(--pb-line); background: var(--pb-surface); color: var(--pb-text); cursor: pointer; font: inherit; text-align: left;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.pb-kpi:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--c2) 45%, var(--pb-line)); }
.pb-kpi.is-active { border-color: var(--c2); box-shadow: 0 0 0 3px var(--cbg); }
.pb-kpi-icon { width: 2.4em; height: 2.4em; border-radius: .75em; display: grid; place-items: center; background: var(--cbg); color: var(--cfg); flex: none; }
.pb-kpi-text { display: grid; line-height: 1.15; }
.pb-kpi-text b { font-size: 1.25em; font-weight: 800; font-variant-numeric: tabular-nums; }
.pb-kpi-text span { font-size: .8em; color: var(--pb-muted); }
.pb-list-toolbar { display: flex; gap: .4em; flex-wrap: wrap; align-items: center; }
.pb-list-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1em; align-items: stretch; }
.pb-list-layout.with-panel { grid-template-columns: minmax(0, 1fr) .6em var(--pb-panel-w, 24em); gap: .2em; }
@media (max-width: 1100px) { .pb-list-layout.with-panel { grid-template-columns: minmax(0, 1fr); } }
.pb-compact-design { display: grid; grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr); gap: .5em .8em; align-items: center; font-size: .92em; }
.pb-compact-design small { color: var(--pb-muted); }
/* Pasek zaznaczenia nad listą: przyciski działające na zaznaczonych dokumentach. */
.pb-select-bar { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; padding: .5em .8em; border-radius: .8em; background: var(--pb-accent-soft); border: 1px solid var(--pb-line); font-size: .92em; }
/* Układ zwarty listy (wąski ekran) i widok „lista + dokument”. */
.pb-list-toolbar.is-compact .pb-table-only { display: none; }
.pb-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: .2em; align-items: stretch; }
.pb-split.is-split { grid-template-columns: var(--pb-split-w, 25em) .6em minmax(0, 1fr); }
.pb-compact { outline: none; overflow: hidden; }
.pb-split-side { min-width: 0; display: flex; flex-direction: column; gap: .6em; }
.pb-split.is-split .pb-split-side, .pb-split-doc { height: calc(100vh - 7.4em); min-height: 22em; }
.pb-split.is-split .pb-compact { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.pb-split-doc { overflow-y: auto; }
.pb-split-head { display: grid; gap: .5em; }
.pb-split-title { display: flex; align-items: center; gap: .4em; min-width: 0; }
.pb-split-title b { font-size: 1.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-split-icon { display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: .6em; background: var(--cbg); color: var(--cfg); flex: none; }
.pb-split-find { display: flex; gap: .4em; align-items: center; }
.pb-split-find .pb-find { flex: 1 1 0; min-width: 0; }
.pb-split-find .pb-find input { width: 100%; min-width: 0; }
.pb-split-doc { min-width: 0; padding-right: .2em; }
.pb-split-doc > .pb-page { padding: 0; }
.pb-split-bar { display: flex; align-items: center; gap: .4em; margin-bottom: .5em; }
.pb-crow { display: grid; gap: .2em; padding: .65em .9em; border-bottom: 1px solid var(--pb-line2); border-left: 3px solid transparent; cursor: pointer; }
.pb-crow:hover { background: var(--pb-s2); }
.pb-crow.is-sel { background: var(--pb-accent-soft); border-left-color: var(--pb-accent); }
.pb-crow-line { display: flex; align-items: center; gap: .6em; min-width: 0; }
.pb-crow-line .l { display: flex; align-items: center; gap: .5em; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.pb-crow-line .l > span { overflow: hidden; text-overflow: ellipsis; }
.pb-crow-line .l > .pb-pill, .pb-crow-line .l > .pb-docno { flex: none; }
.pb-crow-line .r { display: flex; align-items: center; gap: .5em; flex: none; margin-left: auto; white-space: nowrap; }
.pb-crow-line.l1, .pb-crow-line.l3 { font-size: .86em; }
.pb-crow-line.l1 .r, .pb-crow-line.l3 { color: var(--pb-muted); }
.pb-crow-line.l2 { font-weight: 600; }
.pb-crow-line.l3 .l > span + span::before { content: "·"; margin-right: .5em; opacity: .6; }
.pb-crow-more { display: flex; justify-content: center; padding: .7em; }

.pb-side-panel { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; }
.pb-side-tabs { display: flex; gap: .2em; padding: .4em .5em; border-bottom: 1px solid var(--pb-line2); }
.pb-side-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: .35em; border: none; background: transparent; font: inherit; font-size: .82em; font-weight: 600; color: var(--pb-muted); padding: .45em .3em; border-radius: .55em; cursor: pointer; }
.pb-side-tabs button.is-on { background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-side-tabs em { font-style: normal; font-size: .85em; opacity: .75; }
.pb-side-body { overflow: auto; padding: .8em; display: grid; gap: .4em; align-content: start; }
.pb-side-preview { height: 24em; border: 1px solid var(--pb-line2); border-radius: .7em; overflow: hidden; display: grid; margin-top: .4em; }
/* Załączniki w panelu listy: lista plików u góry, podgląd wypełnia panel do dołu. */
.pb-side-body.is-att { display: flex; flex-direction: column; overflow: hidden; }
.pb-side-att-list { flex: none; max-height: 12em; overflow-y: auto; display: grid; gap: .15em; }
.pb-side-body.is-att .pb-side-preview { flex: 1 1 auto; height: auto; min-height: 14em; }
.pb-vsteps { display: grid; }
.pb-vstep { display: grid; grid-template-columns: 1.7em minmax(0, 1fr); gap: .7em; padding-bottom: 1em; position: relative; font-size: .9em; }
.pb-vstep::before { content: ""; position: absolute; left: .82em; top: 1.8em; bottom: 0; width: 2px; background: var(--pb-line); }
.pb-vstep:last-child::before { display: none; }
.pb-vstep small { display: block; color: var(--pb-muted); font-size: .88em; }
.pb-vstep.is-done .pb-step-c { background: var(--pb-ok); border-color: var(--pb-ok); color: #fff; }
.pb-vstep.is-done::before { background: var(--pb-ok); }
.pb-vstep.is-current .pb-step-c { background: var(--pb-accent); border-color: var(--pb-accent); color: var(--pb-on-accent); box-shadow: 0 0 0 4px var(--pb-accent-soft); }
.pb-vstep.is-rejected .pb-step-c { background: var(--pb-danger); border-color: var(--pb-danger); color: #fff; }
.pb-vstep.is-upcoming { color: var(--pb-muted); }
.pb-vstep .pb-step-c .pb-ic { width: .9em; height: .9em; stroke-width: 3; }

/* formatowanie warunkowe (klasy nadawane przez ListService) */
.pb-grid tr.pb-fmt-mint td, .pb-grid td.pb-fmt-mint { background-color: var(--mint-bg) !important; color: var(--mint-fg); }
.pb-grid tr.pb-fmt-peach td, .pb-grid td.pb-fmt-peach { background-color: var(--peach-bg) !important; color: var(--peach-fg); }
.pb-grid tr.pb-fmt-lav td, .pb-grid td.pb-fmt-lav { background-color: var(--lav-bg) !important; color: var(--lav-fg); }
.pb-grid tr.pb-fmt-sky td, .pb-grid td.pb-fmt-sky { background-color: var(--sky-bg) !important; color: var(--sky-fg); }
.pb-grid tr.pb-fmt-butter td, .pb-grid td.pb-fmt-butter { background-color: var(--butter-bg) !important; color: var(--butter-fg); }
.pb-grid tr.pb-fmt-rose td, .pb-grid td.pb-fmt-rose { background-color: var(--rose-bg) !important; color: var(--rose-fg); }
.pb-grid tr.pb-fmt-slate td, .pb-grid td.pb-fmt-slate { background-color: var(--slate-bg) !important; color: var(--slate-fg); }
.pb-grid tr.pb-fmt-acc td, .pb-grid td.pb-fmt-acc { background-color: var(--acc-bg) !important; color: var(--acc-fg); }
.pb-grid tr.pb-fmt-bold td, .pb-grid td.pb-fmt-bold { font-weight: 700; }

/* kreator formularza: przeciąganie wskaźnikiem */
.pb-dnd-ghost { position: fixed; z-index: 2000; pointer-events: none; padding: .4em .8em; border-radius: .6em; background: var(--pb-surface);
  border: 1px solid var(--pb-accent); color: var(--pb-text); font-size: .86em; font-weight: 650; box-shadow: var(--pb-shadow-lg); }
body.pb-dnd-active, body.pb-dnd-active * { cursor: grabbing !important; user-select: none; }
.pb-slot { cursor: grab; }
.pb-slot.is-dragging, .pb-tool.is-dragging { opacity: .4; }
.pb-slot.is-over-before::before, .pb-slot.is-over-after::after { content: ""; position: absolute; top: -2px; bottom: -2px; width: 4px; border-radius: 4px; background: var(--pb-accent); }
.pb-slot[data-full].is-over-before::before, .pb-slot[data-full].is-over-after::after { left: 0; right: 0; width: auto; height: 4px; top: auto; bottom: auto; }
.pb-slot[data-full].is-over-before::before { top: -.45em; }
.pb-slot[data-full].is-over-after::after { bottom: -.45em; }
.pb-drop-end.is-over { border-color: var(--pb-accent); background: var(--pb-accent-soft); color: var(--pb-accent); }

/* Zdjęcie operatora zamiast inicjałów */
img.pb-avatar.is-photo { object-fit: cover; padding: 0; background: var(--pb-bg-2, #eee); }

/* Zdjęcie w profilu i podgląd uprawnień */
.pb-photo-edit { display: flex; align-items: center; gap: 1em; }
.pb-photo-actions { display: flex; flex-wrap: wrap; gap: .5em; }
.pb-access { display: grid; gap: .8em; }
.pb-access-meta { display: flex; flex-wrap: wrap; gap: .4em; }
.pb-access-meta .pb-pill { display: inline-flex; align-items: center; gap: .35em; }
.pb-h3 { font-weight: 700; font-size: .95em; margin-top: .4em; }
.pb-access-table td.c, .pb-access-table th.c { text-align: center; }
.pb-access-table tr.is-off td { color: var(--pb-muted); }
.pb-access-table tr.is-off .pb-ai { opacity: .45; }
.pb-access-field td { font-size: .86em; padding-top: .15em !important; padding-bottom: .35em !important; }
.pb-access-field td:first-child { padding-left: 2.6em; }
.pb-access-yes { color: var(--mint-fg); }
.pb-access-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); gap: .8em 1.4em; }
.pb-access-menu-group { display: grid; gap: .35em; align-content: start; }
.pb-access-menu-group > b { font-size: .8em; text-transform: uppercase; letter-spacing: .05em; color: var(--pb-muted); }

/* Kreator listy — wybór koloru formatowania warunkowego */
.pb-fmt-swatches { display: flex; gap: .25em; flex-wrap: wrap; }
.pb-fmt-swatch { width: 2.1em; height: 2.1em; border-radius: .5em; border: 2px solid transparent; font: inherit; font-size: .8em; font-weight: 700; cursor: pointer; }
.pb-fmt-swatch.is-on { border-color: var(--pb-text); }
.pb-fmt-swatch.pb-fmt-mint { background: var(--mint-bg); color: var(--mint-fg); }
.pb-fmt-swatch.pb-fmt-peach { background: var(--peach-bg); color: var(--peach-fg); }
.pb-fmt-swatch.pb-fmt-lav { background: var(--lav-bg); color: var(--lav-fg); }
.pb-fmt-swatch.pb-fmt-sky { background: var(--sky-bg); color: var(--sky-fg); }
.pb-fmt-swatch.pb-fmt-butter { background: var(--butter-bg); color: var(--butter-fg); }
.pb-fmt-swatch.pb-fmt-rose { background: var(--rose-bg); color: var(--rose-fg); }
.pb-fmt-swatch.pb-fmt-slate { background: var(--slate-bg); color: var(--slate-fg); }
.pb-fmt-swatch.pb-fmt-acc { background: var(--acc-bg); color: var(--acc-fg); }

/* Struktura organizacyjna jako drzewo z liniami */
.pb-otree-tools { display: flex; gap: .25em; justify-content: flex-end; padding-bottom: .2em; border-bottom: 1px solid var(--pb-line); margin-bottom: .3em; }
.pb-otree { list-style: none; margin: 0; padding: 0; }
.pb-otree .pb-otree { padding-left: 1.25em; margin-left: .95em; border-left: 1px dashed var(--pb-line); }
.pb-otree .pb-otree > li { position: relative; }
.pb-otree .pb-otree > li::before {
  content: ""; position: absolute; left: -1.25em; top: 1.2em; width: 1.05em; border-top: 1px dashed var(--pb-line);
}
.pb-otree .pb-otree > li:last-child::after {
  content: ""; position: absolute; left: -1.35em; top: 1.25em; bottom: 0; width: .3em; background: var(--pb-surface);
}
.pb-otree .pb-tree-item { gap: .45em; }
.pb-otree-toggle {
  width: 1.3em; height: 1.3em; flex: none; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: .35em;
  background: transparent; color: var(--pb-muted); cursor: pointer; transition: transform .15s;
}
.pb-otree-toggle:hover { background: var(--pb-s2); color: var(--pb-text); }
.pb-otree-toggle.is-open { transform: rotate(90deg); }
.pb-otree-toggle.is-leaf { cursor: default; }
.pb-otree-toggle .pb-icon, .pb-otree-toggle svg { width: .85em; height: .85em; }
.pb-otree-text { display: grid; min-width: 0; line-height: 1.2; }
.pb-otree-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-otree-text small { margin: 0 !important; color: var(--pb-muted); font-size: .8em; }
.pb-otree-count { margin-left: auto; display: inline-flex; align-items: center; gap: .2em; font-size: .78em; color: var(--pb-muted); background: var(--pb-s2); border-radius: 1em; padding: .1em .5em; }
.pb-otree-count svg { width: .9em; height: .9em; }

/* Przełącznik menu (przestrzeni roboczych) */
.pb-menu-switch { position: relative; margin: 0 .6em .5em; }
.pb-menu-switch-btn {
  width: 100%; display: flex; align-items: center; gap: .6em; padding: .45em .55em; border-radius: .75em;
  border: 1px solid var(--pb-line); background: var(--pb-surface); color: var(--pb-text); font: inherit; cursor: pointer; text-align: left;
}
.pb-menu-switch-btn:hover { background: var(--pb-s2); }
.pb-menu-switch-btn .pb-nav-text { display: grid; line-height: 1.15; font-weight: 650; font-size: .92em; flex: 1; min-width: 0; }
.pb-menu-switch-btn small { font-size: .72em; font-weight: 600; color: var(--pb-muted); text-transform: uppercase; letter-spacing: .06em; }
.pb-menu-switch-chev { color: var(--pb-muted); transition: transform .15s; }
.pb-menu-switch.is-open .pb-menu-switch-chev { transform: rotate(180deg); }
.pb-menu-switch-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + .3em); padding: .3em; display: grid; gap: .1em;
  background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: .8em; box-shadow: 0 12px 32px rgba(20, 24, 40, .18);
}
.pb-menu-switch-list button {
  display: flex; align-items: center; gap: .55em; padding: .45em .5em; border: 0; border-radius: .55em; background: transparent;
  color: var(--pb-text); font: inherit; font-size: .92em; cursor: pointer; text-align: left;
}
.pb-menu-switch-list button span { flex: 1; }
.pb-menu-switch-list button:hover { background: var(--pb-s2); }
.pb-menu-switch-list button.is-on { font-weight: 650; }
.pb-menu-switch-list .pb-ic { color: var(--pb-accent); }
.is-collapsed .pb-menu-switch { margin: 0 .35em .5em; }
.is-collapsed .pb-menu-switch-btn { justify-content: center; padding: .4em; }
.is-collapsed .pb-menu-switch-btn .pb-nav-text, .is-collapsed .pb-menu-switch-chev { display: none; }
.is-collapsed .pb-menu-switch-list { width: 14em; right: auto; left: 100%; top: 0; }

/* Pulpit menu złożony z kafelków */
.pb-dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1em; align-items: start; }
.pb-widget { min-width: 0; position: relative; }
.pb-w-1 { grid-column: span 1; } .pb-w-2 { grid-column: span 2; } .pb-w-3 { grid-column: span 3; } .pb-w-4 { grid-column: span 4; }
@media (max-width: 1100px) { .pb-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pb-w-3, .pb-w-4 { grid-column: span 2; } }
@media (max-width: 640px) { .pb-dash { grid-template-columns: minmax(0, 1fr); } .pb-widget { grid-column: span 1 !important; } }
.pb-widget-counter { display: grid; padding: 1em 1.1em; }
.pb-widget-counter:hover { text-decoration: none; }
.pb-widget-counter:hover b { color: var(--pb-accent); }
.pb-widget-error { margin: .2em 1.1em .9em; font-size: .82em; color: var(--rose-fg); }
.pb-widget-rows { display: grid; padding: .3em .5em .6em; }
.pb-widget-row { display: flex; align-items: center; gap: .7em; padding: .45em .6em; border-radius: .6em; color: var(--pb-text); min-width: 0; }
.pb-widget-row:hover { background: var(--pb-s2); text-decoration: none; }
.pb-widget-row-main { display: grid; min-width: 0; line-height: 1.25; }
.pb-widget-row-main b { font-weight: 650; font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-widget-row-main span { font-size: .8em; color: var(--pb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-widget-text { white-space: pre-wrap; font-size: .93em; line-height: 1.5; }
.pb-dash.is-editing .pb-widget { outline: 2px dashed color-mix(in srgb, var(--pb-accent) 45%, transparent); outline-offset: 3px; }
.pb-dash.is-editing .pb-widget a { pointer-events: none; }
.pb-widget-tools { display: flex; align-items: center; gap: .15em; padding: .35em .5em; border-bottom: 1px solid var(--pb-line); background: var(--pb-s2); border-radius: var(--pb-radius, .9em) var(--pb-radius, .9em) 0 0; }
.pb-widget-kind { font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pb-muted); }
.pb-widget-add { min-height: 7em; display: grid; place-items: center; align-content: center; gap: .3em; border: 2px dashed var(--pb-line); background: transparent; color: var(--pb-accent); font: inherit; font-weight: 650; cursor: pointer; }
.pb-widget-add:hover { background: var(--pb-accent-soft); }
.pb-dash-bar {
  position: sticky; bottom: 1em; z-index: 20; margin-top: 1.2em; display: flex; align-items: center; gap: .6em; padding: .6em .8em;
  background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: .9em; box-shadow: 0 10px 30px rgba(20, 24, 40, .16);
}
.pb-dash-bar > .pb-ic { color: var(--pb-accent); }
.pb-shortcut-list { display: flex; flex-wrap: wrap; gap: .4em; }
.pb-shortcut-chip { display: inline-flex; align-items: center; gap: .45em; padding: .3em .7em .3em .35em; border-radius: 2em; border: 1px solid var(--pb-line); background: var(--pb-surface); color: var(--pb-text); font: inherit; font-size: .88em; cursor: pointer; }
.pb-shortcut-chip.is-on { border-color: var(--pb-accent); background: var(--pb-accent-soft); font-weight: 650; }

/* Pola specjalne: KPI, wykres, powiązane dokumenty */
.pb-kpi-field { border: 1px solid var(--pb-line); border-radius: .9em; padding: .85em 1em; background: linear-gradient(160deg, var(--cbg), var(--pb-surface) 70%); display: grid; gap: .35em; }
.pb-kpi-field-head { display: flex; align-items: center; gap: .5em; }
.pb-kpi-field-label { font-size: .82em; font-weight: 650; color: var(--pb-muted); flex: 1; }
.pb-kpi-field-pct { font-size: .8em; font-weight: 750; color: var(--cfg); background: var(--cbg); padding: .1em .55em; border-radius: 1em; }
.pb-kpi-field-value { display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap; }
.pb-kpi-field-value b { font-size: 1.55em; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pb-kpi-field-value span { color: var(--pb-muted); font-size: .88em; }
.pb-kpi-field-track { height: .5em; border-radius: 1em; background: var(--pb-s2); overflow: hidden; }
.pb-kpi-field-track i { display: block; height: 100%; border-radius: 1em; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width .3s; }
.pb-kpi-field-rest { font-size: .8em; color: var(--cfg); font-weight: 600; }
.pb-chart-field, .pb-related-field { border: 1px solid var(--pb-line); border-radius: .9em; padding: .85em 1em; display: grid; gap: .6em; }

/* Drzewo powiązań: gałęzie z obiektami wskazującymi na ten obiekt */
.pb-tree-field { gap: .35em; }
.pb-tree-branch > summary { display: flex; align-items: center; gap: .5em; padding: .3em .2em; cursor: pointer; border-radius: .5em; list-style: none; }
.pb-tree-branch > summary::-webkit-details-marker { display: none; }
.pb-tree-branch > summary::before { content: "▸"; color: var(--pb-muted, #888); width: .9em; }
.pb-tree-branch[open] > summary::before { content: "▾"; }
.pb-tree-branch > summary:hover { background: var(--pb-hover, rgba(127, 127, 127, .08)); }
.pb-tree-name { font-weight: 600; }
.pb-tree-body { display: grid; gap: .15em; margin-left: 1.25em; padding-left: .7em; border-left: 1px solid var(--pb-line); }
.pb-tree-row { display: flex; align-items: center; gap: .55em; padding: .25em .4em; border-radius: .5em; color: inherit; text-decoration: none; }
.pb-tree-row:hover { background: var(--pb-hover, rgba(127, 127, 127, .08)); }
.pb-tree-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-tree-link { display: flex; align-items: center; gap: .55em; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.pb-tree-cell { width: 8.5em; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92em; }
.pb-tree-cell.pb-num { text-align: right; font-variant-numeric: tabular-nums; }
.pb-tree-tail { display: flex; align-items: center; justify-content: flex-end; gap: .3em; width: 9.5em; flex: none; }
.pb-tree-head { color: var(--pb-muted, #888); padding-top: 0; padding-bottom: 0; }
/* Szerokość w em liczy się od własnej czcionki komórki — nagłówek (.8em) musi wyjść tyle co komórka wiersza (8.5em × .92). */
.pb-tree-head .pb-tree-cell { font-size: .8em; width: calc(8.5em * .92 / .8); }
.pb-tree-head:hover, .pb-tree-sum:hover { background: none; }
.pb-tree-sum { font-weight: 600; border-top: 1px solid var(--pb-line); border-radius: 0; }
.pb-tree-pin-results { display: grid; gap: .1em; border: 1px solid var(--pb-line); border-radius: .6em; padding: .3em; max-height: 22em; overflow: auto; }
/* Zakładka „Dostęp”: zespół obiektu */
.pb-team { display: grid; gap: 1em; padding: 1em 0; }
.pb-team-form { display: grid; gap: .5em; padding: .8em; border: 1px solid var(--pb-line); border-radius: .7em; }
.pb-team-history > summary { cursor: pointer; color: var(--pb-muted, inherit); font-size: .92em; margin-bottom: .5em; }
.pb-why { display: grid; gap: .8em; }
.pb-why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6em; }
.pb-why-list li { display: flex; gap: .55em; align-items: flex-start; line-height: 1.45; }
.pb-why-list li > .pb-ic { flex: none; margin-top: .2em; }
.pb-why-list .pb-pill { margin-left: .4em; font-size: .8em; }
.pb-myteams td a { font-weight: 500; }

/* Lista-drzewo obiektów (GPZ → projekty → gałęzie → dokumenty) */
.pb-otree { font-size: .92em; flex: 1 1 0; min-height: 0; overflow: auto; display: grid; gap: 0; align-content: start; border: 1px solid var(--pb-line); border-radius: .7em; padding: .3em; }
.pb-otree-row { display: flex; align-items: center; gap: .45em; padding: .22em .45em; border: 0; border-radius: .45em; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pb-otree-row:hover { background: var(--pb-hover, rgba(127, 127, 127, .08)); }
.pb-otree-row.is-sel { background: color-mix(in srgb, var(--pb-accent, #4a7dff) 16%, transparent); }
.pb-otree-row.is-branch { font-weight: 600; }
.pb-otree-toggle { width: 1.2em; flex: none; border: 0; background: none; color: var(--pb-muted, #888); font: inherit; cursor: pointer; padding: 0; text-align: center; }
.pb-otree-text { flex: 1; min-width: 9em; display: grid; }
.pb-otree-cell { width: 8em; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; font-weight: 400; }
.pb-otree-cell.pb-num { text-align: right; font-variant-numeric: tabular-nums; }
.pb-otree-head { color: var(--pb-muted, #888); cursor: default; padding-top: 0; padding-bottom: 0; }
.pb-otree-head:hover { background: none; }
.pb-otree-head .pb-otree-cell { font-size: .78em; width: 10.256em; }
.pb-otree-line { display: flex; align-items: center; gap: .4em; min-width: 0; }
.pb-otree-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 3em; }
.pb-otree .pb-docno { margin-right: .45em; font-weight: 600; }
.pb-otree-sub { color: var(--pb-muted, #888); font-size: .86em; line-height: 1.2; }
.pb-otree-text > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.pb-otree-add { display: none; flex: none; align-items: center; gap: .2em; font-size: .8em; font-weight: 400; padding: .1em .45em; border-radius: 1em; border: 1px solid var(--pb-line); color: inherit; text-decoration: none; white-space: nowrap; }
.pb-otree-row:hover .pb-otree-add, .pb-otree-row.is-sel .pb-otree-add { display: inline-flex; }
.pb-otree-hit { width: 100%; }

/* Edytor gałęzi: drzewo po lewej, ustawienia zaznaczonej gałęzi po prawej */
.pb-tree-editor { display: grid; grid-template-columns: minmax(15em, 2fr) 3fr; gap: 1em; align-items: start; }
.pb-tree-editor-tree { display: grid; gap: .5em; }
.pb-tree-editor-nodes { display: grid; gap: .1em; border: 1px solid var(--pb-line); border-radius: .6em; padding: .3em; min-height: 12em; max-height: 24em; overflow: auto; align-content: start; }
.pb-tree-editor-node { display: flex; align-items: center; gap: .45em; width: 100%; padding: .35em .5em; border: 0; border-radius: .45em; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pb-tree-editor-node:hover { background: var(--pb-hover, rgba(127, 127, 127, .08)); }
.pb-tree-editor-node.is-selected { background: color-mix(in srgb, var(--pb-accent, #4a7dff) 16%, transparent); font-weight: 600; }
.pb-tree-editor-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-tree-editor-details { display: grid; gap: .7em; align-content: start; }
.pb-tree-editor-node.is-preview { cursor: default; opacity: .6; }
.pb-tree-editor-node.is-preview:hover { background: none; }
@media (max-width: 720px) { .pb-tree-editor { grid-template-columns: 1fr; } }
.pb-chart-field-title { font-size: .82em; font-weight: 650; color: var(--pb-muted); }
.pb-chart-pie { display: flex; align-items: center; gap: 1.4em; flex-wrap: wrap; }
.pb-chart-slice { fill: var(--c2); stroke: var(--pb-surface); stroke-width: .02; }
.pb-chart-slice:hover { fill: var(--c1); }
.pb-chart-center-pct { font-size: .32px; font-weight: 800; fill: var(--pb-text); }
.pb-chart-center-label { font-size: .13px; fill: var(--pb-muted); }
.pb-chart-legend { display: grid; gap: .4em; font-size: .88em; min-width: 12em; flex: 1; }
.pb-chart-legend div { display: flex; align-items: center; gap: .5em; }
.pb-chart-legend i { width: .8em; height: .8em; border-radius: .25em; background: var(--c2); flex: none; }
.pb-chart-legend span { flex: 1; }
.pb-chart-legend b { font-variant-numeric: tabular-nums; }
.pb-chart-bars { display: grid; gap: .45em; }
.pb-chart-bar { display: grid; grid-template-columns: minmax(6em, 12em) 1fr auto; align-items: center; gap: .7em; font-size: .88em; }
.pb-chart-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-chart-bar-track { height: .7em; border-radius: 1em; background: var(--pb-s2); overflow: hidden; }
.pb-chart-bar-track i { display: block; height: 100%; border-radius: 1em; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.pb-chart-bar b { font-variant-numeric: tabular-nums; }
.pb-related-head { display: flex; align-items: center; gap: .5em; }
.pb-related-table tfoot td { border-top: 1px solid var(--pb-line); }

/* Reguły typu */
.pb-rule { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .6em 1em; padding: .9em 1em; border: 1px solid var(--pb-line); border-radius: .8em; }
.pb-rule.is-off { opacity: .55; }
.pb-rule-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 1em; flex-wrap: wrap; }
@media (max-width: 800px) { .pb-rule { grid-template-columns: 1fr; } }

/* Wydruki i akcje na dokumencie */
.pb-print-menu { position: relative; }
.pb-print-list { left: auto; right: 0; min-width: 16em; }
.pb-print-list a { display: flex; align-items: center; gap: .55em; padding: .45em .6em; border-radius: .55em; color: var(--pb-text); font-size: .92em; }
.pb-print-list a:hover { background: var(--pb-s2); text-decoration: none; }
.pb-action-btn { border-color: color-mix(in srgb, var(--cfg) 30%, var(--pb-line)); color: var(--cfg); background: var(--cbg); }
.pb-action-btn:hover { background: color-mix(in srgb, var(--cbg) 70%, var(--c1)); }
.pb-report-host { overflow: hidden; }
.pb-report-page { display: grid; gap: .8em; }
.pb-print-row { display: flex; align-items: center; gap: .2em; }
.pb-print-row > a:first-child { flex: 1; }
.pb-print-list .pb-print-pdf { font-size: .72em; font-weight: 750; letter-spacing: .04em; color: var(--rose-fg); background: var(--rose-bg); padding: .25em .5em; border-radius: .4em; }

/* Warianty obiegu */
.pb-variants { padding: 1em 1.1em; display: grid; gap: .8em; }
.pb-variants-row { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; }
.pb-variants-label { font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pb-muted); width: 6em; }
.pb-nip-row { gap: .4em; align-items: center; }


/* ------------------------------------------------------------------ listy: wygląd wierszy (bez pionowych linii) */
:root { --pb-row-alt: #F7F8FC; --pb-row-line: #E8EAF1; }
:root[data-theme="dark"] { --pb-row-alt: rgba(255, 255, 255, .025); --pb-row-line: rgba(255, 255, 255, .07); }
.pb-grid, .pb-grid .dxbl-grid-table { border: none !important; }
.pb-grid .dxbl-grid-table > thead > tr > th,
.pb-grid .dxbl-grid-table > tbody > tr > td,
.pb-grid .dxbl-grid-table > tfoot > tr > td { border-left-style: none !important; border-right-style: none !important; border-top-style: none !important; }
/* Poziomy separator jako tło komórki — w pierwszej i ostatniej kolumnie cofnięty od krawędzi. */
.pb-grid .dxbl-grid-table > tbody > tr > td {
  border-bottom-style: none !important;
  background-image: linear-gradient(var(--pb-row-line), var(--pb-row-line));
  background-repeat: no-repeat; background-size: 100% 1px; background-position: left bottom;
}
.pb-grid .dxbl-grid-table > tbody > tr > td:first-child { background-size: calc(100% - 14px) 1px; background-position: right bottom; }
.pb-grid .dxbl-grid-table > tbody > tr > td:last-child { background-size: calc(100% - 14px) 1px; background-position: left bottom; }
.pb-grid .dxbl-grid-table > tbody > tr:nth-child(even) > td { background-color: var(--pb-row-alt); }
.pb-grid .dxbl-grid-table > thead > tr > th { border-bottom: 1px solid var(--pb-row-line) !important; }
.pb-grid .dxbl-grid-table > tbody > tr > td { padding-top: .5em; padding-bottom: .5em; }

/* Ikonka dokumentu + znaczniki załączników i komentarzy */
.pb-ico-cell { display: inline-flex; align-items: center; gap: .3em; }
.pb-row-marks { display: inline-flex; align-items: center; gap: .2em; color: var(--pb-text); opacity: .72; line-height: 1; }
.pb-row-marks > span { display: inline-flex; align-items: center; gap: .05em; }
.pb-row-marks .pb-ic { width: .95em; height: .95em; }
.pb-row-marks small { font-size: .72em; font-weight: 650; }

/* Uchwyt szerokości panelu bocznego */
.pb-splitter { cursor: col-resize; position: relative; border-radius: 1em; touch-action: none; }
.pb-splitter::after { content: ""; position: absolute; top: 50%; left: 50%; width: 4px; height: 3.2em; transform: translate(-50%, -50%); border-radius: 2px; background: var(--pb-line); transition: background .15s, height .15s; }
.pb-splitter:hover::after, body.pb-resizing .pb-splitter::after { background: var(--pb-accent); height: 5em; }
body.pb-resizing { cursor: col-resize; user-select: none; }
body.pb-resizing iframe { pointer-events: none; }
@media (max-width: 1100px) { .pb-splitter { display: none; } }

/* Lista-drzewo: pierwsza kolumna jak „Struktura i grupy” (przerywane prowadnice, ikona, numer i opis) */
.pb-tree-cell { display: inline-flex; align-items: center; gap: .55em; min-width: 0; vertical-align: middle; }
.pb-tree-cell-text { display: grid; line-height: 1.2; min-width: 0; }
.pb-tree-cell-text b { font-weight: 650; font-size: .95em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-tree-cell-text small { color: var(--pb-muted); font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-grid { --pb-tree-line: #C3C9D8; }
:root[data-theme="dark"] .pb-grid { --pb-tree-line: rgba(255, 255, 255, .24); }
.pb-grid .dxbl-grid-tree-node-expand-controls-container { align-self: stretch; }
.pb-grid .dxbl-grid-tree-node-indent { position: relative; }
.pb-grid .dxbl-grid-tree-node-indent::before {
  content: ""; position: absolute; left: 50%; top: -1.2em; bottom: -1.2em; border-left: 1px dashed var(--pb-tree-line);
}
.pb-grid .dxbl-grid-tree-node-expand-button-placeholder { position: relative; }
.pb-grid .dxbl-grid-tree-node-indents-container:has(.dxbl-grid-tree-node-indent) + .dxbl-grid-tree-node-expand-button-placeholder::before {
  content: ""; position: absolute; left: -50%; right: 10%; top: 50%; border-top: 1px dashed var(--pb-tree-line);
}
.pb-grid td:has(.dxbl-grid-tree-node-expand-controls-container) { overflow: visible; }
.pb-grid .dxbl-grid-tree-node-expand-button { color: var(--pb-muted); border-radius: .35em; }
.pb-grid .dxbl-grid-tree-node-expand-button:hover { background: var(--pb-s2); color: var(--pb-text); }

/* Listy pozycji-dokumentów na formularzu */
.pb-child-list { border: 1px solid var(--pb-line); border-radius: .9em; overflow: hidden; }
.pb-child-head { display: flex; align-items: center; gap: .55em; padding: .55em .8em; background: var(--pb-s2); border-bottom: 1px solid var(--pb-line); }
.pb-child-empty { padding: 1em; color: var(--pb-muted); font-size: .9em; }
.pb-child-table td, .pb-child-table th { border-left: none !important; border-right: none !important; }
.pb-child-table tbody tr:nth-child(even) td { background: var(--pb-row-alt); }
.pb-child-table tfoot td { border-top: 1px solid var(--pb-line); }
.pb-child-sub { display: inline-flex; align-items: center; gap: .15em; font-size: .78em; color: var(--pb-muted); margin-right: .3em; }
.pb-child-sub .pb-ic { width: .9em; height: .9em; }

/* Panel edycji pozycji nad dokumentem-ojcem (zasłania ojca — blokada edycji) */
.pb-drawer-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(15, 18, 30, .38); backdrop-filter: blur(1.5px); }
.pb-drawer {
  position: fixed; z-index: 901; top: 0; right: 0; bottom: 0; width: min(92vw, 1500px);
  background: var(--pb-bg, #F5F6FA); box-shadow: -18px 0 50px rgba(15, 18, 30, .28);
  display: grid; grid-template-rows: auto minmax(0, 1fr); animation: pb-drawer-in .18s ease-out;
}
.pb-drawer .pb-drawer { width: min(88vw, 1440px); }
.pb-drawer-bar { display: flex; align-items: center; gap: .5em; padding: .55em 1em; border-bottom: 1px solid var(--pb-line); background: var(--pb-surface); font-weight: 650; font-size: .9em; }
.pb-drawer-body { overflow: auto; padding: 1em 1.2em; }
@keyframes pb-drawer-in { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }

.pb-child-inline { padding-top: .2em !important; padding-bottom: .2em !important; min-width: 7em; }

/* Zaznaczony wiersz: naprzemienne tło nie może przykryć zaznaczenia (tekst motywu jest wtedy biały). */
.pb-grid .dxbl-grid-table > tbody > tr.dxbl-grid-focused-row > td { background-color: var(--pb-accent-soft) !important; color: var(--pb-text) !important; }

/* Komórka pozycji z odrzuconą zmianą (np. puste pole wymagane) */
.pb-child-table td.pb-cell-invalid { background: var(--rose-bg) !important; }
.pb-child-table td.pb-cell-invalid .dxbl-text-edit { border-color: var(--pb-danger) !important; box-shadow: 0 0 0 1px var(--pb-danger); }

/* Pola edycji w wierszach pozycji (dodanych i szybkiego dodawania): bez ramek do czasu najechania albo wejścia w pole */
.pb-child-inline .dxbl-text-edit { background: transparent; border-color: transparent; box-shadow: none; transition: border-color .15s, background .15s; }
.pb-child-inline .dxbl-text-edit:hover { border-color: var(--pb-line); background: var(--pb-input); }
.pb-child-inline .dxbl-text-edit.dxbl-focused, .pb-child-inline .dxbl-text-edit:focus-within { border-color: var(--pb-accent); background: var(--pb-input); }

/* Przeciąganie pozycji: uchwyt przed Lp. i linia w miejscu upuszczenia */
.pb-child-table .pb-drag-col { width: 1.6em; padding-left: .3em !important; padding-right: 0 !important; user-select: none; }
.pb-drag-handle { display: inline-grid; place-items: center; width: 1.3em; height: 1.6em; border-radius: 5px; color: var(--pb-faint); cursor: grab; opacity: .55; transition: opacity .12s, background .12s; }
.pb-drag-handle[draggable="false"] { cursor: default; }
.pb-child-table tr:hover .pb-drag-handle { opacity: 1; }
.pb-drag-handle:hover { background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-drag-handle:active { cursor: grabbing; }
.pb-child-table tr.is-drop-before > td { box-shadow: inset 0 2px 0 var(--pb-accent); }
.pb-child-table tr.is-drop-after > td { box-shadow: inset 0 -2px 0 var(--pb-accent); }

/* Wiersz szybkiego dodawania pozycji: spokojny, „wklęsły” */
.pb-child-table tr.pb-child-quick > td { background: color-mix(in srgb, var(--pb-accent-soft) 45%, transparent) !important; border-top: 1px dashed color-mix(in srgb, var(--pb-accent) 35%, transparent) !important; }
.pb-child-table tr.pb-child-quick.is-busy { opacity: .6; }
.pb-child-quick input::placeholder { color: var(--pb-faint); font-style: italic; }
.pb-quick-plus { display: inline-grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 50%; color: var(--pb-accent); background: var(--pb-accent-soft); }
.pb-quick-plus .pb-ic { width: .85em; height: .85em; }
.pb-quick-add { display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; margin-left: .2em; border: none; border-radius: 50%; cursor: pointer;
  background: var(--pb-accent); color: var(--pb-on-accent); vertical-align: middle; transition: transform .12s, opacity .12s; }
.pb-quick-add:hover:not(:disabled) { transform: scale(1.08); }
.pb-quick-add:disabled { background: var(--pb-line); color: var(--pb-faint); cursor: default; }
.pb-quick-add .pb-ic { width: .95em; height: .95em; }

/* ======================================================================= Komunikator (wątki dokumentów) */
.pb-chat { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; height: min(68vh, 720px); min-height: 22em; position: relative;
  border-radius: var(--pb-radius); background: var(--pb-s2); overflow: hidden; }
.pb-chat.is-compact { height: 100%; min-height: 18em; border-radius: var(--pb-radius-sm); }
.pb-side-body.is-chat { display: flex; flex-direction: column; overflow: hidden; }
.pb-side-body.is-chat .pb-chat { flex: 1 1 auto; height: auto; }
.pb-chat.is-drop::after { content: "Upuść pliki, aby dołączyć je do wiadomości"; position: absolute; inset: .5em; display: grid; place-items: center;
  border: 2px dashed var(--pb-accent); border-radius: var(--pb-radius-sm); background: color-mix(in srgb, var(--pb-accent-soft) 85%, transparent);
  color: var(--pb-accent-strong); font-weight: 650; z-index: 5; pointer-events: none; }
.pb-chat-scroll { overflow-y: auto; padding: 1em 1.1em .6em; display: flex; flex-direction: column; gap: .12em; }
.pb-chat.is-compact .pb-chat-scroll { padding: .7em .6em .4em; }

.pb-chat-empty { margin: auto; max-width: 26em; text-align: center; display: grid; justify-items: center; gap: .45em; color: var(--pb-muted); font-size: .92em; padding: 2em 1em; }
.pb-chat-empty b { color: var(--pb-text); }
.pb-chat-empty > b:first-of-type { font-size: 1.05em; }
.pb-chat-empty-icon { display: grid; place-items: center; width: 3.2em; height: 3.2em; border-radius: 50%; background: var(--acc-bg); color: var(--acc-fg); margin-bottom: .3em; }
.pb-chat-empty-icon .pb-ic { width: 1.5em; height: 1.5em; }

.pb-chat-day, .pb-chat-unread { display: flex; align-items: center; gap: .8em; margin: .9em 0 .5em; font-size: .74em; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; color: var(--pb-faint); }
.pb-chat-day::before, .pb-chat-day::after, .pb-chat-unread::before, .pb-chat-unread::after { content: ""; flex: 1; height: 1px; background: var(--pb-line); }
.pb-chat-day span { padding: .2em .8em; border-radius: 99px; background: var(--pb-surface); border: 1px solid var(--pb-line); }
.pb-chat-unread { color: var(--pb-danger); }
.pb-chat-unread::before, .pb-chat-unread::after { background: color-mix(in srgb, var(--pb-danger) 45%, transparent); }

/* Wiadomość */
.pb-msg { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); gap: .5em; margin-top: .55em; border-radius: 12px; }
.pb-msg.is-cont { margin-top: .1em; }
.pb-msg.is-mine { grid-template-columns: minmax(0, 1fr); }
.pb-msg.is-mine .pb-msg-avatar { display: none; }
.pb-msg.is-flash { animation: pb-msg-flash 1.6s ease-out; }
@keyframes pb-msg-flash { 0%, 30% { background: color-mix(in srgb, var(--pb-accent) 18%, transparent); } 100% { background: transparent; } }
.pb-msg-avatar { padding-top: 1.2em; }
.pb-msg.is-cont .pb-msg-avatar { padding-top: 0; }
.pb-msg-main { min-width: 0; display: grid; justify-items: start; }
.pb-msg.is-mine .pb-msg-main { justify-items: end; }
.pb-msg-meta { display: flex; gap: .5em; align-items: baseline; font-size: .76em; color: var(--pb-faint); margin: 0 .5em .2em; }
.pb-msg-meta b { color: var(--pb-muted); font-weight: 650; }
.pb-msg-row { display: flex; align-items: center; gap: .3em; max-width: min(78%, 46em); }
.pb-chat.is-compact .pb-msg-row { max-width: 94%; }
.pb-msg.is-mine .pb-msg-row { flex-direction: row-reverse; }
.pb-msg-stack { min-width: 0; display: grid; gap: .3em; justify-items: start; }
.pb-msg.is-mine .pb-msg-stack { justify-items: end; }

.pb-msg-bubble { padding: .55em .85em; border-radius: 18px 18px 18px 6px; background: var(--pb-surface); color: var(--pb-text);
  box-shadow: 0 1px 1px rgba(28, 32, 48, .05); line-height: 1.45; font-size: .93em; overflow-wrap: anywhere; }
.pb-msg.is-cont:not(.is-mine) .pb-msg-bubble { border-top-left-radius: 6px; }
.pb-msg.is-mine .pb-msg-bubble { background: var(--pb-accent); color: var(--pb-on-accent); border-radius: 18px 18px 6px 18px; }
.pb-msg.is-mine.is-cont .pb-msg-bubble { border-top-right-radius: 6px; }
.pb-msg-bubble.is-mention { box-shadow: inset 3px 0 0 var(--butter-fg), 0 1px 1px rgba(28, 32, 48, .05); }
.pb-msg-bubble.is-deleted { background: transparent !important; color: var(--pb-faint) !important; border: 1px dashed var(--pb-line); font-style: italic;
  display: inline-flex; align-items: center; gap: .4em; box-shadow: none; }
.pb-msg-bubble.is-deleted .pb-ic { width: .95em; height: .95em; }
.pb-msg-edited { margin-left: .45em; font-size: .78em; opacity: .65; }
.pb-msg-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pb-msg:not(.is-mine) .pb-msg-link { color: var(--pb-accent-strong); }
.pb-mention { font-weight: 650; padding: 0 .25em; border-radius: 6px; background: var(--acc-bg); color: var(--acc-fg); }
.pb-msg.is-mine .pb-mention { background: rgba(255, 255, 255, .22); color: inherit; }
.pb-mention.is-me { background: var(--butter-bg); color: var(--butter-fg); }

/* Cytat odpowiedzi */
.pb-msg-quote { display: flex; align-items: center; gap: .45em; max-width: min(70%, 40em); margin: 0 .3em .2em; padding: .3em .7em; border: none; cursor: pointer;
  border-left: 3px solid var(--pb-accent); border-radius: 8px; background: color-mix(in srgb, var(--pb-surface) 70%, transparent);
  color: var(--pb-muted); font: inherit; font-size: .8em; text-align: left; }
.pb-msg-quote:hover { background: var(--pb-surface); }
.pb-msg-quote > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-msg-quote b { color: var(--pb-text); margin-right: .3em; }
.pb-msg-quote .pb-ic { width: .95em; height: .95em; flex: none; color: var(--pb-accent); }

/* Pliki, zdjęcia, karty */
.pb-msg-images { display: flex; flex-wrap: wrap; gap: .3em; }
.pb-msg.is-mine .pb-msg-images { justify-content: flex-end; }
.pb-msg-image { padding: 0; border: none; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: transparent; line-height: 0; width: fit-content; }
.pb-msg-image img { display: block; max-width: min(22em, 100%); max-height: 16em; object-fit: cover; transition: transform .2s; }
.pb-msg-image:hover img { transform: scale(1.02); }
.pb-msg-file, .pb-msg-card { display: flex; align-items: center; gap: .7em; min-width: 15em; max-width: 26em; padding: .55em .75em; border-radius: 14px;
  background: var(--pb-surface); border: 1px solid var(--pb-line); color: var(--pb-text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.pb-msg-file:hover, a.pb-msg-card:hover { border-color: color-mix(in srgb, var(--pb-accent) 50%, var(--pb-line)); box-shadow: var(--pb-shadow); text-decoration: none; }
.pb-msg-file > span:nth-child(2), .pb-msg-card-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.pb-msg-file b, .pb-msg-card-text b, .pb-msg-card-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; }
.pb-msg-file small, .pb-msg-card-text small { color: var(--pb-faint); font-size: .74em; }
.pb-msg-card-text > span { color: var(--pb-muted); font-size: .82em; }
.pb-msg-file-ext { display: grid; place-items: center; width: 2.6em; height: 2.6em; flex: none; border-radius: 10px; background: var(--peach-bg); color: var(--peach-fg);
  font-size: .72em; font-weight: 750; letter-spacing: .02em; }
.pb-msg-file > .pb-ic { color: var(--pb-faint); }
.pb-msg-card-go { color: var(--pb-faint); }
.pb-msg-card.is-locked { color: var(--pb-muted); background: transparent; border-style: dashed; }
.pb-msg-card.is-locked > .pb-ic { width: 1.3em; height: 1.3em; color: var(--pb-faint); }

/* Reakcje */
.pb-msg-reactions { display: flex; flex-wrap: wrap; gap: .25em; margin-top: -.1em; }
.pb-reaction { display: inline-flex; align-items: center; gap: .25em; padding: .1em .5em; border-radius: 99px; border: 1px solid var(--pb-line);
  background: var(--pb-surface); color: var(--pb-muted); font: inherit; font-size: .78em; font-weight: 650; cursor: pointer; }
.pb-reaction span { font-size: 1.15em; line-height: 1; }
.pb-reaction:hover { border-color: var(--pb-accent); }
.pb-reaction.is-on { background: var(--acc-bg); border-color: color-mix(in srgb, var(--pb-accent) 55%, transparent); color: var(--acc-fg); }

/* Akcje przy najechaniu */
.pb-msg-actions { display: flex; align-items: center; gap: .05em; opacity: 0; transition: opacity .12s; padding: .15em; border-radius: 99px;
  background: var(--pb-surface); box-shadow: var(--pb-shadow); flex: none; }
.pb-msg:hover .pb-msg-actions, .pb-msg-actions:focus-within { opacity: 1; }
.pb-msg-actions .pb-icon-btn { width: 1.9em; height: 1.9em; }
.pb-msg-react-pick { position: relative; }
.pb-msg-react-menu { position: absolute; bottom: calc(100% + .35em); left: 50%; transform: translateX(-50%); display: none; gap: .1em; padding: .3em;
  border-radius: 99px; background: var(--pb-surface); box-shadow: var(--pb-shadow-lg); border: 1px solid var(--pb-line); z-index: 6; }
.pb-msg-react-pick:hover .pb-msg-react-menu, .pb-msg-react-pick:focus-within .pb-msg-react-menu { display: flex; }
.pb-msg-react-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .5em; }
.pb-msg-react-menu button { border: none; background: transparent; font-size: 1.25em; width: 1.75em; height: 1.75em; border-radius: 50%; cursor: pointer; transition: transform .12s, background .12s; }
.pb-msg-react-menu button:hover { transform: scale(1.22); background: var(--pb-s2); }

/* „pisze…” */
.pb-chat-typing { display: flex; align-items: center; gap: .5em; padding: .15em 1.3em .35em; font-size: .78em; color: var(--pb-muted); }
.pb-typing-dots { display: inline-flex; gap: .2em; }
.pb-typing-dots i { width: .38em; height: .38em; border-radius: 50%; background: var(--pb-faint); animation: pb-typing 1.2s infinite ease-in-out; }
.pb-typing-dots i:nth-child(2) { animation-delay: .15s; }
.pb-typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pb-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-.25em); opacity: 1; } }

/* Pole wiadomości */
.pb-composer { position: relative; display: grid; gap: .45em; padding: .6em .8em .8em; border-top: 1px solid var(--pb-line); background: var(--pb-surface); }
.pb-composer.is-compact { padding: .5em .5em .6em; }
.pb-composer-context { display: flex; align-items: center; gap: .5em; padding: .35em .4em .35em .7em; border-radius: 10px; background: var(--acc-bg);
  color: var(--acc-fg); font-size: .82em; border-left: 3px solid var(--pb-accent); }
.pb-composer-context.is-edit { background: var(--butter-bg); color: var(--butter-fg); border-left-color: var(--butter-fg); }
.pb-composer-context .pb-ic { flex: none; }
.pb-composer-quote { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-composer-chips { display: flex; flex-wrap: wrap; gap: .35em; }
.pb-chip-doc, .pb-chip-file { display: inline-flex; align-items: center; gap: .45em; max-width: 22em; padding: .25em .3em .25em .45em; border-radius: 10px;
  background: var(--pb-s2); border: 1px solid var(--pb-line); font-size: .82em; }
.pb-chip-doc b, .pb-chip-file b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12em; }
.pb-chip-doc small, .pb-chip-file small { color: var(--pb-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12em; }
.pb-chip-doc button, .pb-chip-file button { display: grid; place-items: center; width: 1.5em; height: 1.5em; border: none; border-radius: 50%; background: transparent;
  color: var(--pb-faint); cursor: pointer; }
.pb-chip-doc button:hover, .pb-chip-file button:hover { background: var(--pb-line); color: var(--pb-text); }
.pb-chip-file.is-busy { color: var(--pb-muted); padding-right: .7em; }
.pb-chip-file .pb-spinner { width: 1em; height: 1em; border-width: 2px; }
.pb-composer-box { display: flex; align-items: flex-end; gap: .2em; padding: .3em .35em .3em .4em; border-radius: 22px; background: var(--pb-s2);
  border: 1px solid transparent; transition: border-color .15s, background .15s, box-shadow .15s; }
.pb-composer-box:focus-within { border-color: color-mix(in srgb, var(--pb-accent) 55%, transparent); background: var(--pb-input);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pb-accent) 14%, transparent); }
.pb-composer-input { flex: 1; min-width: 0; resize: none; overflow-y: hidden; border: none; outline: none; background: transparent; color: var(--pb-text); font: inherit; font-size: .93em;
  line-height: 1.45; padding: .45em .35em; max-height: 220px; min-height: calc(1.45em + .9em); box-sizing: border-box; align-self: center; }
.pb-composer-input::placeholder { color: var(--pb-faint); }
.pb-composer-btn { display: grid; place-items: center; width: 2.1em; height: 2.1em; flex: none; border: none; border-radius: 50%; background: transparent;
  color: var(--pb-muted); cursor: pointer; transition: background .12s, color .12s; }
.pb-composer-btn:hover { background: var(--pb-surface); color: var(--pb-accent); }
.pb-send { display: grid; place-items: center; width: 2.3em; height: 2.3em; flex: none; border: none; border-radius: 50%; cursor: pointer;
  background: var(--pb-accent); color: var(--pb-on-accent); transition: transform .12s, background .12s; }
.pb-send:hover:not(:disabled) { transform: scale(1.07); background: var(--pb-accent-strong); }
.pb-send:disabled { background: var(--pb-line); color: var(--pb-faint); cursor: default; }
.pb-send .pb-ic { width: 1.05em; height: 1.05em; }

/* Podpowiedzi @ i # */
.pb-suggest { position: absolute; left: .8em; right: .8em; bottom: calc(100% - .2em); max-height: 20em; overflow-y: auto; padding: .35em; display: grid; gap: .1em;
  border-radius: 14px; background: var(--pb-surface); border: 1px solid var(--pb-line); box-shadow: var(--pb-shadow-lg); z-index: 8; }
.pb-suggest-head { padding: .3em .6em .35em; font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pb-faint); }
.pb-suggest-item { display: flex; align-items: center; gap: .6em; padding: .4em .6em; border: none; border-radius: 10px; background: transparent; color: var(--pb-text);
  font: inherit; text-align: left; cursor: pointer; }
.pb-suggest-item > span { display: grid; min-width: 0; line-height: 1.25; }
.pb-suggest-item b { font-size: .9em; font-weight: 650; }
.pb-suggest-item small { font-size: .76em; color: var(--pb-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-suggest-item.is-active { background: var(--acc-bg); }

/* Podgląd zdjęcia */
.pb-lightbox { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; background: rgba(12, 14, 22, .82); backdrop-filter: blur(3px);
  animation: pb-fade-in .15s ease-out; cursor: zoom-out; }
.pb-lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); cursor: default; }
.pb-lightbox-bar { position: absolute; bottom: 1.2em; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .6em; padding: .4em .5em .4em 1em;
  border-radius: 99px; background: var(--pb-surface); box-shadow: var(--pb-shadow-lg); font-size: .88em; cursor: default; }
.pb-lightbox-bar > span { max-width: 30em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pb-muted); }
@keyframes pb-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ======================================================================= Strona „Wiadomości” */
.pb-content:has(> .pb-messenger), .pb-content:has(> * > .pb-messenger) { padding-bottom: 1.2em; }
.pb-messenger { display: grid; grid-template-columns: 21em minmax(0, 1fr); height: calc(100vh - 3.55em - 2.5em); min-height: 30em;
  border-radius: var(--pb-radius); background: var(--pb-surface); box-shadow: var(--pb-shadow); overflow: hidden; }
.pb-messenger.with-info { grid-template-columns: 21em minmax(0, 1fr) 19em; }

/* Lista rozmów */
.pb-conv-list { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); border-right: 1px solid var(--pb-line); min-height: 0; background: var(--pb-surface); }
.pb-conv-head { display: flex; align-items: center; padding: 1em 1em .5em 1.1em; }
.pb-conv-head h1 { margin: 0; font-size: 1.35em; font-weight: 750; letter-spacing: -.01em; }
.pb-conv-new { display: grid; place-items: center; width: 2.3em; height: 2.3em; border: none; border-radius: 50%; cursor: pointer;
  background: var(--acc-bg); color: var(--acc-fg); transition: transform .12s, background .12s; }
.pb-conv-new:hover { transform: scale(1.06); background: var(--pb-accent); color: var(--pb-on-accent); }
.pb-conv-search { display: flex; align-items: center; gap: .5em; margin: 0 .9em .55em; padding: .45em .8em; border-radius: 99px; background: var(--pb-s2); color: var(--pb-faint); }
.pb-conv-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--pb-text); font: inherit; font-size: .9em; }
.pb-conv-search:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--pb-accent) 35%, transparent); }
.pb-conv-filters { display: flex; gap: .3em; padding: 0 .9em .6em; overflow-x: auto; scrollbar-width: none; }
.pb-conv-filters button { display: inline-flex; align-items: center; gap: .35em; padding: .28em .75em; border: none; border-radius: 99px; background: transparent;
  color: var(--pb-muted); font: inherit; font-size: .8em; font-weight: 600; white-space: nowrap; cursor: pointer; }
.pb-conv-filters button:hover { background: var(--pb-s2); }
.pb-conv-filters button.is-on { background: var(--acc-bg); color: var(--acc-fg); }
.pb-conv-filters em { font-style: normal; min-width: 1.4em; padding: 0 .35em; border-radius: 99px; background: var(--rose-2); color: #fff; font-size: .82em; text-align: center; }
.pb-conv-items { overflow-y: auto; padding: 0 .5em .7em; display: grid; align-content: start; gap: .1em; }
.pb-conv-item { display: flex; align-items: center; gap: .75em; padding: .55em .6em; border-radius: 12px; color: var(--pb-text); text-decoration: none; transition: background .12s; }
.pb-conv-item:hover { background: var(--pb-s2); text-decoration: none; }
.pb-conv-item.is-active { background: var(--acc-bg); }
.pb-conv-text { display: grid; gap: .1em; min-width: 0; flex: 1; }
.pb-conv-line { display: flex; align-items: center; gap: .4em; min-width: 0; }
.pb-conv-line b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .93em; }
.pb-conv-line small { color: var(--pb-faint); font-size: .74em; white-space: nowrap; }
.pb-conv-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pb-muted); font-size: .83em; }
.pb-conv-item.is-unread b, .pb-conv-item.is-unread .pb-conv-preview { font-weight: 750; color: var(--pb-text); }
.pb-conv-item.is-unread .pb-conv-line small { color: var(--pb-accent-strong); font-weight: 700; }
.pb-conv-badge { min-width: 1.55em; height: 1.55em; padding: 0 .4em; border-radius: 99px; display: grid; place-items: center; background: var(--pb-accent);
  color: var(--pb-on-accent); font-size: .72em; font-weight: 800; }
.pb-conv-badge.is-muted { background: var(--pb-faint); }
.pb-conv-muted, .pb-conv-pin { width: .85em !important; height: .85em !important; color: var(--pb-faint); flex: none; }
.pb-conv-pin { color: var(--butter-fg); }
.pb-conv-empty { display: grid; justify-items: center; gap: .45em; padding: 2.5em 1em; text-align: center; color: var(--pb-muted); font-size: .9em; }
.pb-conv-empty b { color: var(--pb-text); }

/* Awatary: obecność i grupy */
.pb-presence { position: relative; display: inline-grid; flex: none; }
.pb-presence-dot { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: .6em; min-height: .6em; border-radius: 50%;
  background: var(--pb-ok); border: 2px solid var(--pb-surface); box-sizing: border-box; max-width: .85em; max-height: .85em; }
.pb-group-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 750; font-size: .95em;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; letter-spacing: .02em; }

/* Rozmowa */
.pb-conv-main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; background: var(--pb-s2); }
.pb-conv-main > .pb-state, .pb-conv-main > .pb-conv-welcome { grid-row: 1 / -1; }
.pb-conv-bar { display: flex; align-items: center; gap: .7em; padding: .65em 1em; border-bottom: 1px solid var(--pb-line); background: var(--pb-surface); }
.pb-conv-bar-text { display: grid; min-width: 0; line-height: 1.25; }
.pb-conv-bar-text b { font-size: 1.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-conv-bar-text small { color: var(--pb-muted); font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-conv-bar .pb-icon-btn.is-on { background: var(--acc-bg); color: var(--acc-fg); }
.pb-conv-back { display: none; }
.pb-conv-thread { min-height: 0; display: grid; }
.pb-chat.is-fill { height: 100%; min-height: 0; border-radius: 0; }
.pb-chat.is-fill .pb-chat-scroll { padding: 1.2em 1.6em .8em; }
.pb-chat.is-fill .pb-msg-row { max-width: min(70%, 46em); }
.pb-conv-welcome { display: grid; justify-items: center; align-content: center; gap: .6em; padding: 2em; text-align: center; color: var(--pb-muted); }
.pb-conv-welcome h2 { margin: .3em 0 0; color: var(--pb-text); font-size: 1.35em; }
.pb-conv-welcome p { max-width: 30em; margin: 0 0 .6em; line-height: 1.55; }
.pb-conv-welcome-art { display: grid; place-items: center; width: 5em; height: 5em; border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, var(--acc-1), var(--acc-2)); box-shadow: 0 14px 30px -12px var(--acc-2); }
.pb-conv-welcome-art .pb-ic { width: 2.2em; height: 2.2em; }

/* Potwierdzenie odczytu */
.pb-msg-seen { display: inline-flex; align-items: center; gap: .2em; margin: .2em .3em 0; font-size: .72em; color: var(--pb-faint); }
.pb-msg-seen .pb-ic { width: 1.05em; height: 1.05em; }
.pb-msg-seen.is-read { color: var(--pb-accent-strong); }
.pb-msg-seen .pb-avatar { box-shadow: 0 0 0 2px var(--pb-s2); margin-left: -.2em; }
.pb-msg-seen small { margin-left: .2em; }

/* Szczegóły rozmowy */
.pb-conv-info { border-left: 1px solid var(--pb-line); overflow-y: auto; min-height: 0; background: var(--pb-surface); }
.pb-conv-info-head { display: grid; justify-items: center; gap: .35em; padding: 1.6em 1.1em 1.1em; text-align: center; border-bottom: 1px solid var(--pb-line); }
.pb-conv-info-head b { font-size: 1.08em; margin-top: .35em; }
.pb-conv-info-head small { color: var(--pb-muted); font-size: .82em; }
.pb-conv-info-section { display: grid; gap: .35em; padding: 1em 1.1em; border-bottom: 1px solid var(--pb-line); }
.pb-conv-info-title { display: flex; align-items: center; gap: .5em; font-size: .74em; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pb-faint); margin-bottom: .2em; }
.pb-conv-member { display: flex; align-items: center; gap: .6em; padding: .25em 0; }
.pb-conv-member > span:not(.pb-presence) { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.pb-conv-member b { font-size: .88em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-conv-member small { font-size: .74em; color: var(--pb-faint); }
.pb-conv-member .pb-icon-btn { opacity: 0; }
.pb-conv-member:hover .pb-icon-btn { opacity: 1; }
.pb-conv-add { display: grid; gap: .4em; margin-top: .4em; }
.pb-conv-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3em; }
.pb-conv-gallery a { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--pb-s2); }
.pb-conv-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.pb-conv-gallery a:hover img { transform: scale(1.05); }
.pb-conv-file { display: flex; align-items: center; gap: .55em; padding: .35em .4em; border-radius: 8px; color: var(--pb-text); text-decoration: none; }
.pb-conv-file:hover { background: var(--pb-s2); text-decoration: none; }
.pb-conv-file > .pb-ic { color: var(--peach-fg); flex: none; }
.pb-conv-file > span { display: grid; min-width: 0; line-height: 1.25; }
.pb-conv-file b { font-size: .84em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-conv-file small { font-size: .72em; color: var(--pb-faint); }
.pb-danger-text { color: var(--pb-danger) !important; }

/* Nowa rozmowa */
.pb-people-list { display: grid; gap: .1em; max-height: 50vh; overflow-y: auto; }
.pb-people-item { display: flex; align-items: center; gap: .7em; padding: .5em .6em; border: none; border-radius: 12px; background: transparent; color: var(--pb-text);
  font: inherit; text-align: left; cursor: pointer; }
.pb-people-item:hover { background: var(--acc-bg); }
.pb-people-item > span:not(.pb-presence) { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.pb-people-item b { font-weight: 600; font-size: .92em; }
.pb-people-item small { font-size: .76em; color: var(--pb-faint); }
.pb-people-item > .pb-ic { color: var(--pb-faint); }

/* Wąski ekran: lista albo rozmowa */
@media (max-width: 1100px) {
  .pb-messenger.with-info { grid-template-columns: minmax(15em, 18em) minmax(0, 1fr); }
  .pb-messenger.with-info .pb-conv-info { display: none; }
}
@media (max-width: 760px) {
  .pb-messenger, .pb-messenger.with-info { grid-template-columns: 1fr; }
  .pb-messenger.has-open .pb-conv-list { display: none; }
  .pb-messenger:not(.has-open) .pb-conv-main { display: none; }
  .pb-conv-back { display: grid; }
}

/* Licznik wiadomości w górnym pasku — w kolorze akcentu, odróżnia się od zadań */
.pb-badge.pb-badge-chat { background: var(--pb-accent); }

/* Załączniki: lista nad podglądem albo po lewej, własne nazwy */
.pb-att-body { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.pb-att-body.is-closed { grid-template-rows: minmax(0, 1fr); }
.pb-att-body.is-left { grid-template-columns: minmax(10em, 15em) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.pb-att-body.is-left.is-closed { grid-template-columns: minmax(0, 1fr); }
.pb-att-body.is-left .pb-att-list { max-height: none; border-bottom: none; border-right: 1px solid var(--pb-line2); align-content: start; overflow-y: auto; }
.pb-att-body.is-left .pb-att-item { position: relative; }
.pb-att-body.is-left .pb-att-move { position: absolute; right: .3em; top: 50%; transform: translateY(-50%); padding: .1em; border-radius: 99px;
  background: var(--pb-surface); box-shadow: var(--pb-shadow); opacity: 0; transition: opacity .12s; }
.pb-att-body.is-left .pb-att-item:hover .pb-att-move, .pb-att-body.is-left .pb-att-move.is-shown { opacity: 1; }
.pb-att-body.is-left .pb-att-move.is-shown { position: static; transform: none; box-shadow: none; background: transparent; }
.pb-att-body.is-left .pb-att-drop { font-size: .82em; }
.pb-att-original { display: flex !important; align-items: center; gap: .3em; color: var(--pb-faint) !important; font-style: italic; }
.pb-att-original .pb-ic { width: .9em; height: .9em; flex: none; }
.pb-att-rename { flex: 1; min-width: 0; display: grid; gap: .2em; }
.pb-att-rename-input { width: 100%; min-width: 0; padding: .3em .5em; border: 1px solid var(--pb-accent); border-radius: 8px; background: var(--pb-input); color: var(--pb-text);
  font: inherit; font-weight: 600; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pb-accent) 14%, transparent); }
.pb-att-rename small { color: var(--pb-faint); font-size: .78em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-att-head .pb-icon-btn.is-on { background: var(--acc-bg); color: var(--acc-fg); }
/* Wąska lista po lewej: bez poziomego przewijania, nazwa w dwóch liniach, autor jako awatar, akcje w menu „⋯” */
.pb-att-body.is-left .pb-att-list { overflow-x: hidden; grid-template-columns: minmax(0, 1fr); }
.pb-att-body.is-left .pb-att-item { min-width: 0; align-items: flex-start; padding-right: .3em; }
.pb-att-body.is-left .pb-att-item .pb-ft { margin-top: .1em; }
.pb-att-body.is-left .pb-att-name { white-space: normal; min-width: 0; }
.pb-att-body.is-left .pb-att-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.3; overflow-wrap: anywhere; }
.pb-att-body.is-left .pb-att-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-att-meta { display: flex !important; align-items: center; gap: .35em; margin-top: .2em; }
.pb-att-meta .pb-avatar { font-size: .78em; flex: none; }
.pb-att-actions { flex: none; opacity: 0; transition: opacity .12s; }
.pb-att-item:hover .pb-att-actions, .pb-att-item.is-on .pb-att-actions, .pb-att-actions:focus-within { opacity: 1; }
.pb-att-more.dxbl-btn { min-width: 0; width: 1.8em; height: 1.8em; padding: 0; border-radius: 50%; font-weight: 800; letter-spacing: .05em; color: var(--pb-muted); }
.pb-att-more.dxbl-btn:hover { background: var(--pb-surface); color: var(--pb-text); }
.pb-att-more .dxbl-btn-caret, .pb-att-more .dxbl-dropdown-toggle-icon, .pb-att-more svg:not(.pb-ic) { display: none; }

/* Wyszukiwarka ekranów ustawień: wiersze niepasujące do szukanego tekstu. */
.pb-filtered-out { display: none !important; }
.pb-settings-find { width: 16em; }
.pb-find[hidden] { display: none; }

/* Pole zaznaczenia w aktywnym wierszu listy: motyw zakłada ciemne tło aktywnego wiersza i robi pole przezroczyste
   z jasną ramką — u nas tło jest jasne, więc pole ma wyglądać tak samo jak w pozostałych zaznaczonych wierszach. */
.pb-grid .dxbl-grid-table .dxbl-grid-focused-row .dxbl-checkbox-checked .dxbl-checkbox-check-element,
.pb-grid .dxbl-grid-table .dxbl-grid-focused-row.dxbl-grid-selected-row .dxbl-checkbox-checked .dxbl-checkbox-check-element {
    --dxbl-checkbox-check-element-border: var(--pb-accent) !important; --dxbl-checkbox-check-element-bg: var(--pb-accent) !important;
    --dxbl-checkbox-check-element-check-icon-primary-color: #fff !important;
    background-color: var(--pb-accent) !important; border-color: var(--pb-accent) !important; color: #fff !important; opacity: 1 !important;
}
.pb-grid .dxbl-grid-table .dxbl-grid-focused-row .dxbl-checkbox-unchecked .dxbl-checkbox-check-element {
    --dxbl-checkbox-check-element-border: var(--pb-muted) !important; border-color: var(--pb-muted) !important;
}

/* Lista jako miejsce upuszczenia plików (nowy dokument z załącznikami). */
[data-pb-list-drop].is-list-drop { position: relative; }
[data-pb-list-drop].is-list-drop::after {
    content: "Upuść pliki — powstanie nowy dokument z tymi załącznikami"; position: absolute; inset: 0; z-index: 20; display: grid; place-items: center;
    border: 2px dashed var(--pb-accent); border-radius: 1em; background: color-mix(in srgb, var(--pb-accent-soft) 88%, transparent);
    color: var(--pb-accent); font-weight: 650; font-size: 1.05em; pointer-events: none; text-align: center; padding: 1em;
}

/* Panele: filtry nad sekcjami, lista z zaznaczaniem, wykres. */
.pb-panel-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; margin-bottom: .2em; }
.pb-panel-list { overflow: auto; padding: 0 .4em .5em; }
.pb-panel-table { font-size: .92em; }
.pb-panel-table thead th { position: sticky; top: 0; background: var(--pb-surface); z-index: 1; }
.pb-panel-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22em; }
.pb-panel-table tr.is-sel > td { background: var(--pb-accent-soft); box-shadow: inset 3px 0 0 var(--pb-accent); font-weight: 600; }
.pb-panel-table tr.is-sel > td + td { box-shadow: none; }
.pb-panel-find { width: 11em; font-weight: 400; }
.pb-panel-chart { padding: 0 .8em .6em; cursor: pointer; }

/* Wykres „dzień po dniu” (np. godziny RCP): każdy dzień okresu, kreska celu, puste dni widoczne. */
.pb-days { display: flex; align-items: stretch; gap: .35em; padding: .2em .8em .2em; min-height: 9em; }
.pb-day { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .25em; padding: .2em 0; border: 0; background: none;
          border-radius: var(--pb-radius-sm); cursor: pointer; color: var(--pb-text); font: inherit; }
.pb-day:hover { background: var(--pb-row-alt); }
.pb-day.week { margin-left: .6em; }
.pb-day-value { font-size: .85em; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.pb-day-track { position: relative; flex: 1; width: 70%; max-width: 3em; border-radius: 4px 4px 0 0; background: var(--pb-row-alt); overflow: hidden; }
.pb-day-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--pb-ok); border-radius: 4px 4px 0 0; }
.pb-day-target { position: absolute; left: -2px; right: -2px; border-top: 2px dashed var(--pb-muted); z-index: 1; }
.pb-day-label { font-size: .78em; color: var(--pb-muted); white-space: nowrap; }
.pb-day.low .pb-day-fill { background: #e3a008; }
.pb-day.missing .pb-day-track { background: color-mix(in srgb, var(--pb-danger) 14%, transparent); outline: 1px dashed var(--pb-danger); }
.pb-day.missing .pb-day-value { color: var(--pb-danger); }
.pb-day.future { opacity: .45; cursor: default; }
.pb-day.today .pb-day-label { color: var(--pb-accent); font-weight: 700; }
.pb-days-legend { display: flex; flex-wrap: wrap; gap: .3em 1em; padding: 0 1em .6em; font-size: .8em; color: var(--pb-muted); }
.pb-days-legend i { display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin-right: .35em; vertical-align: -.05em; }
.pb-days-legend i.ok { background: var(--pb-ok); }
.pb-days-legend i.low { background: #e3a008; }
.pb-days-legend i.missing { background: color-mix(in srgb, var(--pb-danger) 14%, transparent); outline: 1px dashed var(--pb-danger); }
.pb-days-legend .hint { margin-left: auto; }

/* Tabela przestawna na panelu. */
.pb-pivot-table { font-size: .9em; border-collapse: separate; border-spacing: 0; }
.pb-pivot-table th, .pb-pivot-table td { white-space: nowrap; padding: .4em .7em; }
.pb-pivot-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.pb-pivot-table thead th { position: sticky; top: 0; background: var(--pb-surface); z-index: 2; }
.pb-pivot-table tbody th, .pb-pivot-table tfoot th { position: sticky; left: 0; background: var(--pb-surface); z-index: 1; text-align: left; font-weight: 600; max-width: 18em; overflow: hidden; text-overflow: ellipsis; }
.pb-pivot-table thead th:first-child { left: 0; z-index: 3; }
.pb-pivot-table .t { font-weight: 700; background: color-mix(in srgb, var(--pb-accent-soft) 45%, var(--pb-surface)); }
.pb-pivot-table tfoot td, .pb-pivot-table tfoot th { position: sticky; bottom: 0; border-top: 2px solid var(--pb-line); font-weight: 700; }
.pb-pivot-table tfoot th { z-index: 3; }
.pb-pivot-table td.clickable { cursor: pointer; }
.pb-pivot-table td.clickable:hover { background: var(--pb-accent-soft); }

/* Sekcja panelu na formularzu dokumentu: jedna kolumna, bez własnej karty w karcie. */
.pb-dash.is-embedded { grid-template-columns: minmax(0, 1fr); gap: .6em; }
.pb-dash.is-embedded .pb-widget { grid-column: span 1; box-shadow: none; border: 1px solid var(--pb-line); }
.pb-form-panel { min-width: 0; }

/* Pole „Obraz”: scena ze zdjęciem, strzałki, pasek miniatur. */
.pb-imgs { position: relative; display: grid; gap: .5em; min-width: 0; }
.pb-imgs-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4em; min-height: 9em; padding: 1em; text-align: center;
    border: 1.5px dashed var(--pb-line); border-radius: .9em; color: var(--pb-muted); font-size: .9em; background: var(--pb-input); }
.pb-imgs-empty .pb-ic { font-size: 1.8em; opacity: .6; }
.pb-imgs-empty.is-drop { cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.pb-imgs-empty.is-drop:hover, .pb-imgs.is-img-drop .pb-imgs-empty { border-color: var(--pb-accent); background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-imgs-stage { position: relative; display: grid; place-items: center; min-height: 9em; max-height: 24em; border-radius: .9em; overflow: hidden;
    background: color-mix(in srgb, var(--pb-line) 35%, var(--pb-surface)); border: 1px solid var(--pb-line); }
.pb-imgs.is-img-drop .pb-imgs-stage { outline: 2px dashed var(--pb-accent); outline-offset: 2px; }
.pb-imgs-stage img { max-width: 100%; max-height: 24em; object-fit: contain; display: block; cursor: zoom-in; }
.pb-imgs-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.2em; height: 2.2em; border-radius: 50%; border: none; display: grid; place-items: center; cursor: pointer;
    background: color-mix(in srgb, var(--pb-surface) 88%, transparent); color: var(--pb-text); box-shadow: 0 1px 6px rgba(0, 0, 0, .18); opacity: 0; transition: opacity .15s; }
.pb-imgs-nav.prev { left: .6em; } .pb-imgs-nav.next { right: .6em; }
.pb-imgs-stage:hover .pb-imgs-nav, .pb-imgs-zoom .pb-imgs-nav, .pb-imgs-nav:focus-visible { opacity: 1; }
.pb-imgs-count { position: absolute; left: 50%; bottom: .5em; transform: translateX(-50%); padding: .1em .6em; border-radius: 1em; font-size: .78em; font-weight: 600;
    background: rgba(0, 0, 0, .55); color: #fff; }
.pb-imgs-tools { position: absolute; top: .5em; right: .5em; display: flex; gap: .25em; padding: .15em; border-radius: .6em; background: color-mix(in srgb, var(--pb-surface) 88%, transparent);
    opacity: 0; transition: opacity .15s; }
.pb-imgs-stage:hover .pb-imgs-tools, .pb-imgs-tools:focus-within { opacity: 1; }
.pb-imgs-strip { display: flex; flex-wrap: wrap; gap: .4em; }
.pb-imgs-thumb { width: 3.4em; height: 3.4em; padding: 0; border-radius: .55em; overflow: hidden; border: 2px solid transparent; background: var(--pb-input); cursor: pointer;
    display: grid; place-items: center; color: var(--pb-muted); }
.pb-imgs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-imgs-thumb.is-on { border-color: var(--pb-accent); }
.pb-imgs-thumb.is-add { border: 1.5px dashed var(--pb-line); }
.pb-imgs-thumb.is-add:hover { border-color: var(--pb-accent); color: var(--pb-accent); }
.pb-imgs-busy { position: absolute; inset: 0; display: grid; place-items: center; border-radius: .9em; background: color-mix(in srgb, var(--pb-surface) 80%, transparent); font-size: .9em; font-weight: 600; }
.pb-imgs-zoom { position: relative; display: grid; place-items: center; }
.pb-imgs-zoom img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: .6em; }
/* Miniatura w komórce listy. */
.pb-list-img { width: 2.6em; height: 2.6em; object-fit: cover; border-radius: .45em; display: block; background: var(--pb-input); }

/* Pole „Mapa / osadzona strona”. */
.pb-embed { display: grid; gap: .35em; min-width: 0; }
.pb-embed-head { display: flex; align-items: center; gap: .4em; }
.pb-embed-frame { border: 1px solid var(--pb-line); border-radius: .9em; overflow: hidden; background: var(--pb-input); }
.pb-embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pb-embed-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5em; padding: 1em; text-align: center;
    border: 1.5px dashed var(--pb-line); border-radius: .9em; color: var(--pb-muted); font-size: .9em; background: var(--pb-input); }
.pb-embed-frame .pb-embed-empty { border: 0; border-radius: 0; }
.pb-embed-empty .pb-ic { font-size: 1.6em; opacity: .6; }

/* Opis analityczny: podsumowanie „opisano / pozostaje”, pasek i tabela podziału kwoty. */
.pb-alloc-sum { display: inline-flex; align-items: center; gap: .45em; font-weight: 500; font-size: .92em; padding: .25em .75em; border-radius: 99em; background: var(--pb-s2); color: var(--pb-muted); }
.pb-alloc-sum b { font-weight: 750; font-variant-numeric: tabular-nums; }
.pb-alloc-sum .sep { opacity: .5; }
.pb-alloc-sum.is-ok { background: var(--mint-bg); color: var(--mint-fg); }
.pb-alloc-sum.is-part { background: var(--butter-bg); color: var(--butter-fg); }
.pb-alloc-sum.is-over { background: var(--rose-bg); color: var(--rose-fg); }
.pb-alloc-bar { height: .28em; border-radius: 99em; background: var(--pb-line2); overflow: hidden; }
.pb-alloc-bar i { display: block; height: 100%; border-radius: 99em; background: var(--butter-2); transition: width .25s ease; }
.pb-alloc-bar.is-ok i { background: var(--pb-ok); }
.pb-alloc-bar.is-over i { background: var(--pb-danger); }
table.pb-alloc-table { min-width: 0; }
.pb-alloc-table td.share { width: 9.5em; }
.pb-alloc-table td.num.ro, .pb-alloc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pb-alloc-table td.dim { min-width: 11em; }
.pb-alloc-table td.act { width: 4.6em; }
.pb-alloc-table td.has-error { box-shadow: inset 0 -2px 0 var(--pb-danger); }
.pb-alloc-table tr.pb-alloc-new td { border-bottom: none; }
.pb-alloc-table tr.pb-alloc-new .dxbl-text-edit { border-color: var(--pb-line2); border-style: dashed; }
.pb-alloc-mode { font-weight: 500; font-size: .92em; margin-left: .4em; }
.pb-alloc-simple { padding: .2em 0 .1em; }

/* Opis analityczny: menu szablonów. */
.pb-alloc-tpl { position: relative; font-weight: 500; }
.pb-alloc-backdrop { position: fixed; inset: 0; z-index: 40; }
.pb-alloc-menu { position: absolute; z-index: 41; top: calc(100% + .35em); left: 0; min-width: 17em; max-width: 26em; max-height: 20em; overflow: auto; display: grid; gap: 1px; padding: .35em; background: var(--pb-surface); border: 1px solid var(--pb-line); border-radius: .8em; box-shadow: 0 .6em 1.8em rgba(20, 24, 40, .16); }
.pb-alloc-menu button { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: .5em .65em; border: none; background: transparent; color: inherit; font: inherit; font-size: .92em; text-align: left; border-radius: .55em; cursor: pointer; }
.pb-alloc-menu button:hover { background: var(--pb-accent-soft); color: var(--pb-accent); }
.pb-alloc-menu button small { color: var(--pb-muted); white-space: nowrap; }
.pb-alloc-menu hr { border: none; border-top: 1px solid var(--pb-line2); margin: .25em 0; }
.pb-alloc-menu-note { padding: .6em .65em; color: var(--pb-muted); font-size: .9em; }

/* Opis analityczny według pozycji: karty pozycji z własnym opisem. */
.pb-alloc-edit { display: grid; gap: .5em; }
.pb-alloc-tools { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; }
.pb-alloc-mode button small { margin-left: .35em; opacity: .7; }
.pb-alloc-positions { display: grid; gap: .5em; }
.pb-alloc-pos { border: 1px solid var(--pb-line); border-radius: .8em; background: var(--pb-surface); }
.pb-alloc-pos.is-open { border-color: var(--pb-accent); }
.pb-alloc-pos-head { display: flex; align-items: center; gap: .8em; width: 100%; padding: .6em .8em; border: none; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: .8em; }
.pb-alloc-pos-head:hover { background: color-mix(in srgb, var(--pb-accent-soft) 45%, transparent); }
.pb-alloc-pos-head .lp { flex: none; width: 1.9em; height: 1.9em; display: grid; place-items: center; border-radius: .5em; background: var(--pb-s2); color: var(--pb-muted); font-size: .85em; font-weight: 650; }
.pb-alloc-pos-head .t { flex: 1; min-width: 0; display: grid; gap: .1em; }
.pb-alloc-pos-head .t b, .pb-alloc-pos-head .t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-alloc-pos-head .a { display: grid; gap: .1em; text-align: right; font-variant-numeric: tabular-nums; }
.pb-alloc-pos-head small { color: var(--pb-muted); font-size: .82em; }
.pb-alloc-pos-head small.ok { color: var(--mint-fg); }
.pb-alloc-pos-head small.todo { color: var(--butter-fg); }
.pb-alloc-pos-body { padding: .2em .8em .8em; border-top: 1px solid var(--pb-line2); display: grid; gap: .5em; padding-top: .7em; }
.pb-alloc-pos-foot { display: flex; justify-content: flex-end; }

/* Pominięte dokumenty akcji na liście */
.pb-skipped-list { margin: 0; padding-left: 1.2em; display: grid; gap: .35em; font-size: .92em; }

/* ---------------------------------------------------------------- licencja */
.pb-license-bars { display: grid; }
.pb-license-bar { align-items: center; margin: .6em 1.6em 0; }
.pb-license-bar .pb-icon-btn { margin-left: .2em; }
.pb-seats { min-height: 100vh; display: grid; place-items: center; padding: 1.5em; background: var(--pb-bg); }
.pb-seats-card { max-width: 32em; padding: 2em; display: grid; gap: .8em; justify-items: center; text-align: center; }
.pb-seats-card h1 { font-size: 1.3em; margin: 0; }
.pb-seats-card p { margin: 0; color: var(--pb-muted); }
.pb-license-state { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .9em 1.4em; }
.pb-license-state > div { display: grid; gap: .2em; min-width: 0; }
.pb-license-state code { font-size: .9em; word-break: break-all; }

/* Ustawienia → Licencja: dokumenty do akceptacji */
.pb-license-docs { display: grid; gap: .5em; }
.pb-license-doc { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; padding: .55em .75em; border: 1px solid var(--pb-line); border-radius: var(--pb-radius-sm); background: var(--pb-s2); }
.pb-license-doc > span:not(.pb-ico) { flex: 1; min-width: 12em; }
