/* Brygada - design system (SPEC par. 2): tokeny, reset, typografia i komponenty wspolne (js/ui/*).
   Wlasciciel: Fundament. Ekrany fazy 2 maja wlasne pliki z prefiksami (db-, job-, tm-, wk-, ch-)
   i uzywaja wylacznie tokenow ponizej - bez kolorow wpisanych na sztywno. */

/* ===================== tokeny: jasny (domyslny) ===================== */
:root {
  color-scheme: light;
  --bg: #F3F2EE; --surface: #FFFFFF; --surface-2: #EBE9E3; --surface-3: #E0DDD5;
  --ink: #16181B; --ink-2: #3F444B; --muted: #6B7078; --line: #DDD9D0;
  --accent: #F2A900; --accent-ink: #16181B; --accent-soft: #FCEFC7; --accent-text: #8A5D00;
  --ok: #1E9E5A; --ok-soft: #DDF3E6; --warn: #D97A00; --warn-soft: #FBEBD3;
  --danger: #D3382A; --danger-soft: #FBE1DE; --info: #2F6FDB; --info-soft: #E2ECFB;
  --violet: #7A55D6; --violet-soft: #ECE5FB; --idle: #8A8F96; --idle-soft: #ECEBE7;
  /* pelne wypelnienia z bialym tekstem (kontrast) */
  --ok-solid: #1B8F51; --danger-solid: #D3382A; --info-solid: #2F6FDB; --violet-solid: #7A55D6; --idle-solid: #747980;
  --on-solid: #FFFFFF;
  --job-1: #E5A000; --job-1-soft: #FBEFCB; --job-2: #3B78E7; --job-2-soft: #E1EBFC;
  --job-3: #2E9D62; --job-3-soft: #DCF1E4; --job-4: #8A5CE0; --job-4-soft: #ECE4FB;
  --job-5: #159A9C; --job-5-soft: #D6F0F0; --job-6: #D6457A; --job-6-soft: #FAE0EA;
  --job-7: #E46A1E; --job-7-soft: #FCE6D7; --job-8: #5E6873; --job-8-soft: #E5E8EB;
  --inverse: #1E2125; --inverse-ink: #F2F0EB; --scrim: rgba(14, 15, 17, .5); --seg-active: #FFFFFF;
  --tape-a: #F2A900; --tape-b: #17191C; --demobar-bg: #17191C;
  --hairline: 0 0 0 1px rgba(22, 24, 27, .045);
  --shadow-1: 0 1px 2px rgba(22, 24, 27, .05), 0 3px 12px -4px rgba(22, 24, 27, .10);
  --shadow-2: 0 4px 12px -2px rgba(22, 24, 27, .10), 0 18px 36px -10px rgba(22, 24, 27, .24);
  --radius-s: 10px; --radius: 14px; --radius-m: 18px; --radius-l: 22px;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Barlow', 'Arial Narrow', sans-serif;
  --tap: 44px; --appbar-h: 56px; --nav-h: 64px; --demobar-h: 34px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  /* ton domyslny (nadpisuja klasy .tone-*) */
  --t: var(--muted); --t-soft: var(--surface-2); --t-solid: var(--ink-2); --t-on: var(--surface); --t-ink: var(--ink-2);
}

/* ===================== tokeny: ciemny ===================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101214; --surface: #191C1F; --surface-2: #212529; --surface-3: #2A2F34;
    --ink: #F2F0EB; --ink-2: #C9CCD0; --muted: #949AA1; --line: #2C3136;
    --accent: #FFB81C; --accent-ink: #16181B; --accent-soft: #3A2F12; --accent-text: #FFC94D;
    --ok: #3CC27A; --ok-soft: #16301F; --warn: #F0A53A; --warn-soft: #3A2A12;
    --danger: #F0675A; --danger-soft: #3D1C19; --info: #6EA0F5; --info-soft: #18263D;
    --violet: #A88BF0; --violet-soft: #271F3D; --idle: #7E858C; --idle-soft: #24282C;
    --ok-solid: #1F9A58; --danger-solid: #D9443A; --info-solid: #3B7BE6; --violet-solid: #7D5BDB; --idle-solid: #5F666D;
    --job-1: #F2B735; --job-1-soft: #3A2F12; --job-2: #6E9EF2; --job-2-soft: #18263D;
    --job-3: #4CC283; --job-3-soft: #16301F; --job-4: #A88AF0; --job-4-soft: #271F3D;
    --job-5: #3CC2C4; --job-5-soft: #123134; --job-6: #EE6E9C; --job-6-soft: #3A1A27;
    --job-7: #F28A4A; --job-7-soft: #3A2416; --job-8: #8C97A3; --job-8-soft: #262B31;
    --inverse: #2B3036; --inverse-ink: #F2F0EB; --scrim: rgba(0, 0, 0, .62); --seg-active: #363C42;
    --hairline: 0 0 0 1px rgba(255, 255, 255, .055);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px -6px rgba(0, 0, 0, .55);
    --shadow-2: 0 6px 16px -4px rgba(0, 0, 0, .55), 0 22px 44px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101214; --surface: #191C1F; --surface-2: #212529; --surface-3: #2A2F34;
  --ink: #F2F0EB; --ink-2: #C9CCD0; --muted: #949AA1; --line: #2C3136;
  --accent: #FFB81C; --accent-ink: #16181B; --accent-soft: #3A2F12; --accent-text: #FFC94D;
  --ok: #3CC27A; --ok-soft: #16301F; --warn: #F0A53A; --warn-soft: #3A2A12;
  --danger: #F0675A; --danger-soft: #3D1C19; --info: #6EA0F5; --info-soft: #18263D;
  --violet: #A88BF0; --violet-soft: #271F3D; --idle: #7E858C; --idle-soft: #24282C;
  --ok-solid: #1F9A58; --danger-solid: #D9443A; --info-solid: #3B7BE6; --violet-solid: #7D5BDB; --idle-solid: #5F666D;
  --job-1: #F2B735; --job-1-soft: #3A2F12; --job-2: #6E9EF2; --job-2-soft: #18263D;
  --job-3: #4CC283; --job-3-soft: #16301F; --job-4: #A88AF0; --job-4-soft: #271F3D;
  --job-5: #3CC2C4; --job-5-soft: #123134; --job-6: #EE6E9C; --job-6-soft: #3A1A27;
  --job-7: #F28A4A; --job-7-soft: #3A2416; --job-8: #8C97A3; --job-8-soft: #262B31;
  --inverse: #2B3036; --inverse-ink: #F2F0EB; --scrim: rgba(0, 0, 0, .62); --seg-active: #363C42;
  --hairline: 0 0 0 1px rgba(255, 255, 255, .055);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px -6px rgba(0, 0, 0, .55);
  --shadow-2: 0 6px 16px -4px rgba(0, 0, 0, .55), 0 22px 44px -12px rgba(0, 0, 0, .7);
}

/* ===================== tony (.tone-*) i kolory zlecen (.jc-N) ===================== */
[class*="tone-"] { --t-ink: color-mix(in srgb, var(--t) 68%, var(--ink)); }
.tone-ok { --t: var(--ok); --t-soft: var(--ok-soft); --t-solid: var(--ok-solid); --t-on: var(--on-solid); }
.tone-warn { --t: var(--warn); --t-soft: var(--warn-soft); --t-solid: var(--warn); --t-on: var(--accent-ink); }
.tone-danger { --t: var(--danger); --t-soft: var(--danger-soft); --t-solid: var(--danger-solid); --t-on: var(--on-solid); }
.tone-info { --t: var(--info); --t-soft: var(--info-soft); --t-solid: var(--info-solid); --t-on: var(--on-solid); }
.tone-violet { --t: var(--violet); --t-soft: var(--violet-soft); --t-solid: var(--violet-solid); --t-on: var(--on-solid); }
.tone-idle { --t: var(--idle); --t-soft: var(--idle-soft); --t-solid: var(--idle-solid); --t-on: var(--on-solid); }
.tone-accent { --t: var(--accent); --t-soft: var(--accent-soft); --t-solid: var(--accent); --t-on: var(--accent-ink); --t-ink: var(--accent-text); }
.tone-neutral { --t: var(--muted); --t-soft: var(--surface-2); --t-solid: var(--ink-2); --t-on: var(--surface); --t-ink: var(--ink-2); }

