/* CRM od TS Serwis, wersja demonstracyjna. Ten sam język co strona: czerń, biel, Instrument Sans. Kolor wnoszą tylko dane. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --f: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --bg: #121212; --side: #141414; --s1: #191919; --s2: #1e1e1e; --s3: #262626; --s4: #2e2e2e;
  --hover: rgba(255, 255, 255, .05); --press: rgba(255, 255, 255, .085);
  --tx: #f1f1f1; --tx2: #b5b5b5; --tx3: #8f8f8f;
  --line: rgba(255, 255, 255, .09); --line2: rgba(255, 255, 255, .16);
  --inv: #ffffff; --invtx: #121212; --invh: #dcdcdc;
  --ok: #3ddc84; --bad: #ff7a6b; --warn: #e8b04b; --info: #7aa2ff;
  --okbg: rgba(61, 220, 132, .12); --badbg: rgba(255, 122, 107, .12); --warnbg: rgba(232, 176, 75, .13);
  --shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .35);
  --scrim: rgba(0, 0, 0, .62);
  --avl: 30%; --avt: 84%; --avs: 26%;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sbw: 236px; --toph: 60px; --r: 12px; --r2: 16px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f4f2; --side: #eeeeeb; --s1: #ffffff; --s2: #f8f8f6; --s3: #efefec; --s4: #e6e6e2;
  --hover: rgba(0, 0, 0, .04); --press: rgba(0, 0, 0, .075);
  --tx: #151515; --tx2: #444444; --tx3: #666666;
  --line: rgba(0, 0, 0, .09); --line2: rgba(0, 0, 0, .17);
  --inv: #151515; --invtx: #ffffff; --invh: #333333;
  --ok: #0f7a42; --bad: #c63d2f; --warn: #9a6512; --info: #3460d4;
  --okbg: rgba(19, 138, 75, .1); --badbg: rgba(198, 61, 47, .09); --warnbg: rgba(154, 101, 18, .1);
  --shadow: 0 24px 60px rgba(0, 0, 0, .16), 0 2px 10px rgba(0, 0, 0, .06);
  --scrim: rgba(20, 20, 20, .38);
  --avl: 90%; --avt: 30%; --avs: 45%;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 14px/1.5 var(--f); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--inv); outline-offset: 2px; }
::selection { background: var(--inv); color: var(--invtx); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic--s { width: 15px; height: 15px; }
.ic--l { width: 22px; height: 22px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--tx3); }
.dim { color: var(--tx2); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 6px; font: 500 12px/1 var(--f); color: var(--tx2); background: var(--s2); }
a.lnk, button.lnk { color: var(--tx); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
a.lnk:hover, button.lnk:hover { text-decoration-color: currentColor; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Pasek wersji demonstracyjnej ─────────────────────────────────── */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }
.demo { display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--side); font-size: 13px; color: var(--tx2); }
.demo__note { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.demo__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.demo__links { display: flex; align-items: center; gap: 6px; flex: none; }
.demo__links a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px; border-radius: 8px; text-decoration: none; color: var(--tx2); }
.demo__links a:hover { color: var(--tx); background: var(--hover); }
.demo__links a.demo__cta { background: var(--inv); color: var(--invtx); font-weight: 500; }
.demo__links a.demo__cta:hover { background: var(--invh); }
.is-embed .demo, .is-embed [data-outer] { display: none !important; }