.jc-1 { --jc: var(--job-1); --jc-soft: var(--job-1-soft); }
.jc-2 { --jc: var(--job-2); --jc-soft: var(--job-2-soft); }
.jc-3 { --jc: var(--job-3); --jc-soft: var(--job-3-soft); }
.jc-4 { --jc: var(--job-4); --jc-soft: var(--job-4-soft); }
.jc-5 { --jc: var(--job-5); --jc-soft: var(--job-5-soft); }
.jc-6 { --jc: var(--job-6); --jc-soft: var(--job-6-soft); }
.jc-7 { --jc: var(--job-7); --jc-soft: var(--job-7-soft); }
.jc-8 { --jc: var(--job-8); --jc-soft: var(--job-8-soft); }

/* ===================== reset i typografia ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-body); font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
:where(ul[class], ol[class]) { margin: 0; padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
b, strong { font-weight: 700; }
small { font-size: 13px; }
code { padding: 1px 5px; border-radius: 6px; background: var(--surface-2); font: 500 .88em/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; overflow-wrap: anywhere; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 80%, transparent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.icon { display: inline-block; flex: none; vertical-align: middle; }
.icon-fill { fill: currentColor; }
.brand-mark { display: block; flex: none; }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
img.is-broken, img.is-missing, video.is-missing { display: none; }

/* ===================== przyciski ===================== */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0; min-height: 48px; padding: 0 18px; border: 0; border-radius: var(--radius);
  font: 600 16px/1.15 var(--font-body); letter-spacing: .005em; text-align: center; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color .15s, box-shadow .15s, transform .12s, filter .15s, opacity .15s;
}
.btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px -10px rgba(140, 92, 0, .9);
}
.btn-primary:active { filter: brightness(.95); }
.btn-secondary { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-secondary:active { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:active { background: var(--surface-2); }
.btn-danger { background: var(--danger-solid); color: var(--on-solid); }
.btn-ok { background: var(--ok-solid); color: var(--on-solid); }
.btn-danger:active, .btn-ok:active { filter: brightness(.94); }
@media (hover: hover) {
  .btn-primary:hover { filter: brightness(1.04); }
  .btn-secondary:hover { background: var(--surface-3); }
  .btn-ghost:hover { background: var(--surface-2); }
}
.btn-sm { min-height: 36px; padding: 0 12px; gap: 6px; border-radius: var(--radius-s); font-size: 14.5px; }
.btn-sm::after { content: ''; position: absolute; inset: -4px 0; }
.btn-lg { min-height: 56px; padding: 0 22px; border-radius: 16px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 48px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn-lg.btn-icon { width: 56px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; box-shadow: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .icon { animation: spin .9s linear infinite; }

.icon-btn {
  position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: 50%; color: var(--ink-2);
  transition: background-color .15s, color .15s;
}
.icon-btn:active { background: var(--surface-3); }
@media (hover: hover) { .icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); } }
.icon-btn .badge { position: absolute; top: 4px; right: 1px; box-shadow: 0 0 0 2px var(--badge-ring, var(--bg)); }

/* duzy przycisk START / KONIEC */
.btn-action {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px;
  padding: 14px 20px 14px 14px; border: 0; border-radius: var(--radius-l);
  background: var(--t-solid); color: var(--t-on); text-align: left; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 14px 30px -16px var(--t-solid);
  transition: transform .12s, filter .15s, opacity .15s;
}
.btn-action:active { transform: scale(.985); filter: brightness(.95); }
.btn-action-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 54px; height: 54px;
  border-radius: 50%; background: color-mix(in srgb, var(--t-on) 16%, transparent);
}
.btn-action-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.btn-action-label { font: 700 26px/1.02 var(--font-display); letter-spacing: .03em; text-transform: uppercase; }
.btn-action-sub { font-size: 14px; font-weight: 500; line-height: 1.3; opacity: .86; }
.btn-action:disabled { opacity: .55; cursor: default; filter: saturate(.6); }
.btn-action.is-busy { opacity: .85; pointer-events: none; }

/* ===================== znaczki, chipy ===================== */
.badge {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--t-solid); color: var(--t-on);
  font: 700 11px/1 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.chip {
  display: inline-flex; flex: none; align-items: center; gap: 5px; max-width: 100%; height: 28px; padding: 0 10px;
  border-radius: 99px; background: var(--t-soft); color: var(--t-ink);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
}
.chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip > .icon { color: var(--t); }
.chip-sm { height: 22px; padding: 0 8px; gap: 4px; font-size: 12px; }
.chip-lg { height: 34px; padding: 0 13px; gap: 6px; font-size: 14px; }
.chip-solid { background: var(--t-solid); color: var(--t-on); }
.chip-solid > .icon { color: inherit; }
.chip-muted { background: var(--surface-2); color: var(--muted); }
.chip-muted > .icon { color: var(--muted); }
.chip-extra { font-weight: 500; opacity: .85; }
.chip-job { background: var(--jc-soft); color: color-mix(in srgb, var(--jc) 60%, var(--ink)); }
.chip-job .job-dot { width: 8px; height: 8px; }
.chip-dark { background: rgba(255, 255, 255, .16); color: #FFFFFF; }
.chip-dark > .icon { color: inherit; }
.job-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--jc, var(--muted)); vertical-align: middle; }