/* ── Szkielet ─────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); min-height: 0; }
.sb-mini .shell { --sbw: 68px; }
.sb { position: relative; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--side); z-index: 30; }
.sb__brand { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 18px; color: var(--tx); text-decoration: none; flex: none; }
.sb__mono { width: 24px; height: 27px; fill: currentColor; flex: none; }
.sb__word { width: 82px; height: 9px; fill: currentColor; flex: none; }
.sb__crm { margin-left: auto; padding: 2px 8px; border: 1px solid var(--line2); border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--tx2); }
.ws { display: flex; align-items: center; gap: 10px; width: calc(100% - 20px); margin: 2px 10px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); text-align: left; transition: border-color .2s; }
.ws:hover { border-color: var(--line2); }
.ws__mono { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--inv); color: var(--invtx); font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.ws__txt { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.ws__name { font-weight: 600; font-size: 13.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ws__sub { font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws .ic { color: var(--tx3); }
.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px; display: grid; align-content: start; gap: 2px; }
.nav__label { padding: 14px 10px 6px; font-size: 12px; color: var(--tx3); }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 7px 10px; border-radius: 9px; color: var(--tx2); text-decoration: none; font-weight: 500; transition: background-color .15s, color .15s; }
.nav a:hover { background: var(--hover); color: var(--tx); }
.nav a[aria-current="page"] { background: var(--press); color: var(--tx); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--inv); }
.nav__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--s3); color: var(--tx2); font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.nav__n--hot { background: var(--inv); color: var(--invtx); }
.sb__foot { flex: none; display: grid; gap: 2px; padding: 8px 10px 12px; border-top: 1px solid var(--line); }
.sb__foot a, .sb__foot button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 9px; color: var(--tx2); text-decoration: none; font-weight: 500; }
.sb__foot a:hover, .sb__foot button:hover { background: var(--hover); color: var(--tx); }
.sb__foot a[aria-current="page"] { background: var(--press); color: var(--tx); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 2px; min-width: 0; }
.me__txt { display: grid; line-height: 1.25; min-width: 0; }
.me__name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me__role { font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-mini .sb__word, .sb-mini .sb__crm, .sb-mini .ws__txt, .sb-mini .ws > .ic, .sb-mini .nav__t, .sb-mini .nav__label, .sb-mini .sb__foot .nav__t, .sb-mini .me__txt { display: none; }
.sb-mini .sb__brand { justify-content: center; padding: 0; }
.sb-mini .ws { justify-content: center; width: 48px; margin: 2px auto 8px; padding: 7px; }
.sb-mini .nav a, .sb-mini .sb__foot a, .sb-mini .sb__foot button { justify-content: center; padding: 7px; }
.sb-mini .nav__n { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10.5px; }
.sb-mini .me { justify-content: center; padding: 8px 0 2px; }
.sb-mini .sb__collapse .ic { transform: scaleX(-1); }

.mainwrap { display: grid; grid-template-rows: var(--toph) minmax(0, 1fr); min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 0 20px 0 24px; border-bottom: 1px solid var(--line); background: var(--bg); min-width: 0; }
.top__menu { display: none; }
.top__title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top__crumb { color: var(--tx3); font-weight: 500; }
.top__sp { flex: 1; }
.search { display: flex; align-items: center; gap: 10px; width: min(360px, 34vw); min-height: 38px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--s1); color: var(--tx3); transition: border-color .2s; }
.search:hover { border-color: var(--line2); color: var(--tx2); }
.search__t { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__acts { display: flex; align-items: center; gap: 4px; }
.bell { position: relative; }
.bell__dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.main { position: relative; overflow: auto; min-height: 0; container-type: inline-size; container-name: main; scroll-behavior: auto; }
.main:focus { outline: none; }
.view { padding: 24px 28px 48px; max-width: 1520px; margin: 0 auto; }
.view--fill { display: flex; flex-direction: column; height: 100%; padding-bottom: 0; max-width: none; }
.vh { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 20px; }
.vh__t { display: grid; gap: 3px; min-width: 0; flex: 1; }
.vh h1, .vh h2 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.vh h1:focus { outline: none; }
.vh p { color: var(--tx3); }
.vh__acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* ── Przyciski, pola, drobne elementy ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 500; font-size: 14px; line-height: 1.1; white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn--p { background: var(--inv); color: var(--invtx); }
.btn--p:hover:not(:disabled) { background: var(--invh); }
.btn--g { border-color: var(--line2); background: var(--s1); color: var(--tx); }
.btn--g:hover:not(:disabled) { border-color: var(--tx3); }
.btn--q { color: var(--tx2); }
.btn--q:hover:not(:disabled) { background: var(--hover); color: var(--tx); }
.btn--ok { background: var(--okbg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.btn--ok:hover { border-color: var(--ok); }
.btn--bad { background: var(--badbg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn--bad:hover { border-color: var(--bad); }
.btn--sm { min-height: 30px; padding: 5px 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn--sm .ic { width: 15px; height: 15px; }
.btn--block { width: 100%; }
.ib { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; color: var(--tx2); transition: background-color .15s, color .15s; }
.ib:hover { background: var(--hover); color: var(--tx); }
.ib[aria-expanded="true"], .ib[aria-pressed="true"] { background: var(--press); color: var(--tx); }
.ib--sm { width: 28px; height: 28px; border-radius: 7px; }
.ib--sm .ic { width: 16px; height: 16px; }
.ib--b { border: 1px solid var(--line2); background: var(--s1); }
.ib--xs { position: relative; width: 26px; height: 26px; border-radius: 7px; }
.ib--xs::after { content: ""; position: absolute; inset: -6px; }
.inp { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line2); border-radius: 9px; background: var(--s1); color: var(--tx); transition: border-color .15s; }
.inp:hover { border-color: var(--tx3); }
.inp:focus { outline: none; border-color: var(--inv); }
.inp::placeholder { color: var(--tx3); }
.inp[aria-invalid="true"] { border-color: var(--bad); }
select.inp { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 15px; }
textarea.inp { resize: vertical; min-height: 84px; line-height: 1.5; }
.inp--sm { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.inp--plain { border-color: transparent; background: transparent; padding-left: 8px; padding-right: 8px; }
.inp--plain:hover { border-color: var(--line); background: var(--s1); }
.inp--plain:focus { background: var(--s1); }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > label, .fld__l { font-size: 13px; color: var(--tx2); font-weight: 500; }
.fld__err { font-size: 12.5px; color: var(--bad); }
.fld__hint { font-size: 12.5px; color: var(--tx3); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fgrid .full { grid-column: 1 / -1; }
.sinput { position: relative; display: flex; align-items: center; min-width: 0; }
.sinput .ic { position: absolute; left: 11px; color: var(--tx3); pointer-events: none; }
.sinput .inp { padding-left: 36px; }
.chk { width: 18px; height: 18px; margin: 0; accent-color: var(--inv); flex: none; cursor: pointer; }
.av { --h: 210; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: hsl(var(--h) var(--avs) var(--avl)); color: hsl(var(--h) 60% var(--avt)); user-select: none; }
.av--u { background: var(--uc, #6f9bff); color: #111; }
.av--xs { width: 22px; height: 22px; font-size: 9.5px; }
.av--sm { width: 26px; height: 26px; font-size: 10.5px; }
.av--lg { width: 56px; height: 56px; font-size: 19px; }
.av--none { background: var(--s3); color: var(--tx3); }
.tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 8px; border-radius: 6px; background: var(--hover); border: 1px solid var(--line); color: var(--tx2); font-size: 12px; line-height: 1.45; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 2px 9px 2px 8px; border-radius: 999px; background: var(--hover); font-size: 12.5px; color: var(--tx2); white-space: nowrap; max-width: 100%; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--tx3)); flex: none; }
.pill--won { --c: var(--ok); color: var(--ok); background: var(--okbg); }
.pill--lost { --c: var(--bad); color: var(--bad); background: var(--badbg); }
.pill--plain::before { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--tx3)); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px; border: 1px solid var(--line2); border-radius: 999px; color: var(--tx2); font-size: 13px; font-weight: 500; white-space: nowrap; background: transparent; transition: border-color .15s, background-color .15s, color .15s; }
.chip:hover { border-color: var(--tx3); color: var(--tx); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--inv); border-color: var(--inv); color: var(--invtx); }
.chip .ic { width: 15px; height: 15px; }
.chip__n { font-size: 11.5px; opacity: .75; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--s1); gap: 2px; }
.seg button { min-height: 28px; padding: 4px 11px; border-radius: 7px; color: var(--tx2); font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--tx); }
.seg button[aria-pressed="true"] { background: var(--s4); color: var(--tx); }
.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; border-radius: 999px; background: var(--s4); border: 1px solid var(--line2); transition: background-color .2s, border-color .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--tx2); transition: transform .2s var(--ease), background-color .2s; }
.switch[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: #fff; }
.switch:disabled { opacity: .5; }
.panel { border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); min-width: 0; }
.panel__h { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 16px 0 18px; }
.panel__h h2, .panel__h h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; flex: 1; min-width: 0; }
.panel__b { padding: 14px 18px 18px; }
.panel__f { padding: 0 18px 16px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 20px; text-align: center; color: var(--tx3); }
.empty__ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line2); color: var(--tx2); }
.empty b { color: var(--tx); font-weight: 600; font-size: 15px; }
.empty p { max-width: 38ch; }
.bar { height: 8px; border-radius: 999px; background: var(--s3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--tx2)); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 500; }
.delta--up { color: var(--ok); } .delta--down { color: var(--bad); }
.delta .ic { width: 13px; height: 13px; stroke-width: 2.2; }

/* ── Pulpit ───────────────────────────────────────────────────────── */
.hello { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 22px; }
.hello h1 { font-size: 28px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.hello p { color: var(--tx2); margin-top: 6px; }
.hello p b { color: var(--tx); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { position: relative; display: grid; gap: 4px; padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); min-width: 0; overflow: hidden; }
.kpi__l { display: flex; align-items: center; gap: 8px; color: var(--tx2); font-size: 13px; }
.kpi__l .ic { width: 16px; height: 16px; color: var(--tx3); }
.kpi__v { font-size: 26px; font-weight: 600; letter-spacing: -.035em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--tx3); font-size: 12.5px; }
.kpi__spark { position: absolute; right: 16px; top: 46px; width: 76px; height: 28px; opacity: .9; }
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.dash3 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 12px; margin-top: 12px; }
.chart { position: relative; height: 250px; margin: 6px 0 0; touch-action: pan-y; }
.panel--chart { display: flex; flex-direction: column; }
.panel--chart .panel__b { flex: 1; display: flex; flex-direction: column; }
.panel--chart .chart { flex: 1; min-height: 230px; height: auto; }
.chart:focus-visible { outline-offset: 4px; border-radius: 8px; }
.chart svg { display: block; overflow: visible; }
.chart__sum { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 0 18px; }
.chart__sum b { font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.chart__legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--tx3); margin-left: auto; }
.chart__legend i { display: inline-block; width: 14px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--tx); }
.chart__legend i.prev { background: none; border-top: 2px dashed var(--tx3); height: 0; }
.tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 11px; border: 1px solid var(--line2); border-radius: 10px; background: var(--s2); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; }
.tip.is-on { opacity: 1; }
.tip b { font-size: 14px; font-weight: 600; }
.axis { fill: var(--tx3); font: 400 11px var(--f); }
.gridl { stroke: var(--line); stroke-width: 1; }
.tlist { display: grid; }
.titem { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); }
.titem:first-child { border-top: 0; }
.titem__b { flex: 1; min-width: 0; display: grid; gap: 1px; }
.titem__t { font-weight: 500; }
.titem.is-done .titem__t { text-decoration: line-through; color: var(--tx3); }
.titem__m { font-size: 12.5px; color: var(--tx3); display: flex; gap: 8px; flex-wrap: wrap; }
.titem__m a { color: var(--tx2); text-decoration: none; }
.titem__m a:hover { text-decoration: underline; }
.cb { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; flex: none; border: 1.5px solid var(--tx3); border-radius: 6px; color: transparent; transition: background-color .15s, border-color .15s; position: relative; }
.cb::after { content: ""; position: absolute; inset: -12px; }
.cb:hover { border-color: var(--tx); }
.cb[aria-checked="true"] { background: var(--inv); border-color: var(--inv); color: var(--invtx); }
.cb .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.sbars { display: grid; gap: 13px; }
.sbar { display: grid; gap: 6px; }
.sbar__h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.sbar__h span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx2); }
.sbar__h b { font-weight: 600; }
.donut { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 18px; }
.donut svg { width: 150px; height: 150px; }
.donut__seg { transition: opacity .15s, stroke-width .15s; cursor: default; }
.donut.has-hover .donut__seg:not(.is-hot) { opacity: .25; }
.legend { display: grid; gap: 7px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 9px; border-radius: 6px; }
.legend li span:nth-child(2) { flex: 1; min-width: 0; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend li b { font-weight: 600; }
.feed { display: grid; }
.feed li { display: flex; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.feed li:first-child { border-top: 0; }
.feed__ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--s3); color: var(--tx2); }
.feed__ic .ic { width: 15px; height: 15px; }
.feed__b { display: grid; gap: 1px; min-width: 0; flex: 1; }
.feed__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__t a { font-weight: 600; text-decoration: none; }
.feed__t a:hover { text-decoration: underline; }
.feed__m { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container main (max-width: 1100px) {
  .dash3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash3 > :last-child { grid-column: 1 / -1; }
}
@container main (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@container main (max-width: 640px) {
  .dash3 { grid-template-columns: minmax(0, 1fr); }
  .donut { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .donut svg { width: 120px; height: 120px; }
  .chart { height: 210px; }
  .kpi__spark { display: none; }
  .kpi__v { font-size: 22px; }
}

/* ── Lejek ────────────────────────────────────────────────────────── */
.tb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tb .sinput { width: 240px; }
.tb__sum { display: flex; align-items: center; gap: 14px; margin-left: auto; color: var(--tx3); font-size: 13px; }
.tb__sum b { color: var(--tx); font-weight: 600; }
.owners { display: flex; align-items: center; }
.owners button { margin-left: -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); transition: transform .15s, opacity .15s; }
.owners button:first-child { margin-left: 0; }
.owners button:hover { transform: translateY(-2px); }
.owners.has-sel button[aria-pressed="false"] { opacity: .35; }
.owners button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--inv); z-index: 1; }
.board { position: relative; flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding-bottom: 16px; margin: 0 -28px; padding-left: 28px; padding-right: 28px; scroll-padding: 0 28px; overscroll-behavior-x: contain; }
.col { display: flex; flex-direction: column; flex: 0 0 286px; min-height: 0; border-radius: var(--r2); background: var(--s1); border: 1px solid var(--line); transition: border-color .15s, background-color .15s; }
.col.is-over { border-color: var(--tx3); background: var(--s2); }
.col__h { display: grid; gap: 8px; padding: 13px 14px 10px; border-bottom: 1px solid var(--line); }
.col__t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.col__t span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col__n { color: var(--tx3); font-weight: 500; font-size: 12.5px; }
.col__s { display: flex; justify-content: space-between; gap: 8px; color: var(--tx3); font-size: 12.5px; }
.col__s b { color: var(--tx); font-weight: 600; }
.col__bar { height: 3px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.col__bar i { display: block; height: 100%; background: var(--c); }
.col__list { flex: 1; min-height: 60px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.col__add { margin: 0 10px 10px; justify-content: flex-start; color: var(--tx3); }
.col__empty { display: grid; place-items: center; min-height: 92px; padding: 14px; border: 1px dashed var(--line2); border-radius: 12px; color: var(--tx3); font-size: 12.5px; text-align: center; }
.dc { position: relative; display: grid; gap: 8px; padding: 12px 12px 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--s2); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: border-color .15s, box-shadow .15s, opacity .15s; touch-action: pan-x pan-y; }
.dc:hover { border-color: var(--line2); }
.dc:focus-within { border-color: var(--tx3); }
.dc__top { display: flex; align-items: flex-start; gap: 6px; }
.dc__title { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; line-height: 1.35; letter-spacing: -.005em; cursor: inherit; }
.dc__title::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.dc__title:focus-visible { outline: none; }
.dc__title:focus-visible::after { outline: 2px solid var(--inv); outline-offset: 1px; }
.dc__menu { position: relative; z-index: 1; margin: -4px -5px -4px 0; }
.dc__who { color: var(--tx2); font-size: 12.5px; margin-top: -4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.dc__foot { display: flex; align-items: center; gap: 8px; }
.dc__val { font-weight: 600; font-size: 13.5px; flex: 1; }
.dc__days { display: inline-flex; align-items: center; gap: 4px; color: var(--tx3); font-size: 12px; }
.dc__days .ic { width: 13px; height: 13px; }
.dc__days.is-stale { color: var(--warn); }
.dc__flag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 5px; border-radius: 6px; background: var(--badbg); color: var(--bad); font-size: 11.5px; font-weight: 500; }
.dc__flag .ic { width: 13px; height: 13px; }
.dc.is-ph { opacity: .35; border-style: dashed; box-shadow: none; }
.dc.is-ph > * { visibility: hidden; }
.dc.is-new { animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.96); box-shadow: 0 0 0 2px var(--inv); } 100% { transform: none; box-shadow: 0 0 0 0 transparent; } }
.ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; margin: 0; transform-origin: 30% 30%; box-shadow: var(--shadow); border-color: var(--line2); cursor: grabbing; opacity: .97; }
.is-dragging, .is-dragging * { cursor: grabbing !important; }
.is-dragging .toasts { visibility: hidden; }
.is-dragging .board { scroll-snap-type: none; }
.drops { position: absolute; left: 50%; bottom: 22px; z-index: 40; display: flex; gap: 10px; transform: translate(-50%, 140%); opacity: 0; transition: transform .25s var(--ease), opacity .2s; pointer-events: none; }
.drops.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.drop { display: flex; align-items: center; gap: 9px; min-width: 150px; min-height: 52px; padding: 10px 18px; border: 1px dashed var(--line2); border-radius: 14px; background: var(--s2); box-shadow: var(--shadow); font-weight: 600; color: var(--tx2); transition: border-color .15s, background-color .15s, color .15s, transform .15s; }
.drop--won.is-over { border-style: solid; border-color: var(--ok); background: var(--okbg); color: var(--ok); transform: scale(1.04); }
.drop--lost.is-over { border-style: solid; border-color: var(--bad); background: var(--badbg); color: var(--bad); transform: scale(1.04); }
.drop--del.is-over { border-style: solid; border-color: var(--tx2); color: var(--tx); transform: scale(1.04); }