/* ===================== avatary ===================== */
.avatar {
  --av: var(--job-8); --av-size: 40px; --dot: 12px; --dot-ring: 2px; --pm: 17px;
  position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: var(--av-size); height: var(--av-size); border-radius: 50%; vertical-align: middle;
  background: color-mix(in srgb, var(--av) 24%, var(--surface)); color: color-mix(in srgb, var(--av) 58%, var(--ink));
  font: 700 calc(var(--av-size) * .36)/1 var(--font-body); letter-spacing: .01em;
  user-select: none; -webkit-user-select: none;
}
.avatar[data-av="1"] { --av: var(--job-1); }
.avatar[data-av="2"] { --av: var(--job-2); }
.avatar[data-av="3"] { --av: var(--job-3); }
.avatar[data-av="4"] { --av: var(--job-4); }
.avatar[data-av="5"] { --av: var(--job-5); }
.avatar[data-av="6"] { --av: var(--job-6); }
.avatar[data-av="7"] { --av: var(--job-7); }
.avatar[data-av="8"] { --av: var(--job-8); }
.avatar-xs { --av-size: 22px; --dot: 7px; --dot-ring: 1.5px; --pm: 11px; }
.avatar-sm { --av-size: 32px; --dot: 10px; --pm: 15px; }
.avatar-md { --av-size: 40px; }
.avatar-lg { --av-size: 56px; --dot: 15px; --dot-ring: 2.5px; --pm: 20px; }
.avatar-xl { --av-size: 88px; --dot: 20px; --dot-ring: 3px; --pm: 26px; }
.avatar-xxl { --av-size: 120px; --dot: 24px; --dot-ring: 3px; --pm: 30px; }
.avatar-initials { pointer-events: none; }
.avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border-radius: 50%;
  object-fit: cover; background: var(--surface-2);
}
.avatar-img:not([src]) { visibility: hidden; }
.avatar-dot {
  position: absolute; right: calc(var(--av-size) * .1464 - var(--dot) / 2); bottom: calc(var(--av-size) * .1464 - var(--dot) / 2);
  width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--t);
  box-shadow: 0 0 0 var(--dot-ring) var(--av-ring, var(--surface));
}
.avatar-dot.is-muted { background: color-mix(in srgb, var(--t) 55%, var(--surface)); }
.avatar-problem {
  position: absolute; top: calc(var(--av-size) * .1464 - var(--pm) / 2); right: calc(var(--av-size) * .1464 - var(--pm) / 2);
  display: flex; align-items: center; justify-content: center; width: var(--pm); height: var(--pm);
  border-radius: 50%; background: var(--danger-solid); color: #FFFFFF;
  font: 700 calc(var(--pm) * .7)/1 var(--font-body); box-shadow: 0 0 0 2px var(--av-ring, var(--surface));
}
.avatar-ring { box-shadow: 0 0 0 2px var(--av-ring, var(--surface)); }
.avatar-stack { display: inline-flex; flex: none; align-items: center; }
.avatar-stack > .avatar + .avatar { margin-left: calc(var(--av-size) * -.28); }
.avatar-more { background: var(--surface-3); color: var(--ink-2); font-size: calc(var(--av-size) * .32); }

/* ===================== karty, listy, sekcje ===================== */
.card {
  position: relative; display: block; min-width: 0; border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink); box-shadow: var(--hairline), var(--shadow-1);
}
.card-pad { padding: 16px; }
.card.is-interactive { width: 100%; text-align: left; cursor: pointer; transition: transform .12s, background-color .15s; }
.card.is-interactive:active { transform: scale(.99); background: color-mix(in srgb, var(--surface) 93%, var(--ink)); }

.list {
  min-width: 0; overflow: hidden; border-radius: var(--radius-m);
  background: var(--surface); box-shadow: var(--hairline), var(--shadow-1);
}
.list-inset { overflow: visible; border-radius: 0; background: transparent; box-shadow: none; }
.list-item {
  --li-inset: 16px; position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
  min-height: 60px; padding: 10px 16px; background: transparent; color: var(--ink); text-align: left;
}
.list-item:has(> .li-leading) { --li-inset: 68px; }
.list-item + .list-item::before {
  content: ''; position: absolute; top: 0; right: 0; left: var(--li-inset); height: 1px; background: var(--line);
}
.list-inset > .list-item { padding-left: 4px; padding-right: 4px; }
.list-item.is-interactive { cursor: pointer; transition: background-color .15s; }
.list-item.is-interactive:active { background: var(--surface-2); }
@media (hover: hover) { .list-item.is-interactive:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); } }
.list-item.is-unread { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.list-item.is-unread .li-title { font-weight: 700; }
.list-item.is-unread::after {
  content: ''; position: absolute; top: 50%; left: 5px; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--accent);
}
.li-link { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; border-radius: inherit; }
.list-item.has-link .li-actions { position: relative; z-index: 1; }
.li-leading { display: flex; flex: none; align-items: center; }
.li-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.li-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.li-title { min-width: 0; overflow: hidden; font-size: 16px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.li-meta { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.li-sub { color: var(--muted); font-size: 14px; line-height: 1.38; overflow-wrap: anywhere; }
.li-trailing { display: flex; flex: none; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.li-actions { display: flex; flex: none; align-items: center; gap: 2px; margin-right: -8px; }
.li-chevron { display: flex; flex: none; margin-right: -6px; color: var(--muted); opacity: .75; }
.li-icon {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; background: var(--t-soft); color: var(--t-ink);
}

.section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 28px; }
.section-titles { min-width: 0; }
.section-title { color: var(--ink); font: 700 20px/1.15 var(--font-display); letter-spacing: .01em; }
.section-sub { margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.section-action {
  display: inline-flex; flex: none; align-items: center; gap: 2px; min-height: 36px; margin: -6px -8px -6px 0; padding: 0 6px 0 10px;
  border-radius: 10px; color: var(--accent-text); font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
.section-action:active { background: var(--accent-soft); }

.kv { display: flex; flex-direction: column; min-width: 0; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv dt { flex: none; max-width: 48%; color: var(--muted); font-size: 14.5px; }
.kv dd { min-width: 0; margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.card-pad > .kv:first-child { margin-top: -8px; }
.card-pad > .kv:last-child { margin-bottom: -8px; }

/* baner problemu (tasma ostrzegawcza po lewej) */
.banner {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
  padding: 14px 14px 14px 16px; overflow: hidden; border-radius: var(--radius-m);
  background: var(--t-soft); color: var(--ink); text-align: left;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 30%, transparent);
  transition: transform .12s;
}
a.banner:active, button.banner:active { transform: scale(.99); }
.banner.has-stripe { padding-left: 24px; }
.banner-stripe {
  position: absolute; top: 0; bottom: 0; left: 0; width: 9px;
  background: repeating-linear-gradient(-45deg, var(--tape-a) 0 7px, var(--tape-b) 7px 14px);
}
.banner-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 50%; background: var(--t-solid); color: var(--t-on);
}
.banner.tone-danger .banner-icon { animation: pulse-ring 2.4s ease-out infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--t) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--t) 0%, transparent); }
}
.banner-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.banner-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.banner-text { color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.banner-meta { color: var(--t-ink); font-size: 12.5px; font-weight: 600; }
.banner-chev { display: flex; flex: none; color: var(--t-ink); }

.day-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0 0;
  color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.day-header-extra { font-weight: 600; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }

/* ===================== KPI, postep ===================== */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 108px; padding: 14px;
  border-radius: var(--radius-m); background: var(--surface); color: var(--ink); text-align: left;
  box-shadow: var(--hairline), var(--shadow-1);
}
.kpi.is-interactive { cursor: pointer; transition: transform .12s; }
.kpi.is-interactive:active { transform: scale(.98); }
.kpi-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kpi-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 9px; background: var(--t-soft); color: var(--t-ink);
}
.kpi-label { min-width: 0; overflow: hidden; color: var(--muted); font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value {
  margin-top: auto; color: var(--ink); font: 700 clamp(26px, 8vw, 32px)/1.02 var(--font-display);
  font-variant-numeric: tabular-nums; letter-spacing: .005em; overflow-wrap: anywhere;
}
.kpi.tone-danger .kpi-value, .kpi.tone-warn .kpi-value { color: var(--t-ink); }
.kpi-sub { color: var(--muted); font-size: 12.5px; line-height: 1.3; }

.progress-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.progress-label > .tnum { color: var(--ink); }
.progress {
  position: relative; display: block; height: 8px; overflow: hidden; border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}
.progress-sm { height: 5px; }
.progress-lg { height: 12px; }
.progress-bar { display: block; height: 100%; border-radius: inherit; background: var(--t); transition: width .5s var(--ease); }

/* ===================== puste stany, szkielety, bledy ===================== */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; }
.empty-icon {
  display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 8px;
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
}
.empty-title { color: var(--ink); font: 700 21px/1.2 var(--font-display); }
.empty-text { max-width: 34ch; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.empty .btn { margin-top: 12px; }
.empty-compact { gap: 4px; padding: 18px 16px; }
.empty-compact .empty-icon { width: 44px; height: 44px; margin-bottom: 4px; }
.empty-compact .empty-title { font-size: 17px; }
.view-error { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8vh; }

.sk { display: flex; flex-direction: column; gap: 2px; }
.sk.sk-card { gap: 12px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.skeleton {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%) 0 0 / 300% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skeleton.sk-card { height: 96px; border-radius: var(--radius-m); }
.sk-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.sk-lines { display: flex; flex: 1; flex-direction: column; gap: 8px; }
.sk-line { height: 12px; }
.sk-short { width: 55%; }

/* tasma ostrzegawcza i znacznik DEMO */
.stripe { height: 8px; background: repeating-linear-gradient(-45deg, var(--tape-a) 0 10px, var(--tape-b) 10px 20px); }
.demo-tag {
  display: inline-flex; flex: none; padding: 3px; border-radius: 7px; vertical-align: middle;
  background: repeating-linear-gradient(-45deg, var(--tape-a) 0 5px, var(--tape-b) 5px 10px);
}
.demo-tag b {
  display: block; padding: 3px 5px 2px 7px; border-radius: 4px; background: var(--tape-b); color: #FFC53D;
  font: 700 12px/1 var(--font-display); letter-spacing: .14em;
}
.demo-tag-sm { padding: 2px; border-radius: 5px; }
.demo-tag-sm b { padding: 2px 4px 1px 5px; font-size: 10.5px; }

/* obowiazkowa stopka Code-Made */
.credit { padding: 28px 16px 6px; color: var(--muted); font-size: 12.5px; letter-spacing: .01em; text-align: center; }
.credit a {
  color: var(--ink-2); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--accent) 75%, transparent); text-underline-offset: 3px;
}