/* ── Szuflada szansy ──────────────────────────────────────────────── */
.stepper { display: flex; gap: 3px; }
.stepper button { flex: 1; min-width: 0; display: grid; gap: 6px; padding: 0; text-align: left; font-size: 11.5px; color: var(--tx3); }
.stepper button i { display: block; height: 6px; border-radius: 3px; background: var(--s4); transition: background-color .2s; }
.stepper button.is-past i, .stepper button.is-cur i { background: var(--c); }
.stepper button.is-cur { color: var(--tx); font-weight: 600; }
.stepper button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper button:hover i { opacity: .8; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.kv dt { color: var(--tx3); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; }
.status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; }
.status--won { background: var(--okbg); color: var(--ok); }
.status--lost { background: var(--badbg); color: var(--bad); }
.status b { color: inherit; }

/* ── Kontakty ─────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 10px 5px 12px; border: 1px solid var(--line2); border-radius: 9px; color: var(--tx2); font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--s1); }
.fbtn:hover { border-color: var(--tx3); color: var(--tx); }
.fbtn.is-on { border-color: var(--inv); color: var(--tx); }
.fbtn__v { color: var(--tx); font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.fbtn .ic { width: 15px; height: 15px; }
.tblwrap { border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); overflow: hidden; }
.tblscroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; height: 42px; padding: 0 12px; background: var(--s1); border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; color: var(--tx3); font-size: 12.5px; white-space: nowrap; }
.tbl th button { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; color: inherit; font-weight: inherit; }
.tbl th button:hover { color: var(--tx); }
.tbl th[aria-sort] button { color: var(--tx); }
.tbl th .ic { width: 14px; height: 14px; opacity: .7; }
.tbl td { height: 54px; padding: 6px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .12s; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.is-sel { background: var(--press); }
.tbl .c-chk { width: 44px; padding-right: 0; }
.tbl .c-name { min-width: 230px; max-width: none; }
.tbl .who__n, .tbl .who__e { white-space: nowrap; overflow: visible; }
.tbl .tags { flex-wrap: nowrap; }
.tbl .c-num { text-align: right; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; text-decoration: none; }
.who__t { display: grid; min-width: 0; line-height: 1.3; }
.who__n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.who__e { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; }
a.who:hover .who__n { text-decoration: underline; text-underline-offset: 3px; }
.bulk { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: max-content; max-width: 100%; margin: 14px auto 0; padding: 8px 8px 8px 16px; border: 1px solid var(--line2); border-radius: 14px; background: var(--s2); box-shadow: var(--shadow); animation: up .25s var(--ease); }
.bulk__n { font-weight: 600; margin-right: 6px; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); color: var(--tx3); font-size: 13px; }
.pager__b { display: flex; align-items: center; gap: 4px; }
.clist { display: none; }
.ccard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ccard:last-child { border-bottom: 0; }
.ccard__b { display: grid; gap: 3px; min-width: 0; }
.ccard__n { font-weight: 600; text-decoration: none; }
.ccard__m { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--tx3); }
.colmenu label { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.colmenu label:hover { background: var(--hover); }

/* ── Karta kontaktu ───────────────────────────────────────────────── */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; margin-bottom: 12px; color: var(--tx3); text-decoration: none; font-size: 13px; font-weight: 500; }
.back:hover { color: var(--tx); }
.chead { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); margin-bottom: 12px; }
.chead__t { display: grid; gap: 4px; min-width: 0; flex: 1 1 260px; }
.chead h1 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.chead h1:focus { outline: none; }
.chead__m { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; color: var(--tx2); font-size: 13px; }
.chead__m span { display: inline-flex; align-items: center; gap: 6px; }
.chead__m .ic { width: 15px; height: 15px; color: var(--tx3); }
.chead__m .cm { min-width: 0; max-width: 100%; }
.chead__m .cm__v { display: inline; min-width: 0; overflow-wrap: anywhere; }
.cm__cp { margin-left: -3px; color: var(--tx3); opacity: 0; transition: opacity .15s, background-color .15s, color .15s; }
.cm:hover .cm__cp, .cm__cp:focus-visible { opacity: 1; }
.chead__m .cm__cp .ic { width: 14px; height: 14px; color: currentColor; }
.qa { display: flex; gap: 6px; flex-wrap: wrap; }
.qa .btn { flex-direction: column; gap: 5px; min-width: 70px; min-height: 60px; padding: 8px 10px; font-size: 12.5px; border-color: var(--line2); background: var(--s2); }
.qa .btn:hover { border-color: var(--tx3); }
.cgrid { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.cgrid > * { min-width: 0; }
.props { display: grid; gap: 2px; }
.prop { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 6px; min-height: 40px; }
.prop > label, .prop > span:first-child { color: var(--tx3); font-size: 13px; }
.prop .inp { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
.prop--stack { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 6px 0 2px; }
.prop--stack > label { line-height: 1.3; }
.prop--stack .inp { margin-left: -8px; width: calc(100% + 8px); }
.prop__sec { padding: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--tx2); display: flex; align-items: center; gap: 8px; }
.prop__sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.comp { border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); margin-bottom: 12px; }
.comp__tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.comp__tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--tx3); font-weight: 500; font-size: 13.5px; white-space: nowrap; margin-bottom: -1px; }
.comp__tabs button:hover { color: var(--tx); }
.comp__tabs button[aria-selected="true"] { color: var(--tx); border-bottom-color: var(--inv); }
.comp__tabs .ic { width: 16px; height: 16px; }
.comp__b { padding: 12px; display: grid; gap: 10px; }
.comp__b textarea.inp { min-height: 76px; border-color: var(--line); background: var(--s2); }
.comp__f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.comp__f .grow { color: var(--tx3); font-size: 12.5px; }
.tlf { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.tl { position: relative; display: grid; }
.tl::before { content: ""; position: absolute; left: 16px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tli { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 0 0 16px; }
.tli__ic { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--s2); border: 1px solid var(--line2); color: var(--tx2); }
.tli__ic .ic { width: 15px; height: 15px; }
.tli--won .tli__ic { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tli--lost .tli__ic { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.tli__c { min-width: 0; padding: 10px 14px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--s1); }
.tli__h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx3); margin-bottom: 3px; }
.tli__h b { color: var(--tx); font-weight: 600; font-size: 13.5px; }
.tli__x { white-space: pre-wrap; overflow-wrap: anywhere; }
.tli.is-new .tli__c { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { border-color: var(--inv); } 100% { border-color: var(--line); } }
.rel { display: grid; gap: 8px; }
.reld { display: grid; gap: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--s2); text-align: left; width: 100%; transition: border-color .15s; }
.reld:hover { border-color: var(--line2); }
.reld__t { font-weight: 600; font-size: 13.5px; }
.reld__m { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--tx3); }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.files li:first-child { border-top: 0; }
.files__ic { display: grid; place-items: center; width: 34px; height: 38px; flex: none; border-radius: 7px; background: var(--s3); color: var(--tx2); font-size: 9.5px; font-weight: 700; letter-spacing: .02em; }
.files__b { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.files__n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files__m { font-size: 12px; color: var(--tx3); }
@container main (max-width: 1000px) {
  .comp__tabs button { padding: 8px 9px; gap: 6px; }
}
@container main (max-width: 1240px) {
  .cgrid { grid-template-columns: 290px minmax(0, 1fr); }
  .cgrid > .c-aside { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
}
@container main (max-width: 820px) {
  .cgrid { grid-template-columns: minmax(0, 1fr); }
  .chead { padding: 16px; }
}

/* ── Zadania ──────────────────────────────────────────────────────── */
.tgroups { display: grid; gap: 14px; }
.tgroup__h { display: flex; align-items: center; gap: 10px; padding: 0 4px 8px; font-weight: 600; }
.tgroup__h .num { color: var(--tx3); font-weight: 500; }
.tgroup__h.is-over { color: var(--bad); }
.trows { border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); }
.trow { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; border-top: 1px solid var(--line); }
.trow:first-child { border-top: 0; }
.trow .cb { margin-top: 0; }
.trow__ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--s3); color: var(--tx2); flex: none; }
.trow__ic .ic { width: 15px; height: 15px; }
.trow__b { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.trow__t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.is-done .trow__t { text-decoration: line-through; color: var(--tx3); }
.trow__m { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__m a { color: var(--tx2); text-decoration: none; }
.trow__m a:hover { text-decoration: underline; }
.trow__due { font-size: 12.5px; color: var(--tx2); white-space: nowrap; }
.trow__due.is-over { color: var(--bad); }
.prio { color: var(--warn); font-size: 12px; font-weight: 600; }
.wk { border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); overflow: auto; max-height: calc(100dvh - 240px); min-height: 420px; }
.wk__grid { display: grid; grid-template-columns: 54px repeat(7, minmax(118px, 1fr)); min-width: 880px; position: relative; }
.wk__hd { position: sticky; top: 0; z-index: 3; padding: 10px 10px 9px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--s1); font-size: 12.5px; color: var(--tx3); }
.wk__hd b { display: block; color: var(--tx); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.wk__hd.is-today b { display: grid; place-items: center; width: max-content; min-width: 30px; height: 28px; margin-top: 1px; padding: 0 6px; border-radius: 8px; background: var(--inv); color: var(--invtx); }
.wk__corner { position: sticky; top: 0; left: 0; z-index: 4; background: var(--s1); border-bottom: 1px solid var(--line); }
.wk__hours { position: sticky; left: 0; z-index: 2; background: var(--s1); }
.wk__h { height: 56px; padding: 2px 8px 0 0; text-align: right; font-size: 11.5px; color: var(--tx3); }
.wk__day { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 56px; }
.wk__day.is-today { background-color: var(--hover); }
.wk__slot { position: absolute; left: 0; right: 0; height: 28px; }
.wk__slot:hover { background: var(--hover); }
.wk__ev { position: absolute; left: 4px; right: 4px; z-index: 1; display: grid; align-content: center; gap: 1px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line2); border-left: 3px solid var(--c, var(--tx2)); background: var(--s3); font-size: 12px; line-height: 1.3; overflow: hidden; text-align: left; transition: border-color .15s; }
.wk__ev:hover { border-color: var(--tx3); border-left-color: var(--c, var(--tx2)); }
.wk__ev b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk__ev b .muted { font-weight: 400; }
.wk__ev.is-done { opacity: .5; }
.wk__ev.is-done b { text-decoration: line-through; }
.wk__now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.wk__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ── Skrzynka ─────────────────────────────────────────────────────── */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 280px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); overflow: hidden; margin-bottom: 20px; }
.inbox__list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.inbox__f { display: grid; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.inbox__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inbox__chips::-webkit-scrollbar { display: none; }
.inbox__chips .chip { min-height: 30px; padding: 4px 9px; gap: 5px; font-size: 12.5px; }
.threads { flex: 1; min-height: 0; overflow-y: auto; }
.th { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 11px; width: 100%; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); text-align: left; transition: background-color .12s; }
.th:hover { background: var(--hover); }
.th[aria-current="true"] { background: var(--press); }
.th__av { grid-row: span 3; position: relative; align-self: start; height: 30px; margin-top: 2px; }
.th__ch { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--s4); color: var(--tx); border: 2px solid var(--s1); }
.th__ch .ic { width: 10px; height: 10px; stroke-width: 2.2; }
.th__h { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.th__n { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th__d { font-size: 12px; color: var(--tx3); white-space: nowrap; }
.th__s { font-size: 13px; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th__p { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th.is-unread .th__n { font-weight: 700; }
.th.is-unread .th__p { color: var(--tx2); }
.th.is-unread::before { content: ""; position: absolute; left: 6px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--info); }
.conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; container-type: inline-size; container-name: conv; }
.conv__h { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.conv__h .grow { display: grid; line-height: 1.3; }
.conv__h b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv__h small { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv__back { display: none; }
/* wąska rozmowa: imię, adres i menu w pierwszym wierszu, przypisanie i szansa w drugim */
@container conv (max-width: 660px) {
  .conv__h { row-gap: 8px; }
  .conv__h .conv__who { flex: 1 1 calc(100% - 150px); }
  .conv__h .conv__who small { white-space: normal; overflow-wrap: anywhere; }
  .conv__h select, .conv__h .btn { order: 1; }
  .conv__h select { flex: 1 1 100px; min-width: 0; max-width: none !important; }
}
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: min(78%, 560px); display: grid; gap: 4px; }
.msg__b { padding: 10px 13px; border-radius: 14px; background: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg__m { font-size: 11.5px; color: var(--tx3); }
.msg--out { align-self: flex-end; justify-items: end; }
.msg--out .msg__b { background: var(--inv); color: var(--invtx); border-bottom-right-radius: 5px; }
.msg--in .msg__b { border-bottom-left-radius: 5px; }
.msg--email .msg__b { border-radius: 12px; background: var(--s2); border: 1px solid var(--line); color: var(--tx); }
.msg--email.msg--out .msg__b { background: var(--s2); color: var(--tx); }
.msg__subj { font-weight: 600; margin-bottom: 4px; }
.msgs__day { align-self: center; font-size: 12px; color: var(--tx3); padding: 4px 10px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--s3); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--tx3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.reply { padding: 10px 12px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.reply textarea.inp { min-height: 64px; max-height: 200px; border-color: var(--line); background: var(--s2); }
.reply__f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inbox__side { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); padding: 18px 16px; display: grid; align-content: start; gap: 16px; }
.side__c { display: grid; justify-items: center; gap: 8px; text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.side__c b { font-size: 15px; font-weight: 600; }
@container main (max-width: 1180px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox__side { display: none; }
}

/* ── Automatyzacje ────────────────────────────────────────────────── */
.alist { display: grid; gap: 10px; }
.arow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); }
.arow__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--s3); color: var(--tx); }
.arow__b { display: grid; gap: 3px; min-width: 0; }
.arow__n { font-weight: 600; font-size: 14.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.arow__n:hover { text-decoration: underline; text-underline-offset: 3px; }
.arow__f { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx3); }
.arow__f .ic { width: 13px; height: 13px; }
.arow__s { display: grid; text-align: right; font-size: 12.5px; color: var(--tx3); line-height: 1.35; white-space: nowrap; }
.arow__s b { color: var(--tx); font-size: 15px; font-weight: 600; }
.aed { display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.aed > * { min-width: 0; }
.pal { display: grid; gap: 4px; }
.pal button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 10px; border-radius: 9px; color: var(--tx2); font-weight: 500; text-align: left; }
.pal button:hover { background: var(--hover); color: var(--tx); }
.pal__ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--s3); color: var(--tx); flex: none; }
.pal__ic .ic { width: 15px; height: 15px; }
.canvas { position: relative; padding: 28px 16px 36px; border: 1px solid var(--line); border-radius: var(--r2); background-color: var(--s1); background-image: radial-gradient(var(--line2) 1px, transparent 1px); background-size: 18px 18px; min-height: 520px; overflow-x: auto; }
.flow { display: flex; flex-direction: column; align-items: center; width: 100%; }
.node { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: min(400px, 100%); padding: 12px 10px 12px 12px; border: 1px solid var(--line2); border-radius: 14px; background: var(--s2); text-align: left; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.node:hover { border-color: var(--tx3); }
.node.is-sel { border-color: var(--inv); box-shadow: 0 0 0 3px color-mix(in srgb, var(--inv) 14%, transparent); }
.node.is-run { border-color: var(--ok); box-shadow: 0 0 0 4px var(--okbg); }
.node.is-new { animation: pop .5s var(--ease); }
.node__ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--s4); color: var(--tx); }
.node--trigger .node__ic { background: var(--inv); color: var(--invtx); }
.node--cond .node__ic { background: var(--warnbg); color: var(--warn); }
.node--wait .node__ic { background: var(--s3); color: var(--tx2); }
.node__b { display: grid; gap: 1px; min-width: 0; }
.node__k { font-size: 11.5px; color: var(--tx3); font-weight: 500; }
.node__t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node__d { font-size: 12.5px; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node__sel { position: absolute; inset: 0; border-radius: 14px; }
.node__x { position: relative; z-index: 1; }
.link { position: relative; display: grid; place-items: center; width: 2px; height: 46px; background: var(--line2); }
.link::after { content: ""; position: absolute; bottom: -1px; left: 50%; width: 8px; height: 8px; border-right: 2px solid var(--line2); border-bottom: 2px solid var(--line2); transform: translate(-50%, 0) rotate(45deg); }
.link.is-run { background: var(--ok); }
.link__add { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line2); background: var(--s1); color: var(--tx2); transition: transform .15s, background-color .15s, color .15s; }
.link__add:hover { background: var(--inv); color: var(--invtx); border-color: var(--inv); transform: scale(1.1); }
.link__add .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.flow__end { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; padding: 7px 14px; border-radius: 999px; border: 1px dashed var(--line2); color: var(--tx3); font-size: 12.5px; background: var(--s1); }
.hist td, .hist th { height: 44px; }
@container main (max-width: 1200px) {
  .aed { grid-template-columns: minmax(0, 1fr) 290px; }
  .aed > .aed__pal { grid-column: 1 / -1; order: 3; }
  .aed__pal .pal { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
@container main (max-width: 820px) {
  .aed { grid-template-columns: minmax(0, 1fr); }
  .aed > .aed__pal { order: 0; }
  .arow { grid-template-columns: auto minmax(0, 1fr) auto; }
  .arow__s, .arow > .btn { display: none; }
}

/* ── Raporty ──────────────────────────────────────────────────────── */
.rkpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.rgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
.rgrid + .rgrid { margin-top: 12px; }
.funnel { display: grid; gap: 7px; }
.fstep { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.fstep__n { font-size: 13px; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fstep__bar { position: relative; height: 34px; }
.fstep__bar i { position: absolute; left: 50%; top: 0; bottom: 0; transform: translateX(-50%); min-width: 6px; border-radius: 8px; background: var(--c); opacity: .9; transition: width .5s var(--ease); }
.fstep__bar span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #111; mix-blend-mode: normal; }
.fstep__p { text-align: right; font-size: 12.5px; color: var(--tx3); }
.lb td { height: 50px; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--s3); font-weight: 600; font-size: 12px; color: var(--tx2); }
.rank--1 { background: var(--inv); color: var(--invtx); }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.cols__c { flex: 1; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; height: 100%; text-align: center; }
.cols__bar { align-self: end; border-radius: 6px 6px 3px 3px; background: var(--tx2); min-height: 2px; position: relative; transition: background-color .15s; }
.cols__c:hover .cols__bar { background: var(--tx); }
.cols__c:last-child .cols__bar { background: var(--tx); }
.cols__l { font-size: 11px; color: var(--tx3); overflow: hidden; white-space: nowrap; }
.daterange { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.daterange .inp { width: 150px; min-height: 34px; padding: 5px 9px; }
@container main (max-width: 1100px) {
  /* pięć kafli: trzy w pierwszym wierszu, dwa szersze w drugim, bez pustego miejsca */
  .rkpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rkpis > * { grid-column: span 2; }
  .rkpis > :nth-child(n+4) { grid-column: span 3; }
  .rgrid { grid-template-columns: minmax(0, 1fr); }
}
@container main (max-width: 640px) {
  .rkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rkpis > *, .rkpis > :nth-child(n+4) { grid-column: auto; }
  .rkpis > :last-child { grid-column: 1 / -1; }
  .fstep { grid-template-columns: 100px minmax(0, 1fr) 44px; gap: 8px; }
  .fstep__n { white-space: normal; line-height: 1.25; }
}

/* ── Oferty ───────────────────────────────────────────────────────── */
.qst { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--hover); color: var(--tx2); white-space: nowrap; }
.qst--sent { background: rgba(111, 155, 255, .13); color: var(--info); }
.qst--accepted { background: var(--okbg); color: var(--ok); }
.qst--rejected { background: var(--badbg); color: var(--bad); }
.qed { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.qed > * { min-width: 0; }
.items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.items th { padding: 0 6px 8px; text-align: left; font-weight: 500; font-size: 12.5px; color: var(--tx3); white-space: nowrap; }
.items td { padding: 4px 6px; vertical-align: middle; }
.items .inp { min-height: 36px; padding: 6px 9px; }
.items .c-n { width: 40%; }
.items .c-q { width: 9%; }
.items .c-p { width: 15%; }
.items .c-d { width: 9%; }
.items .c-v { width: 10%; }
.items .c-t { width: 14%; text-align: right; white-space: nowrap; font-weight: 600; }
.items tr + tr td { border-top: 1px solid var(--line); }
.totals { display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; gap: 10px; color: var(--tx2); }
.totals div b { color: var(--tx); font-weight: 600; }
.totals .grand { padding-top: 10px; border-top: 1px solid var(--line); font-size: 18px; color: var(--tx); font-weight: 600; letter-spacing: -.02em; }
.totals .grand b { font-size: 22px; }
.paper { width: 100%; max-width: 760px; margin: 0 auto; padding: 48px 52px; background: #fff; color: #161616; border-radius: 6px; font-size: 13px; line-height: 1.5; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.paper__h { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid #e3e3e3; }
.paper__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.paper__mono { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #161616; color: #fff; font-weight: 600; }
.paper h2 { font-size: 24px; letter-spacing: -.03em; margin: 26px 0 4px; font-weight: 600; }
.paper__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 24px; }
.paper__meta div { display: grid; gap: 2px; }
.paper__meta span { color: #6a6a6a; font-size: 11.5px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: left; font-weight: 600; font-size: 11.5px; color: #6a6a6a; padding: 8px 6px; border-bottom: 1px solid #d8d8d8; }
.paper td { padding: 10px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.paper .r { text-align: right; white-space: nowrap; }
.paper__tot { display: grid; justify-content: end; gap: 6px; margin-top: 18px; }
.paper__tot div { display: flex; justify-content: space-between; gap: 40px; min-width: 260px; }
.paper__tot .grand { font-size: 17px; font-weight: 600; padding-top: 8px; border-top: 1px solid #d8d8d8; }
.paper__note { margin-top: 28px; color: #555; font-size: 12px; }
.paper__foot { margin-top: 34px; padding-top: 14px; border-top: 1px solid #e3e3e3; color: #888; font-size: 11px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@container main (max-width: 1000px) { .qed { grid-template-columns: minmax(0, 1fr); } }

/* ── Ustawienia ───────────────────────────────────────────────────── */
.set { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.set__nav { display: grid; gap: 2px; position: sticky; top: 0; }
.set__nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; border-radius: 9px; color: var(--tx2); text-decoration: none; font-weight: 500; }
.set__nav a:hover { background: var(--hover); color: var(--tx); }
.set__nav a[aria-current="page"] { background: var(--press); color: var(--tx); }
.set__b { display: grid; gap: 12px; min-width: 0; }
.srows { display: grid; }
.srow { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.srow:first-child { border-top: 0; }
.srow__b { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.srow__b b { font-weight: 600; }
.srow__b small { font-size: 12.5px; color: var(--tx3); }
.swatch { width: 22px; height: 22px; border-radius: 7px; background: var(--c); flex: none; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
button.swatch:hover { transform: scale(1.08); }
.swatches { display: grid; grid-template-columns: repeat(6, 28px); gap: 8px; padding: 6px; }
.swatches button { width: 28px; height: 28px; border-radius: 8px; background: var(--c); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--s2), 0 0 0 4px var(--inv); }
.integ { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.icard { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); }
.icard__h { display: flex; align-items: center; gap: 12px; }
.icard__logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line2); background: var(--s3); font-weight: 700; font-size: 14px; letter-spacing: -.02em; flex: none; }
.icard__n { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.icard__n b { font-weight: 600; }
.icard__n small { font-size: 12px; color: var(--tx3); }
.icard p { color: var(--tx2); font-size: 13px; }
.icard__st { font-size: 12.5px; color: var(--tx3); display: flex; align-items: center; gap: 6px; }
.icard__st.is-on { color: var(--ok); }
.ntbl td, .ntbl th { text-align: center; }
.ntbl td:first-child, .ntbl th:first-child { text-align: left; white-space: normal; }
@container main (max-width: 820px) {
  .set { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set__nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
  .set__nav a { white-space: nowrap; border: 1px solid var(--line2); border-radius: 999px; min-height: 36px; padding: 6px 12px; }
  .set__nav a .ic { display: none; }
}

/* ── Warstwy: okna, szuflady, menu, paleta, powiadomienia ─────────── */
.ov { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; background: var(--scrim); animation: fade .18s ease; }
.ov.is-out { animation: fadeout .16s ease forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.dlg { position: relative; display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(86dvh, 860px); border: 1px solid var(--line2); border-radius: 18px; background: var(--s1); box-shadow: var(--shadow); animation: dlgin .24s var(--ease); }
.dlg--sm { width: min(420px, 100%); }
.dlg--lg { width: min(820px, 100%); }
.dlg--xl { width: min(980px, 100%); }
@keyframes dlgin { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.dlg__h { display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px 20px; flex: none; }
.dlg__h h2 { flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -.02em; min-width: 0; }
.dlg__b { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 20px 18px; }
.dlg__f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.dlg__f .grow { color: var(--tx3); font-size: 12.5px; }
.dlg__grab { display: none; }
.ov--side { place-items: stretch end; padding: 0; }
.dlg--side { width: min(520px, 100%); height: 100%; max-height: none; border-radius: 0; border-width: 0 0 0 1px; animation: sidein .28s var(--ease); }
@keyframes sidein { from { transform: translateX(30px); opacity: 0; } }
.ov--paper .dlg__b { background: var(--s3); padding: 24px; }
.pop { position: fixed; z-index: 150; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); max-height: min(420px, 70vh); overflow-y: auto; padding: 5px; border: 1px solid var(--line2); border-radius: 12px; background: var(--s2); box-shadow: var(--shadow); animation: popin .14s var(--ease); }
@keyframes popin { from { transform: translateY(-4px); opacity: 0; } }
.pop__i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 7px 10px; border-radius: 8px; color: var(--tx); text-align: left; font-size: 13.5px; }
.pop__i:hover, .pop__i:focus-visible { background: var(--press); outline: none; }
.pop__i .ic { width: 16px; height: 16px; color: var(--tx3); }
.pop__i--bad, .pop__i--bad .ic { color: var(--bad); }
.pop__i[aria-checked="true"] { font-weight: 600; }
.pop__i .pop__ck { margin-left: auto; color: var(--tx); }
.pop__i:disabled { opacity: .45; cursor: default; }
.pop__h { padding: 8px 10px 4px; font-size: 12px; color: var(--tx3); font-weight: 500; }
.pop__sep { height: 1px; margin: 5px 4px; background: var(--line); }
.notifs { width: 380px; max-width: calc(100vw - 16px); max-height: min(560px, 80vh); padding: 0; display: flex; flex-direction: column; }
.notifs__h { display: flex; align-items: center; gap: 10px; padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.notifs__h b { flex: 1; font-size: 15px; font-weight: 600; }
.notifs ul { overflow-y: auto; }
.notif { display: flex; gap: 11px; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; transition: background-color .12s; }
.notif:hover { background: var(--hover); }
.notif__ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--s3); color: var(--tx2); flex: none; }
.notif__ic .ic { width: 15px; height: 15px; }
.notif__b { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 13.5px; }
.notif__b small { color: var(--tx3); font-size: 12px; }
.notif.is-unread .notif__b span { font-weight: 600; }
.notif.is-unread::after { content: ""; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--info); flex: none; }
.cmd { width: min(620px, 100%); align-self: start; margin-top: 10vh; }
.cmd__in { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmd__in input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.cmd__in input::placeholder { color: var(--tx3); }
.cmd__in .ic { color: var(--tx3); }
.cmd__list { max-height: min(420px, 58dvh); overflow-y: auto; padding: 6px; }
.cmd__g { padding: 10px 10px 4px; font-size: 12px; color: var(--tx3); font-weight: 500; }
.cmd__o { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 7px 10px; border-radius: 9px; text-align: left; cursor: pointer; }
.cmd__o[aria-selected="true"] { background: var(--press); }
.cmd__o .ic { color: var(--tx3); }
.cmd__o .grow { display: grid; line-height: 1.3; }
.cmd__o small { color: var(--tx3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd__o mark { background: none; color: var(--tx); font-weight: 700; }
.cmd__f { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--tx3); font-size: 12px; }
.cmd__f span { display: inline-flex; align-items: center; gap: 6px; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.keys div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.keys span:last-child { display: inline-flex; gap: 4px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 12px; min-height: 48px; max-width: min(440px, calc(100vw - 32px)); padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--inv); color: var(--invtx); box-shadow: var(--shadow); font-weight: 500; pointer-events: auto; animation: toastin .28s var(--ease); }
.toast.is-out { animation: toastout .2s ease forwards; }
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } }
@keyframes toastout { to { transform: translateY(8px); opacity: 0; } }
.toast__t { flex: 1; min-width: 0; padding: 4px 0; }
.toast__a { min-height: 32px; padding: 5px 12px; border-radius: 8px; font-weight: 600; color: var(--invtx); background: color-mix(in srgb, var(--invtx) 10%, transparent); white-space: nowrap; }
.toast__a:hover { background: color-mix(in srgb, var(--invtx) 18%, transparent); }
.toast__x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--invtx); opacity: .6; }
.toast__x:hover { opacity: 1; }
.toast__x .ic { width: 15px; height: 15px; }
.tabbar { display: none; }
.scrim-sb { display: none; }
.call { display: grid; justify-items: center; gap: 6px; padding: 14px 0 18px; text-align: center; }
.call__t { font-size: 34px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.call__live { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 500; font-size: 13px; }
.call__live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: blink 1.2s infinite; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.radio { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; }
.radio:hover { border-color: var(--tx3); }
.radio:has(input:checked) { border-color: var(--inv); background: var(--hover); }
.radio input { accent-color: var(--inv); width: 16px; height: 16px; margin: 0; }
.radios { display: grid; gap: 6px; }

/* ── Tablet i węższe ramki (np. osadzenie 900 px) ─────────────────── */
@media (max-width: 1179px) and (min-width: 761px) {
  .shell { --sbw: 68px; }
  .sb__word, .sb__crm, .ws__txt, .ws > .ic, .nav__t, .nav__label, .me__txt { display: none; }
  .sb__brand { justify-content: center; padding: 0; }
  .ws { justify-content: center; width: 48px; margin: 2px auto 8px; padding: 7px; }
  .nav a, .sb__foot a, .sb__foot button { justify-content: center; padding: 7px; }
  .nav__n { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10.5px; }
  .me { justify-content: center; padding: 8px 0 2px; }
  .sb__collapse { display: none !important; }
  .search { width: min(280px, 32vw); }
  .view { padding: 20px 20px 40px; }
  .board { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
  .top { padding: 0 14px 0 20px; }
}

/* ── Telefon ──────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root { --toph: 56px; }
  body { font-size: 15px; }
  .demo { min-height: 36px; padding: 4px 10px; gap: 8px; font-size: 12px; }
  .demo__note span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .demo__links a:not(.demo__cta) { display: none; }
  .demo__links a { min-height: 28px; padding: 3px 10px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sb { display: none; }
  .top { padding: 0 6px 0 14px; gap: 4px; }
  .top__brand { display: inline-flex !important; }
  .search { display: none; }
  .top .ib { width: 44px; height: 44px; }
  .top__title { font-size: 16px; }
  .top__help, .top__theme { display: none; }
  .mainwrap { grid-template-rows: var(--toph) minmax(0, 1fr) auto; }
  .main { padding-bottom: 0; }
  .view { padding: 16px 14px 28px; }
  .view--fill { padding-bottom: 0; }
  .vh { margin-bottom: 14px; }
  .vh__t { flex-basis: 100%; }
  .only-d { display: none !important; }
  .demo__l { display: none; }
  .demo__s { display: inline !important; }
  .wk-hint { display: none; }
  .srow { padding: 10px 12px; }
  .srow__b { flex-basis: calc(100% - 52px); }
  .qcards { display: block !important; }
  .vh h1, .vh h2 { font-size: 21px; }
  .hello h1 { font-size: 23px; }
  .btn { min-height: 44px; padding: 9px 14px; }
  .btn--sm { min-height: 38px; }
  .ib { width: 44px; height: 44px; }
  .ib--sm { width: 36px; height: 36px; }
  .ib--xs { width: 32px; height: 32px; }
  .inp { min-height: 44px; font-size: 16px; }
  .inp--sm { min-height: 40px; }
  .chip, .fbtn { min-height: 40px; }
  .seg button { min-height: 36px; }
  .switch { width: 46px; height: 28px; }
  .switch::after { width: 22px; height: 22px; }
  .switch[aria-checked="true"]::after { transform: translateX(18px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--side); padding-bottom: env(safe-area-inset-bottom); position: relative; z-index: 30; }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 58px; color: var(--tx3); text-decoration: none; font-size: 11px; font-weight: 500; }
  .tabbar a[aria-current="page"], .tabbar button[aria-expanded="true"], .tabbar button.is-cur { color: var(--tx); }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar__n { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--inv); color: var(--invtx); font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
  .toasts { left: 12px; right: 12px; transform: none; width: auto; max-width: none; bottom: calc(70px + env(safe-area-inset-bottom)); justify-items: stretch; }
  .toast { max-width: none; }
  .kpis { gap: 8px; }
  .kpi { padding: 13px 14px 12px; }
  .panel__h { padding: 12px 14px 0 14px; }
  .panel__b { padding: 12px 14px 14px; }
  .chart__sum { padding: 0 14px; }
  .tb .sinput { width: 100%; flex: 1 1 100%; }
  .tb__sum { width: 100%; margin-left: 0; justify-content: space-between; }
  .board { margin: 0 -14px; padding: 0 14px 14px; gap: 10px; scroll-snap-type: x mandatory; scroll-padding: 0 14px; }
  .col { flex: 0 0 min(84vw, 330px); scroll-snap-align: start; }
  .drops { bottom: 12px; gap: 8px; width: calc(100% - 24px); }
  .drop { flex: 1; min-width: 0; justify-content: center; padding: 10px; font-size: 13px; }
  .tblscroll { display: none; }
  .clist { display: block; }
  .pager { padding: 10px 12px; }
  .bulk { bottom: 10px; padding: 8px; gap: 6px; }
  .bulk__n { width: 100%; padding-left: 6px; }
  .chead { gap: 14px; }
  .qa { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .qa .btn { min-width: 0; padding: 8px 4px; }
  .comp__tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 4px 4px 0; overflow: visible; }
  .comp__tabs button { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 8px 2px 7px; font-size: 12px; }
  .tb [data-act="kt-cols"] { display: none; }
  .prop { grid-template-columns: 104px minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); margin: 0 -14px; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; margin-bottom: 0; }
  .inbox .conv { display: none; }
  .inbox.is-thread .inbox__list { display: none; }
  .inbox.is-thread .conv { display: flex; }
  .conv__back { display: inline-grid; }
  .msg { max-width: 86%; }
  .trow { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .trow__b { flex-basis: calc(100% - 84px); }
  .trow__due { margin-left: 74px; }
  .wk { max-height: none; }
  .arow { padding: 12px; gap: 12px; }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .items thead { display: none; }
  .items, .items tbody, .items tr, .items td { display: block; width: auto !important; }
  .items tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 0; }
  .items tr + tr td { border-top: 0; }
  .items tr + tr { border-top: 1px solid var(--line); }
  .items td { padding: 0; }
  .items .c-n { grid-column: 1 / -1; }
  .items .c-t { grid-column: 1 / 3; align-self: center; text-align: left; }
  .items .c-x { grid-column: 4; justify-self: end; }
  .items td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--tx3); margin-bottom: 3px; }
  .paper { padding: 26px 20px; }
  .paper__meta { grid-template-columns: 1fr 1fr; }
  .keys { grid-template-columns: minmax(0, 1fr); }
  /* okna jako arkusze od dołu */
  .ov { place-items: end stretch; padding: 0; }
  .dlg, .dlg--sm, .dlg--lg, .dlg--xl { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; border-width: 1px 0 0; animation: sheetin .3s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .dlg__grab { display: block; width: 40px; height: 4px; margin: 8px auto -4px; border-radius: 4px; background: var(--line2); flex: none; }
  .dlg__h { padding: 12px 10px 8px 18px; }
  .dlg__b { padding: 6px 16px 16px; }
  .dlg__f { padding: 12px 16px; }
  .dlg__f .btn { flex: 1; }
  .dlg__f .grow { flex-basis: 100%; }
  .ov--side { place-items: end stretch; }
  .dlg--side { height: auto; max-height: 92dvh; }
  .cmd { margin-top: 0; align-self: end; }
  .pop.pop--sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: none; max-height: 70dvh; border-radius: 18px 18px 0 0; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); animation: sheetin .26s var(--ease); }
  .pop--sheet .pop__i { min-height: 48px; font-size: 15px; }
  .notifs.pop--sheet { padding: 0 0 env(safe-area-inset-bottom); }
  .pop-scrim { position: fixed; inset: 0; z-index: 149; background: var(--scrim); animation: fade .18s ease; }
}
@keyframes sheetin { from { transform: translateY(40px); opacity: .4; } }
.top__brand { display: none; color: var(--tx); }
.top__search-m { display: none; }
.demo__s { display: none; }
.qcards { display: none; }
.qcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; }
.qcard:last-child { border-bottom: 0; }
.qcard__n { font-weight: 600; }
.qcard__m { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .top__search-m { display: inline-grid; } }
.top__brand svg { width: 22px; height: 25px; fill: currentColor; }

/* Szersze ekrany: ręcznie rozwinięty panel w trybie tabletowym */
@media (max-width: 1179px) and (min-width: 761px) {
  .sb-open .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; box-shadow: var(--shadow); }
  .sb-open .sb .sb__word, .sb-open .sb .sb__crm, .sb-open .sb .ws__txt, .sb-open .sb .ws > .ic, .sb-open .sb .nav__t, .sb-open .sb .nav__label, .sb-open .sb .me__txt { display: revert; }
  .sb-open .sb .sb__brand { justify-content: flex-start; padding: 0 18px; }
  .sb-open .sb .ws { justify-content: flex-start; width: calc(100% - 20px); margin: 2px 10px 8px; padding: 8px 10px; }
  .sb-open .sb .nav a, .sb-open .sb .sb__foot a, .sb-open .sb .sb__foot button { justify-content: flex-start; padding: 7px 10px; }
  .sb-open .sb .nav__n { position: static; }
  .sb-open .sb .me { justify-content: flex-start; padding: 8px 10px 2px; }
  .sb-open .scrim-sb { display: block; position: fixed; inset: 0; z-index: 29; background: var(--scrim); }
}

/* Ekran dotykowy bez myszy: bez podpowiedzi klawiszowych (paleta, menu, wyszukiwarka, skrzynka) */
@media (hover: none), (pointer: coarse) {
  .kbd, .kbd-hint, .cmd__f, .top__help { display: none !important; }
  .keys .kbd { display: inline-grid !important; }
  .cm__cp { opacity: .8; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ── Druk oferty ──────────────────────────────────────────────────── */
.print-root { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { height: auto; overflow: visible; background: #fff !important; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .print-root .paper { max-width: none; padding: 0; box-shadow: none; border-radius: 0; }
}

/* Gdy otwarte jest okno lub arkusz, komunikaty idą na górę, żeby nie zasłaniały przycisków. */
.has-layer .toasts { top: 16px; bottom: auto; }
@media (max-width: 760px) { .has-layer .toasts { top: calc(10px + env(safe-area-inset-top)); bottom: auto; } }

/* Telefon i niskie ramki: lejek dostaje co najmniej 440 px wysokości, strona może się lekko przewinąć. */
@media (max-width: 760px) {
  .view[data-view="lejek"] { height: auto; min-height: 100%; }
  .view[data-view="lejek"] .hint-d { display: none; }
  .view[data-view="lejek"] .hint-m { display: inline; }
  .view[data-view="lejek"] .board { flex: none; height: max(440px, calc(100dvh - 330px)); }
}
.hint-m { display: none; }