/* ===================== segmenty, zakladki, filtry ===================== */
.segmented {
  display: inline-flex; gap: 2px; max-width: 100%; padding: 3px; border-radius: 12px;
  background: var(--surface-2); vertical-align: middle;
}
.segmented-block { display: flex; width: 100%; }
.seg {
  position: relative; display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; min-height: 38px; padding: 0 12px; border-radius: 9px; color: var(--ink-2);
  font-size: 14.5px; font-weight: 600; line-height: 1.1; white-space: nowrap; cursor: pointer;
  user-select: none; -webkit-user-select: none; transition: background-color .18s, color .18s, box-shadow .18s;
}
.seg > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.segmented:not(.segmented-block) .seg { flex: none; }
.seg.is-active, .segmented-radio .seg:has(input:checked) {
  background: var(--seg-active); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px -3px rgba(0, 0, 0, .18);
}
.seg .badge { margin-left: 2px; }
.segmented-sm .seg { min-height: 32px; padding: 0 10px; font-size: 13.5px; }
.segmented-lg .seg { min-height: 46px; font-size: 15.5px; border-radius: 10px; }
.segmented-radio input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-radio .seg:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 80%, transparent); outline-offset: 1px; }

.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 8px);
  overflow-x: auto; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 46px; padding: 0 10px;
  color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; transition: color .15s;
}
.tab.is-active { color: var(--ink); }
.tab.is-active::after {
  content: ''; position: absolute; right: 8px; bottom: 0; left: 8px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent);
}

.filter-chips {
  display: flex; gap: 8px; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.filter-chips::-webkit-scrollbar { display: none; }
.fchip {
  position: relative; display: inline-flex; flex: none; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 99px; background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: background-color .15s, color .15s;
}
.fchip::after { content: ''; position: absolute; inset: -4px 0; }
.fchip.is-active { background: var(--ink); color: var(--bg); box-shadow: none; }
.fchip-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 12px; font-variant-numeric: tabular-nums;
}

/* ===================== formularze ===================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.field-req { color: var(--danger); }
.field-hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.4; }
.input {
  display: block; width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px;
  border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--ink);
  font: 400 16px/1.35 var(--font-body); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.input:disabled { opacity: .6; }
.input.is-invalid, .input[aria-invalid="true"], .has-error .input {
  border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input.input[type="date"], input.input[type="time"] { min-height: 48px; }
.select-wrap { position: relative; display: block; }
.select { padding-right: 42px; cursor: pointer; }
.select-chev { position: absolute; top: 50%; right: 13px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.input-group {
  display: flex; align-items: stretch; min-width: 0; border: 1px solid transparent; border-radius: 12px;
  background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input-group:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.input-group > .input { flex: 1 1 auto; border: 0; background: transparent; box-shadow: none; }
.input-affix { display: flex; flex: none; align-items: center; padding: 0 12px; color: var(--muted); font-size: 15px; font-weight: 600; }
.input-group > .input-affix:first-child { padding-right: 0; }
.input-group > .input + .input-affix { padding-left: 0; }

.range {
  --val: 50%; display: block; width: 100%; height: 36px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--val), color-mix(in srgb, var(--ink) 12%, transparent) var(--val));
}
.range::-webkit-slider-thumb {
  width: 28px; height: 28px; margin-top: -10px; border: 3px solid var(--accent); border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); -webkit-appearance: none; appearance: none;
  transition: box-shadow .15s;
}
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent), 0 2px 6px rgba(0, 0, 0, .25); }
.range::-moz-range-track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--accent); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid var(--accent); border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

.switch-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; cursor: pointer; }
.switch-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--surface-2); color: var(--ink-2);
}
.switch-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.switch-label { font-size: 16px; font-weight: 500; line-height: 1.3; }
.switch-hint { color: var(--muted); font-size: 13px; line-height: 1.35; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0; border-radius: 99px; background: color-mix(in srgb, var(--ink) 16%, var(--surface-2));
  transition: background-color .2s;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s var(--ease);
}
.switch input:checked + .switch-track { background: var(--ok-solid); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid color-mix(in srgb, var(--accent) 80%, transparent); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled + .switch-track { opacity: .5; }

.search {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 14px;
  background: var(--surface); color: var(--muted); box-shadow: var(--hairline), var(--shadow-1); cursor: text;
}
.search:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); }
.search-icon { display: flex; flex: none; }
.search-input {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink);
  font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--muted); }
.search-input::-webkit-search-decoration { -webkit-appearance: none; }

.check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.check a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.form-error {
  padding: 10px 12px; border-radius: 12px; background: var(--danger-soft);
  color: color-mix(in srgb, var(--danger) 70%, var(--ink)); font-size: 14px; font-weight: 600; line-height: 1.4;
}

/* ===================== multimedia ===================== */
.media-thumb {
  position: relative; display: inline-flex; flex: none; overflow: hidden; width: 76px; height: 76px; padding: 0;
  border: 0; border-radius: 12px; background: var(--surface-2); color: var(--muted); cursor: pointer;
  vertical-align: middle; transition: transform .12s, filter .15s;
}
.media-thumb:active { transform: scale(.97); filter: brightness(.94); }
.media-thumb.size-sm { width: 56px; height: 56px; border-radius: 10px; }
.media-thumb.size-md { width: 76px; height: 76px; }
.media-thumb.size-lg { width: 104px; height: 104px; border-radius: 14px; }
.media-thumb.size-fill { width: 100%; height: auto; aspect-ratio: 1; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.media-thumb img:not([src]) { visibility: hidden; }
.media-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.media-thumb.is-video::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .38), transparent 55%);
}
.media-badge {
  position: absolute; left: 6px; bottom: 6px; z-index: 1; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px 2px 5px; border-radius: 99px; background: rgba(10, 11, 13, .62); color: #FFFFFF;
  font-size: 11px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums;
}
.media-thumb-voice { background: var(--accent-soft); color: var(--accent-text); }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.media-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.media-grid .media-thumb { border-radius: 10px; }
.media-strip {
  display: flex; gap: 8px; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
}
.media-strip::-webkit-scrollbar { display: none; }
.media-strip > .media-thumb { scroll-snap-align: start; }

/* odtwarzacz glosowki (--p: postep 0..1 ustawia voice.js) */
.voice-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.voice {
  --p: 0; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 14px 8px 8px;
  border-radius: var(--radius-m); background: var(--voice-bg, var(--surface-2));
}
.voice-btn {
  display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); transition: transform .12s;
}
.voice-btn:active { transform: scale(.94); }
.voice-btn .voice-ico-play { margin-left: 2px; }
.voice-btn .voice-ico-pause { display: none; }
.voice.is-playing .voice-ico-play, .voice-btn.is-playing .voice-ico-play { display: none; }
.voice.is-playing .voice-ico-pause, .voice-btn.is-playing .voice-ico-pause { display: inline-block; }
.voice-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.voice-wave { position: relative; display: block; height: 28px; }
.voice-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.voice-bars i { flex: 1 1 0; min-width: 2px; height: calc(var(--h, .5) * 100%); min-height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 26%, transparent); }
.voice-bars-fill { clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0); }
.voice-bars-fill i { background: var(--accent); }
.voice-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.voice-time { font-weight: 600; }
.voice-tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 11px; font-weight: 600;
}
.voice-compact { gap: 10px; padding: 5px 12px 5px 5px; }
.voice-compact .voice-btn { width: 36px; height: 36px; }
.voice-compact .voice-wave { height: 22px; }
.voice-transcript { min-width: 0; }
.voice-transcript summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 6px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; user-select: none;
}
.voice-transcript summary::-webkit-details-marker { display: none; }
.voice-chev { transition: transform .2s; }
.voice-transcript[open] .voice-chev { transform: rotate(180deg); }
.voice-transcript p {
  margin-top: 2px; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 4px 12px 12px 4px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent); color: var(--ink-2);
  font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line;
}

/* nagrywarka glosu (arkusz) - stany: init | rec | review | saving | error */
.rec { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding-top: 4px; }
.rec-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--idle); }
.rec[data-state="rec"] .rec-dot { background: var(--danger); animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .35; transform: scale(.8); } }
.rec-timer { font: 700 44px/1 var(--font-display); letter-spacing: .02em; }
.rec-status { flex-basis: 100%; color: var(--muted); font-size: 14px; text-align: center; }
.rec-meter { display: flex; align-items: center; justify-content: center; gap: 3px; height: 56px; }
.rec-meter i {
  width: 4px; height: calc(var(--h, .08) * 100%); min-height: 4px; border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 22%, transparent); transition: height .09s linear;
}
.rec[data-state="rec"] .rec-meter i { background: var(--accent); }
.rec-live { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.rec-live-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.rec-live-text { min-height: 46px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.rec-final { color: var(--ink); }
.rec-interim { color: var(--muted); font-style: italic; }
.rec-ph { color: var(--muted); }
.rec-review { display: none; flex-direction: column; gap: 14px; }
.rec-player { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: var(--radius-m); background: var(--surface-2); }
.rec-player-bar { position: relative; flex: 1 1 auto; height: 6px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.rec-player-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }
.rec-player-time { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.rec-note { padding: 9px 12px; border-radius: 12px; background: var(--info-soft); color: var(--ink-2); font-size: 13.5px; line-height: 1.4; text-align: center; }
.rec-error { display: none; flex-direction: column; align-items: center; gap: 10px; padding: 12px 8px; text-align: center; }
.rec-error-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); }
.rec-error-text { max-width: 34ch; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.rec[data-state="review"] .rec-review, .rec[data-state="saving"] .rec-review { display: flex; }
.rec[data-state="review"] .rec-meter, .rec[data-state="saving"] .rec-meter,
.rec[data-state="review"] .rec-live, .rec[data-state="saving"] .rec-live { display: none; }
.rec[data-state="error"] .rec-error { display: flex; }
.rec[data-state="error"] .rec-head, .rec[data-state="error"] .rec-meter, .rec[data-state="error"] .rec-live { display: none; }

/* ===================== arkusze (bottom sheet) - montowane w #overlay ===================== */
.sheet-layer { position: absolute; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .28s ease; }
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; right: 0; bottom: 0; left: 0; z-index: 51; display: flex; flex-direction: column;
  width: 100%; max-width: 640px; max-height: calc(100% - var(--safe-t) - 20px); margin: 0 auto;
  padding-bottom: var(--safe-b); border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink);
  box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, .35); outline: none;
  transform: translateY(105%); transition: transform .34s var(--ease); will-change: transform;
}
.sheet-layer.is-open .sheet { transform: translateY(0); }
.sheet-layer.is-closing .sheet { transition-duration: .24s; transition-timing-function: var(--ease-in); }
.sheet.is-dragging { transition: none; }
.sheet-full { height: calc(100% - var(--safe-t) - 12px); max-height: none; }
.sheet-grab { display: flex; flex: none; justify-content: center; padding: 8px 0 2px; cursor: grab; touch-action: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.sheet-head { display: flex; flex: none; align-items: center; gap: 8px; min-height: 52px; padding: 2px 10px 4px 20px; touch-action: none; }
.sheet-head.is-empty { position: absolute; top: 6px; right: 10px; z-index: 2; min-height: 0; padding: 0; }
.sheet-head.is-empty .sheet-title { display: none; }
.sheet-title { flex: 1 1 auto; min-width: 0; font: 700 22px/1.15 var(--font-display); letter-spacing: .01em; overflow-wrap: anywhere; }
.sheet-close { width: 40px; height: 40px; background: var(--surface-2); color: var(--ink-2); }
.sheet-close::after { content: ''; position: absolute; inset: -4px; }
.sheet-body {
  --gutter: 20px; display: flex; flex: 1 1 auto; flex-direction: column; gap: 16px; min-height: 0; padding: 4px var(--gutter) 20px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.sheet-body > * + .section { margin-top: 6px; }
.sheet-body .tabs { position: static; background: var(--surface); }
.sheet-foot {
  display: flex; flex: none; flex-wrap: wrap; gap: 10px; padding: 12px 20px 14px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.sheet-foot > .btn { flex: 1 1 0; }
.sheet-foot > .btn-block { flex-basis: 100%; }
.sheet-text { color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
.sheet-text a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sheet-hero-icon {
  display: flex; flex: none; align-items: center; justify-content: center; align-self: center; width: 60px; height: 60px;
  margin-top: 4px; border-radius: 50%; background: var(--t-soft); color: var(--t-ink);
}
.sheet-confirm .sheet-body { align-items: center; text-align: center; }
.sheet-confirm .sheet-foot { border-top: 0; padding-top: 4px; }

.action-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.action-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 8px; border-radius: 14px;
  color: var(--ink); font-size: 16px; font-weight: 600; text-align: left; transition: background-color .15s;
}
.action-item:active { background: var(--surface-2); }
@media (hover: hover) { .action-item:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); } }
.action-item:disabled { opacity: .45; }
.action-item.tone-danger .action-label { color: var(--t-ink); }
.action-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 12px; background: var(--t-soft); color: var(--t-ink);
}
.action-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.action-sub { color: var(--muted); font-size: 13.5px; font-weight: 400; line-height: 1.35; }

.picker { display: flex; flex-direction: column; gap: 10px; }
.picker-opt {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 70px; padding: 12px 14px;
  border-radius: 16px; background: var(--surface-2); cursor: pointer; transition: background-color .15s, transform .12s;
}
.picker-opt:active { transform: scale(.99); background: var(--surface-3); }
.picker-opt:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); }
.picker-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px;
  border-radius: 14px; background: var(--t-solid); color: var(--t-on);
}
.picker-icon.tone-neutral { background: var(--surface); color: var(--ink-2); }
.picker-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.picker-label { font-size: 16.5px; font-weight: 600; }
.picker-desc { color: var(--muted); font-size: 13.5px; }
.picker-chev { color: var(--muted); }

/* ===================== toasty ===================== */
.toast-stack { position: absolute; right: 0; left: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.toast-stack.is-top { top: calc(var(--safe-t) + 8px); }
.toast-stack.is-bottom { bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
.toast {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 440px; min-height: 52px;
  padding: 10px 14px 10px 12px; overflow: hidden; border-radius: 16px; pointer-events: auto; touch-action: pan-y;
  box-shadow: var(--shadow-2); opacity: 0; transform: translateY(14px) scale(.97);
  transition: transform .28s var(--ease), opacity .2s ease;
}
.toast.is-bottom { background: var(--inverse); color: var(--inverse-ink); }
.toast.is-top { background: var(--surface); color: var(--ink); box-shadow: var(--hairline), var(--shadow-2); transform: translateY(-14px) scale(.97); }
.toast.is-top:not(.tone-neutral)::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--t); }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateY(8px) scale(.97); }
.toast.is-top.is-out { transform: translateY(-10px) scale(.97); }
.toast.is-link { cursor: pointer; }
.toast-lead { display: flex; flex: none; }
.toast-icon {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: color-mix(in srgb, var(--t) 20%, transparent); color: var(--t);
}
.toast.tone-neutral .toast-icon { background: color-mix(in srgb, currentColor 12%, transparent); color: inherit; }
.toast-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.toast-title { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.toast-text { font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.toast.has-title .toast-text { font-size: 14px; opacity: .85; }
.toast-action {
  flex: none; min-height: 40px; margin: -6px -6px -6px 0; padding: 0 10px; border-radius: 10px;
  color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.toast.is-top .toast-action { color: var(--accent-text); }
.toast-chev { display: flex; flex: none; color: var(--muted); }
.toast .avatar { --av-ring: var(--surface); }

/* ===================== podglad mediow ===================== */
.viewer {
  position: absolute; inset: 0; z-index: 60; overflow: hidden; color: #FFFFFF;
  background: rgb(0 0 0 / calc(var(--fade, 1) * 100%)); opacity: 0; transition: opacity .22s ease;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.viewer.is-open { opacity: 1; }
.viewer.is-closing { opacity: 0; }
.viewer-stage { position: absolute; inset: 0; transform: translateY(var(--drag, 0px)); transition: transform .25s var(--ease); }
.viewer.is-dragging .viewer-stage { transition: none; }
.viewer-track { display: flex; height: 100%; transition: transform .32s var(--ease); will-change: transform; }
.viewer-slide { display: flex; flex: 0 0 100%; align-items: center; justify-content: center; min-width: 0; height: 100%; overflow: hidden; }
.viewer-img, .viewer-video { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; -webkit-touch-callout: none; }
.viewer-video { width: 100%; background: #000000; }
.viewer-voice { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 380px; padding: 24px; }
.viewer-voice .avatar { --av-ring: #000000; }
.viewer-voice-name { font-size: 18px; font-weight: 600; }
.viewer-voice .voice-wrap { width: 100%; }
.viewer-voice .voice { --voice-bg: rgba(255, 255, 255, .1); --ink: #FFFFFF; }
.viewer-voice .voice-meta, .viewer-voice .voice-transcript summary { color: rgba(255, 255, 255, .72); }
.viewer-voice .voice-transcript p { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .92); }
.viewer-top {
  position: absolute; top: 0; right: 0; left: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 8px) 12px 28px; background: linear-gradient(rgba(0, 0, 0, .62), transparent);
  transition: opacity .2s;
}
.viewer-btn {
  display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255, 255, 255, .14); color: #FFFFFF;
}
.viewer-btn:active { background: rgba(255, 255, 255, .26); }
.viewer-who { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; }
.viewer-who .avatar { --av-ring: transparent; }
.viewer-who-text { display: flex; flex-direction: column; min-width: 0; }
.viewer-who-name { overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.viewer-who-time { font-size: 12.5px; opacity: .75; }
.viewer-count { flex: none; padding-right: 4px; font-size: 14px; font-weight: 600; opacity: .85; }
.viewer-bottom {
  position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px;
  padding: 36px 16px calc(var(--safe-b) + 16px); background: linear-gradient(transparent, rgba(0, 0, 0, .68));
  pointer-events: none; transition: opacity .2s;
}
.viewer:not(.has-caption) .viewer-bottom { display: none; }
.viewer-caption { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.viewer-caption:empty { display: none; }
.viewer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer-nav {
  position: absolute; top: 50%; z-index: 2; display: none; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #FFFFFF;
}
.viewer-nav.is-prev { left: 12px; }
.viewer-nav.is-next { right: 12px; }
.viewer-nav:disabled { opacity: .3; }
@media (hover: hover) and (pointer: fine) { .viewer-nav { display: flex; } .viewer-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .26); } }
.viewer.is-dragging .viewer-top, .viewer.is-dragging .viewer-bottom, .viewer.is-dragging .viewer-nav { opacity: 0; }

/* ===================== arkusze demo: przewodnik, powitanie, kontakt ===================== */
.demo-hero { display: flex; align-items: center; gap: 14px; padding-top: 2px; }
.demo-hero .brand-mark { filter: drop-shadow(0 5px 10px rgba(242, 159, 5, .26)); }
.demo-hero-text { min-width: 0; }
.demo-hero-title { display: flex; align-items: center; gap: 10px; font: 700 30px/1 var(--font-display); }
.demo-hero-sub { margin-top: 4px; color: var(--muted); font-size: 14.5px; }
.demo-about { display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.demo-about b { color: var(--ink); }
.sheet-demo .section .card { background: var(--surface-2); box-shadow: none; }

.guide { display: flex; flex-direction: column; gap: 12px; }
.guide-list { display: flex; flex-direction: column; gap: 6px; }
.guide-step {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px;
  border-radius: var(--radius); background: var(--surface-2); color: var(--ink); text-align: left;
  transition: background-color .15s, transform .12s;
}
.guide-step:active { transform: scale(.99); background: var(--surface-3); }
@media (hover: hover) { .guide-step:hover { background: var(--surface-3); } }
.guide-check {
  display: flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); color: var(--accent-text); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent);
}
.guide-step.is-done .guide-check { background: var(--ok-solid); color: #FFFFFF; box-shadow: none; }
.guide-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 1px; min-width: 0; }
.guide-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.guide-hint { color: var(--muted); font-size: 13px; line-height: 1.3; }
.guide-step.is-done .guide-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent); }
.guide-step.is-done .guide-hint { color: color-mix(in srgb, var(--ok) 72%, var(--ink)); font-weight: 600; }
.guide-chev { flex: none; color: var(--muted); }
.guide-compact .guide-step { min-height: 54px; padding: 8px 10px; }

.sheet-welcome .sheet-body { padding-top: 6px; }
.welcome { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.welcome-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 2px; }
.welcome-brand .brand-mark { filter: drop-shadow(0 8px 14px rgba(242, 159, 5, .3)); }
.welcome-title { margin-top: 2px; font: 700 34px/1.02 var(--font-display); }
.welcome-sub { max-width: 34ch; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
.welcome-feats { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 8px; text-align: left; }
.welcome-feats li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); }
.welcome-feats b { display: block; font-size: 15px; line-height: 1.25; }
.welcome-feats small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }
.welcome-feat-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent-text);
}
.welcome-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; text-align: left; }
.welcome-note .icon { margin-top: 2px; }

.congrats { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0; text-align: center; }
.congrats-icon {
  display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin: 6px 0 8px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 8px var(--accent-soft);
}
.congrats-title { font: 700 27px/1.1 var(--font-display); }
.congrats-text { max-width: 36ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 0 8px; text-align: center; }
.contact-done-icon {
  display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 6px;
  border-radius: 50%; background: var(--ok-soft); color: var(--ok);
}
.contact-done h3 { font: 700 27px/1.1 var(--font-display); }
.contact-done p { max-width: 32ch; color: var(--ink-2); line-height: 1.5; }
.pick-check { display: flex; color: var(--ok); }

/* ===================== zaslepki ekranow (faza 1) ===================== */
.ph { display: flex; flex-direction: column; gap: 16px; }
.ph-card { overflow: hidden; }
.ph-stripe { height: 6px; }
.ph-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 4px; }
.ph-icon {
  display: flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px;
  border-radius: 14px; background: var(--accent-soft); color: var(--accent-text);
}
.ph-kicker { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ph-title { margin-top: 2px; font: 700 24px/1.1 var(--font-display); }
.ph-lead { padding: 10px 16px 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.ph-list { padding: 6px 16px 16px; }
.ph-list li { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.4; }
.ph-list li .icon { margin-top: 2px; color: var(--ok); }
.ph-actions { margin-top: 4px; }
.ph-desc { margin-top: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.ph-person { display: flex; align-items: center; gap: 16px; padding: 4px 0 6px; }
.ph-person-name { font: 700 26px/1.1 var(--font-display); }
.ph-person-sub { margin: 2px 0 8px; color: var(--muted); font-size: 14px; }
.ph-progress { margin-top: 8px; }

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