/* Intecom - Zadania (od 0.9.0). Tokeny i klasy skopiowane z Hegios (app.html, DESIGN.md): system h-* na zmiennych
   --h-*, twarde kąty, paleta chłodna. Bez czcionek z sieci (fonty systemowe), bez ciemnego motywu, bez starych klas.
   Zadania (.tz-*, .tk-*, .tkm-*) jak w Hegios, bez osób, kalendarza i "nowych". Wąsko: poniżej 900 px menu projektów
   to przewijany pasek, a nawigacja Zadania | Notatnik stoi na dole; poniżej 760 px okno zadania na cały ekran, pola
   z boku (termin, etap, priorytet, projekt) pod tytułem i opisem, tablica przewija się w bok. */


/* -- podstawy -- */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    font-family: var(--h-font-ui); background: var(--h-bg); color: var(--h-text);
    height: 100vh; height: 100dvh; overflow: hidden;
    font-size: var(--h-fs-14); line-height: var(--h-lh-base);
    -webkit-text-size-adjust: 100%;
}
:where(a:any-link) { color: var(--h-accent); }
:where(input,textarea)::placeholder { color: var(--h-text-muted); opacity: 1; }
:where(button,input,select,textarea,img) { border-radius: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.h-text-muted { color: var(--h-text-muted); }
.h-num { font-family: var(--h-font-mono); font-feature-settings: 'tnum'; }

/* -- powłoka: siatka (pasek, menu, treść); wygląd paska i menu w ../nawigacja.css -- */
.topbar { grid-column: 1 / 3; }
.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.content { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 24px 32px; min-width: 0; }
.content-in { max-width: 1120px; }

/* -- baner "Bez sieci" nad treścią -- */
.h-alert {
    padding: 10px 14px; border: 1px solid; font-size: var(--h-fs-13); line-height: var(--h-lh-base);
    display: flex; gap: 10px; align-items: center; color: var(--h-text); flex-wrap: wrap;
}
.h-alert-warning { background: var(--h-warning-bg); border-color: var(--h-warning); }
.h-alert-info { background: var(--h-info-bg); border-color: var(--h-border-strong); }
.h-alert-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--h-warning); fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.h-alert-content { flex: 1; min-width: 0; }
.crm-baner { margin-bottom: var(--h-sp-3); }

/* -- przyciski -- */
.h-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: var(--h-btn-pad);
    border: 1px solid transparent; font-size: var(--h-fs-14); font-weight: var(--h-fw-med); line-height: 1;
    cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; white-space: nowrap; background: none;
}
.h-btn:disabled { opacity: .5; cursor: not-allowed; }
.h-btn-primary { background: var(--h-text); color: #fff; }
.h-btn-primary:hover:not(:disabled) { background: #000; }
.h-btn-secondary { background: var(--h-surface); color: var(--h-text); border-color: var(--h-border-strong); }
.h-btn-secondary:hover:not(:disabled) { background: var(--h-bg); }
.h-btn-accent { background: var(--h-accent); color: #fff; }
.h-btn-accent:hover:not(:disabled) { background: var(--h-accent-dark); }
.h-btn-danger { background: var(--h-surface); color: var(--h-error); border-color: var(--h-error); }
.h-btn-danger:hover:not(:disabled) { background: var(--h-error-bg); }
.h-btn-ghost { background: transparent; color: var(--h-text-muted); }
.h-btn-ghost:hover:not(:disabled) { color: var(--h-text); background: var(--h-bg); }
.h-btn-sm { padding: 6px 12px; font-size: var(--h-fs-13); }
.h-btn-block { width: 100%; min-height: 48px; font-size: var(--h-fs-15); }
.h-btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.h-icon-btn {
    background: transparent; border: 1px solid transparent; width: 30px; height: 30px; display: inline-flex; align-items: center;
    justify-content: center; cursor: pointer; color: var(--h-text-muted); transition: color .15s ease, background .15s ease;
}
.h-icon-btn:hover { color: var(--h-text); background: var(--h-bg); }
.h-icon { width: 18px; height: 18px; stroke-width: 1.75; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* dymek podpowiedzi data-tip (od 0.9.7, jak .h-q-tip w Hegios): mysz po 0,6 s i Tab; na dotyku nigdy (hTip w wspolne.js) */
.h-q-tip { position: fixed; z-index: 1300; max-width: 300px; background: var(--h-anthracite); color: #F2F4F7; font-size: var(--h-fs-12); line-height: 1.45; padding: 10px 12px; box-shadow: var(--h-shadow-lg); pointer-events: none; display: none; font-family: var(--h-font-ui); }
.h-icon-sm { width: 14px; height: 14px; }

/* -- pola -- */
.h-input, .h-select, .h-textarea {
    font-size: var(--h-fs-14); color: var(--h-text); background: var(--h-surface); border: 1px solid var(--h-border-strong);
    padding: var(--h-input-pad); line-height: var(--h-lh-base); width: 100%; transition: border-color .15s ease, box-shadow .15s ease;
}
.h-input:focus, .h-select:focus, .h-textarea:focus { outline: none; border-color: var(--h-accent); box-shadow: 0 0 0 3px rgba(46,100,168,.18); }
.h-textarea { resize: vertical; }
.h-field { display: flex; flex-direction: column; gap: var(--h-sp-1); min-width: 0; }
.h-field > label { font-size: var(--h-fs-13); font-weight: var(--h-fw-med); color: var(--h-text); }
.h-empty { text-align: center; padding: var(--h-sp-6) var(--h-sp-4); color: var(--h-text-muted); font-size: var(--h-fs-14); line-height: var(--h-lh-loose); }

/* -- toast: dół, środek, jeden naraz; nad dolną nawigacją -- */
.h-toast {
    position: fixed; bottom: calc(var(--h-sp-5) + var(--crm-dol) + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
    z-index: 2000; display: flex; align-items: center; gap: var(--h-sp-3); background: var(--h-toast-bg); color: var(--h-toast-text);
    padding: var(--h-sp-3) var(--h-sp-4); box-shadow: var(--h-shadow-lg); max-width: min(560px, calc(100vw - 32px)); width: max-content;
    font-size: var(--h-fs-13); line-height: var(--h-lh-base); cursor: pointer;
}
/* na wąskim ekranie przy otwartym oknie zadania (na cały ekran) toast staje u góry, pod paskiem "Oznacz jako zrobione":
   na dole zasłaniał mikrofon i Wyślij przy komentarzu (przejście dnia 12.10.2026) */
@media (max-width: 759px) {
    #tk-panel:not([hidden]) ~ .h-toast { bottom: auto; top: calc(72px + env(safe-area-inset-top, 0px)); }
}
.h-toast-success, .h-toast-info { background: var(--h-toast-bg); }
.h-toast-warning { background: var(--h-warning); color: #fff; }
.h-toast-error { background: var(--h-error); color: #fff; }
.h-toast span { min-width: 0; overflow-wrap: anywhere; }
.h-toast button {
    flex-shrink: 0; background: none; border: 1px solid currentColor; color: inherit; padding: var(--h-sp-1) var(--h-sp-3);
    font-weight: var(--h-fw-sem); cursor: pointer; min-height: 32px;
}

/* -- okno (hForm, hConfirm): nad wszystkim poza toastem -- */
.act-dlg-bg {
    position: fixed; inset: 0; background: rgba(35,39,46,.45); z-index: 1100; display: flex; align-items: center;
    justify-content: center; padding: var(--h-sp-4);
}
.act-dlg {
    background: var(--h-surface); box-shadow: var(--h-shadow-lg); width: 440px; max-width: 100%; max-height: 90vh;
    overflow-y: auto; padding: var(--h-sp-5);
}
.act-dlg:focus { outline: none; }
.act-dlg-head { display: flex; align-items: center; gap: var(--h-sp-2); }
.act-dlg-head b { flex: 1; font-size: var(--h-fs-16); color: var(--h-text); overflow-wrap: anywhere; }
.act-dlg-sub { font-size: var(--h-fs-13); color: var(--h-text-muted); margin-top: var(--h-sp-1); }
.act-dlg .h-field { margin-top: var(--h-sp-3); }
.act-dlg-actions { display: flex; justify-content: flex-end; gap: var(--h-sp-2); margin-top: var(--h-sp-4); }
.h-form-info { white-space: pre-line; margin-top: var(--h-sp-3); }
/* pola wyboru w oknie (hForm, typ checks, od 0.9.1): zablokowane szare, z dopiskiem obok */
.h-field-l { font-size: var(--h-fs-13); font-weight: var(--h-fw-med); color: var(--h-text); }
.h-checks { display: flex; flex-direction: column; }
.h-check { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 40px; font-size: var(--h-fs-14); cursor: pointer; overflow-wrap: anywhere; }
.h-check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--h-accent); }
.h-check.is-off { color: var(--h-text-muted); cursor: default; }
.h-check small { font-size: var(--h-fs-12); color: var(--h-text-muted); }
@media (max-width: 600px) {
    .act-dlg-bg { padding: 0; align-items: stretch; }
    .act-dlg { width: 100%; max-height: none; padding-bottom: calc(var(--h-sp-5) + env(safe-area-inset-bottom)); }
}

/* -- Zadania: zakładki, szukanie, pasek dodawania -- */
.tz-ik { flex-shrink: 0; display: inline-block; vertical-align: -3px; }
.tz-head { background: var(--h-surface); border: 1px solid var(--h-border); }
.tz-bar1 { display: flex; align-items: stretch; border-bottom: 1px solid var(--h-border); }
.tz-tabs { flex: 1; min-width: 0; display: flex; align-items: stretch; padding: 0 var(--h-sp-2); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tz-tabs::-webkit-scrollbar { display: none; }
.tz-tab { display: flex; align-items: center; flex-shrink: 0; min-width: 0; padding-right: var(--h-sp-3); box-shadow: inset 0 -3px 0 transparent; }
.tz-tab.is-on { box-shadow: inset 0 -3px 0 var(--h-accent); }
.tz-tab-b {
    display: inline-flex; align-items: center; gap: var(--h-sp-2); background: none; border: none; min-width: 0;
    padding: 13px var(--h-sp-2) 11px var(--h-sp-3); font-size: var(--h-fs-15); color: var(--h-graphite); cursor: pointer; white-space: nowrap;
}
.tz-tab-b:hover { color: var(--h-text); }
.tz-tab.is-on .tz-tab-b { color: var(--h-text); font-weight: var(--h-fw-sem); }
.tz-tab-n { overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tz-k { font-size: var(--h-fs-12); color: var(--h-text-muted); font-weight: var(--h-fw-med); font-family: var(--h-font-mono); }
.tz-pill { font-size: var(--h-fs-11); font-weight: var(--h-fw-sem); background: var(--h-accent); color: #fff; padding: 1px 6px; line-height: 1.4; }
.tz-pill.is-late { background: var(--h-error); }
.tz-bar1-r { display: flex; align-items: center; gap: var(--h-sp-2); padding: 6px var(--h-sp-3); flex-shrink: 0; }
.tz-search {
    display: flex; align-items: center; gap: 6px; border: 1px solid var(--h-border); background: var(--h-surface); padding: 0 10px;
    color: var(--h-graphite); width: 38px; height: 34px; overflow: hidden; cursor: pointer; transition: width .15s;
}
.tz-search:hover { border-color: var(--h-border-strong); }
.tz-search:focus-within, .tz-search.is-filled { width: 240px; cursor: text; border-color: var(--h-border-strong); }
.tz-search:focus-within { border-color: var(--h-accent); box-shadow: 0 0 0 2px var(--h-accent-bg); }
.tz-search input[type=search] {
    flex: 1; min-width: 0; width: auto; border: none; outline: none; background: transparent; font-size: var(--h-fs-13);
    padding: 8px 0; color: var(--h-text); -webkit-appearance: none; appearance: none;
}
.tz-bar2 { display: flex; align-items: center; gap: var(--h-sp-3); padding: var(--h-sp-3); flex-wrap: wrap; }
.tz-add { flex: 1 1 560px; display: flex; align-items: center; gap: var(--h-sp-2); flex-wrap: wrap; min-width: 0; }
.tz-add-in {
    flex: 1 1 calc(100% - 100px); min-width: 0; display: flex; align-items: center; gap: var(--h-sp-2); border: 1px solid var(--h-border-strong);
    background: var(--h-surface); padding: 0 0 0 var(--h-sp-3); color: var(--h-text-muted); cursor: text;
}
.tz-add-in:focus-within { border-color: var(--h-accent); box-shadow: 0 0 0 2px var(--h-accent-bg); }
.tz-add-t { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: var(--h-fs-14); padding: 8px 0; color: var(--h-text); }
.tz-mic {
    flex-shrink: 0; width: 38px; align-self: stretch; min-height: 36px; display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; border-left: 1px solid var(--h-border); color: var(--h-graphite); cursor: pointer;
}
.tz-mic:hover { color: var(--h-text); background: var(--h-bg); }
.tz-mic[aria-pressed="true"] { color: #fff; background: var(--h-accent); }
.tz-add .h-select { width: auto; max-width: 220px; }
.tz-add > .h-btn { align-self: stretch; }
.tz-add-time { width: 112px; flex-shrink: 0; }
.tz-add-info { font-size: var(--h-fs-13); color: var(--h-text-muted); display: flex; align-items: center; gap: var(--h-sp-3); min-height: 36px; }
.tz-dykt { flex-basis: 100%; font-size: var(--h-fs-12); color: var(--h-text-muted); min-height: 18px; white-space: nowrap; overflow: hidden; }
.tz-dykt.wrap { white-space: normal; }
/* przełącznik dnia przy dodawaniu (Dziś, Jutro, Pn, Za tydzień, Bez terminu) i Lista / Tablica */
.tz-seg { display: inline-flex; border: 1px solid var(--h-border-strong); flex-shrink: 0; max-width: 100%; }
.tz-seg button {
    display: inline-flex; align-items: center; gap: 6px; background: var(--h-surface); border: none; border-left: 1px solid var(--h-border-strong);
    font-size: var(--h-fs-13); color: var(--h-graphite); padding: 6px 12px; min-height: 36px; cursor: pointer; white-space: nowrap;
}
.tz-seg button:first-child { border-left: none; }
.tz-seg button:hover { color: var(--h-text); background: var(--h-bg); }
.tz-seg button.is-on { background: var(--h-navy); color: #fff; }
.tz-seg button:focus-visible { outline: 2px solid var(--h-accent); outline-offset: -2px; }

/* -- projekty po lewej (od 900 px), pasek nad listą (wąsko) -- */
.tz-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--h-sp-4); margin-top: var(--h-sp-3); align-items: start; }
.tz-side { background: var(--h-surface); border: 1px solid var(--h-border); padding: var(--h-sp-3); }
.tz-side-t { font-size: var(--h-fs-11); font-weight: var(--h-fw-sem); color: var(--h-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: var(--h-sp-2); }
.tz-projs { display: flex; flex-direction: column; }
.tz-pw { display: flex; align-items: center; gap: var(--h-sp-2); padding: var(--h-sp-2); font-size: var(--h-fs-13); color: var(--h-text); cursor: pointer; min-height: 36px; }
.tz-pw:hover { background: var(--h-bg); }
.tz-pw:focus-visible { outline: 2px solid var(--h-accent); outline-offset: -2px; }
.tz-pw.is-active { background: var(--h-bg); font-weight: var(--h-fw-sem); box-shadow: inset 3px 0 0 var(--h-accent); }
.tz-pw-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-cnt { font-size: var(--h-fs-11); color: var(--h-text-muted); font-family: var(--h-font-mono); }
.tz-pw-lock { display: inline-flex; color: var(--h-text-muted); flex-shrink: 0; }
.tz-cnt.is-late { color: #fff; background: var(--h-error); padding: 0 5px; font-weight: var(--h-fw-sem); }
.tz-pw-m {
    flex-shrink: 0; width: 26px; height: 26px; border: none; background: none; color: var(--h-text-muted); cursor: pointer;
    display: none; align-items: center; justify-content: center; padding: 0; margin: -4px -4px -4px 0;
}
.tz-pw:hover .tz-pw-m, .tz-pw.is-active .tz-pw-m, .tz-pw-m:focus { display: inline-flex; }
.tz-pw-m:hover { color: var(--h-text); background: var(--h-surface); }
.tz-pw.is-closed .tz-pw-n { color: var(--h-text-muted); text-decoration: line-through; }
.tz-pw.is-sub { padding-left: var(--h-sp-3); font-size: var(--h-fs-12); }
.tz-pw-br { width: 10px; height: 10px; border-left: 1px solid var(--h-border-strong); border-bottom: 1px solid var(--h-border-strong); margin: -6px 2px 0 2px; flex-shrink: 0; }
.tz-pw-kol { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.tz-side-new { margin-top: var(--h-sp-2); }
.tz-side-pusto { display: flex; flex-direction: column; align-items: flex-start; gap: var(--h-sp-2); font-size: var(--h-fs-13); color: var(--h-text-muted); }
.tz-side-pusto .h-btn { white-space: normal; text-align: left; line-height: 1.35; }

/* -- lista: sekcje terminów, wiersze -- */
.tz-content { min-width: 0; }
.tz-list > .tz-sec:first-child { padding-top: var(--h-sp-1); }
.tz-list > .tz-pusto:first-child { margin-top: 0; }
/* bez sieci (od 0.9.7): linia stanu nad lista z pamieci i wiersz "czeka na wyslanie" */
.tz-stan { margin-bottom: var(--h-sp-3); }
.tz-stan .h-btn { margin-left: auto; }
.tz-row.is-pending .tz-m2 { color: var(--h-text-muted); }
.tkm-off { padding: var(--h-sp-4) var(--h-sp-5); }
.tkm-off .tkm-num { margin-bottom: var(--h-sp-2); }
.tkm-off-t { font-size: var(--h-fs-20); font-weight: var(--h-fw-sem); line-height: var(--h-lh-tight); margin: 0 0 var(--h-sp-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.tkm-off-d { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--h-fs-14); line-height: var(--h-lh-base); margin: 0 0 var(--h-sp-4); }
.tkm-off-m { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--h-sp-1) var(--h-sp-3); font-size: var(--h-fs-13); }
.tkm-off-m dt { color: var(--h-text-muted); }
.tkm-off-m dd { margin: 0; }
.tz-sec {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--h-sp-2); font-size: var(--h-fs-12); font-weight: var(--h-fw-sem);
    color: var(--h-graphite); text-transform: uppercase; letter-spacing: .4px; padding: var(--h-sp-4) var(--h-sp-1) var(--h-sp-2);
}
.tz-sec.is-late { color: var(--h-error); }
.tz-sec-k { font-family: var(--h-font-mono); font-weight: var(--h-fw-med); }
.tz-sec-h { font-size: var(--h-fs-12); text-transform: none; letter-spacing: 0; font-weight: var(--h-fw-reg); color: var(--h-text-muted); }
.tz-grp { background: var(--h-surface); border: 1px solid var(--h-border); }
.tz-row {
    display: flex; align-items: center; gap: var(--h-sp-2); padding: 8px var(--h-sp-3) 8px 4px; border-bottom: 1px solid var(--h-border);
    min-height: 46px; background: var(--h-surface);
}
.tz-row:last-child { border-bottom: none; }
.tz-row:hover { background: var(--h-bg); }
.tz-row.is-high { box-shadow: inset 3px 0 0 var(--h-error); }
.tz-row.is-done .tz-t { text-decoration: line-through; color: var(--h-text-muted); }
.tz-row.is-dragging { position: relative; z-index: 2; outline: 1px solid var(--h-accent); box-shadow: var(--h-shadow-md); background: var(--h-surface); }
body.tz-sorting, body.tz-sorting * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.tz-grip {
    flex-shrink: 0; width: 16px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--h-text-muted);
    cursor: grab; touch-action: none; opacity: 0;
}
.tz-grip.is-empty { cursor: default; }
.tz-row:hover .tz-grip:not(.is-empty) { opacity: 1; }
.tz-grip:hover { color: var(--h-text); }
.tz-cbw { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
.tz-cb { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: var(--h-accent); margin: 0; }
.tz-main { flex: 1; min-width: 0; cursor: pointer; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.tz-main:focus-visible, .tz-card:focus-visible { outline: 2px solid var(--h-accent); outline-offset: -2px; }
.tz-t { font-size: var(--h-fs-14); color: var(--h-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-t.two { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.tz-row.is-pending .tz-m2 { color: var(--h-accent); }
.tz-m2 { font-size: var(--h-fs-12); color: var(--h-text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-meta { display: flex; align-items: center; gap: var(--h-sp-2); flex-shrink: 0; font-size: var(--h-fs-12); color: var(--h-text-muted); }
.tz-proj { border: 1px solid var(--h-border); background: var(--h-bg); padding: 0 6px; white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis; color: var(--h-graphite); }
.tz-etap { font-size: var(--h-fs-11); font-weight: var(--h-fw-sem); padding: 1px 6px; white-space: nowrap; border: 1px solid var(--h-border-strong); color: var(--h-graphite); background: var(--h-bg); }
.tz-etap.is-doing { color: var(--h-accent); border-color: var(--h-accent); background: var(--h-accent-bg); }
.tz-ico { display: inline-flex; align-items: center; gap: 3px; font-family: var(--h-font-mono); font-size: var(--h-fs-11); color: var(--h-text-muted); }
.tz-prio { color: var(--h-error); font-weight: 700; font-size: var(--h-fs-16); line-height: 1; }
.tz-due {
    flex-shrink: 0; min-width: 86px; text-align: right; background: none; border: 1px solid transparent; padding: 3px 6px;
    font-size: var(--h-fs-12); color: var(--h-graphite); cursor: pointer; white-space: nowrap; min-height: 30px;
}
button.tz-due:hover, button.tz-due:focus-visible { border-color: var(--h-border-strong); background: var(--h-surface); }
.tz-due.is-empty { color: var(--h-text-muted); opacity: 0; }
.tz-row:hover .tz-due.is-empty, .tz-due.is-empty:focus { opacity: 1; }
.tz-due.is-late { color: var(--h-error); font-weight: var(--h-fw-sem); }
.tz-due.is-today { color: var(--h-accent); font-weight: var(--h-fw-sem); }
.tz-due.is-sug { color: var(--h-text-muted); border: 1px dashed var(--h-border-strong); }
span.tz-due { cursor: default; }
.tz-pusto { padding: var(--h-sp-5) var(--h-sp-4); text-align: center; color: var(--h-text-muted); font-size: var(--h-fs-13); background: var(--h-surface); border: 1px dashed var(--h-border); margin-top: var(--h-sp-2); }
.tz-done-t {
    display: flex; align-items: center; gap: 6px; background: none; border: none; padding: var(--h-sp-4) var(--h-sp-1) var(--h-sp-2);
    font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); text-transform: uppercase; letter-spacing: .4px; color: var(--h-text-muted); cursor: pointer; min-height: 44px;
}
.tz-done-t:hover { color: var(--h-text); }
/* kolor projektu: pasek i tło wiersza (podprojekt bez koloru = kolor nadrzędnego) */
.tz-row.ma-kolor { box-shadow: inset 4px 0 0 var(--tz-kolor); background: color-mix(in srgb, var(--tz-kolor) 9%, var(--h-surface)); }
.tz-row.ma-kolor:hover { background: color-mix(in srgb, var(--tz-kolor) 15%, var(--h-surface)); }
.tz-row.ma-kolor.is-high { box-shadow: inset 4px 0 0 var(--tz-kolor), inset 7px 0 0 var(--h-error); }

/* -- tablica etapów (Do zrobienia, W trakcie, Czeka, Zrobione) -- */
.tz-board { margin-top: var(--h-sp-1); display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: var(--h-sp-3); align-items: start; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--h-sp-3); }
.tz-col { background: var(--h-bg); border: 1px solid var(--h-border); display: flex; flex-direction: column; max-height: calc(100dvh - 260px); min-height: 180px; }
.tz-col.is-over { border-color: var(--h-accent); box-shadow: inset 0 0 0 1px var(--h-accent); }
.tz-col-h {
    display: flex; align-items: center; gap: var(--h-sp-2); padding: 10px var(--h-sp-3); border-bottom: 1px solid var(--h-border);
    font-size: var(--h-fs-13); font-weight: var(--h-fw-sem); color: var(--h-text); background: var(--h-surface); box-shadow: inset 0 3px 0 var(--h-navy);
}
.tz-col[data-col="doing"] .tz-col-h { box-shadow: inset 0 3px 0 var(--h-accent); }
.tz-col[data-col="waiting"] .tz-col-h { box-shadow: inset 0 3px 0 var(--h-border-strong); }
.tz-col[data-col="done"] .tz-col-h { box-shadow: inset 0 3px 0 var(--h-graphite); }
.tz-col-k { font-family: var(--h-font-mono); font-size: var(--h-fs-11); color: var(--h-text-muted); border: 1px solid var(--h-border); padding: 0 6px; background: var(--h-bg); font-weight: var(--h-fw-reg); }
.tz-col-s { margin-left: auto; font-size: var(--h-fs-11); color: var(--h-text-muted); font-weight: var(--h-fw-reg); }
.tz-col-b { flex: 1; overflow-y: auto; padding: var(--h-sp-2); display: flex; flex-direction: column; gap: var(--h-sp-2); min-height: 70px; }
.tz-col-pusto { font-size: var(--h-fs-12); color: var(--h-text-muted); text-align: center; padding: var(--h-sp-4) var(--h-sp-2); border: 1px dashed var(--h-border); }
.tz-col-add { padding: var(--h-sp-2); border-top: 1px solid var(--h-border); }
.tz-col-add .h-input { font-size: var(--h-fs-13); background: var(--h-surface); width: 100%; }
.tz-card { background: var(--h-surface); border: 1px solid var(--h-border); padding: var(--h-sp-2) var(--h-sp-3); cursor: pointer; box-shadow: var(--h-shadow-sm); }
.tz-card[draggable="true"] { cursor: grab; }
.tz-card:hover { border-color: var(--h-border-strong); }
.tz-card.is-high { box-shadow: inset 3px 0 0 var(--h-error), var(--h-shadow-sm); }
.tz-card.is-done { opacity: .72; }
.tz-card.is-done .tz-card-t { text-decoration: line-through; color: var(--h-text-muted); }
.tz-card.is-dragging { opacity: .4; }
.tz-card-t { font-size: var(--h-fs-13); color: var(--h-text); line-height: 1.35; word-break: break-word; }
.tz-card-kto { font-size: var(--h-fs-12); color: var(--h-graphite); margin-top: 4px; }
.tz-card-f { display: flex; align-items: center; gap: var(--h-sp-2); margin-top: 6px; font-size: var(--h-fs-11); color: var(--h-text-muted); min-height: 22px; }
.tz-db { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border: 1px solid var(--h-border); background: var(--h-bg); }
.tz-db.is-late { background: var(--h-error-bg); color: var(--h-error); border-color: transparent; font-weight: var(--h-fw-sem); }
.tz-db.is-today { color: var(--h-accent); border-color: var(--h-accent); }
.tz-card.ma-kolor { border-top: 4px solid var(--tz-kolor); background: color-mix(in srgb, var(--tz-kolor) 9%, var(--h-surface)); }

/* -- małe menu przy elemencie (termin, projekt, kolor): Esc i Wstecz zamykają -- */
.tz-pop {
    position: fixed; z-index: 1050; min-width: 200px; background: var(--h-surface); border: 1px solid var(--h-border-strong);
    box-shadow: var(--h-shadow-lg); padding: 4px; display: flex; flex-direction: column;
}
.tz-pop button { font-size: var(--h-fs-13); text-align: left; background: none; border: none; padding: 10px 12px; color: var(--h-text); cursor: pointer; min-height: 40px; }
.tz-pop button:hover, .tz-pop button:focus-visible { background: var(--h-bg); outline: none; }
.tz-pop button.is-danger { color: var(--h-error); }
.tz-pop { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tz-pop-sep { border-top: 1px solid var(--h-border); margin: 2px 0; flex-shrink: 0; }
.tz-pop-t { font-size: var(--h-fs-11); color: var(--h-text-muted); padding: 6px 12px 2px; text-transform: uppercase; letter-spacing: .4px; font-weight: var(--h-fw-sem); flex-shrink: 0; }
.tz-pop button { flex-shrink: 0; }
.tz-pop-data { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: var(--h-fs-13); color: var(--h-text-muted); border-top: 1px solid var(--h-border); border-bottom: 1px solid var(--h-border); margin: 2px 0; flex-shrink: 0; }
.tz-pop-data .h-input { padding: 4px 6px; font-size: var(--h-fs-13); width: auto; }
.tz-pop-kol { padding: 10px; width: 260px; }
.tz-pop-t { font-size: var(--h-fs-12); color: var(--h-text-muted); margin-bottom: 8px; }
.tz-kolory { display: flex; flex-wrap: wrap; gap: 6px; }
.tz-kol {
    width: 28px; height: 28px; flex-shrink: 0; border: none; padding: 0; cursor: pointer; position: relative; display: inline-flex;
    align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.tz-pop .tz-kolory .tz-kol { padding: 0; min-height: 0; }
.tz-kol:hover { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px var(--h-border-strong); }
.tz-kol.is-on { box-shadow: 0 0 0 2px var(--h-surface), 0 0 0 4px var(--h-text); }
.tz-kol-inny { background: var(--h-surface); color: var(--h-text-muted); box-shadow: inset 0 0 0 1px var(--h-border-strong); }
.tz-kol-inny input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.tz-pop .tz-pop-b { margin-top: 8px; padding: 6px 0; color: var(--h-accent); min-height: 32px; }

/* -- okno zadania (.tkm): treść, podzadania, załączniki, komentarze z lewej, pola z prawej -- */
.tk-panel-overlay { position: fixed; inset: 0; background: rgba(35,39,46,.45); z-index: 900; }
.tkm {
    position: fixed; z-index: 901; top: 24px; bottom: 24px; left: 50%; transform: translateX(-50%); width: min(1080px, calc(100vw - 48px));
    background: var(--h-surface); border: 1px solid var(--h-border-strong); box-shadow: var(--h-shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.tkm-top { display: flex; align-items: center; gap: var(--h-sp-2); padding: 10px var(--h-sp-4); border-bottom: 1px solid var(--h-border); flex-shrink: 0; background: var(--h-surface); }
.tz-sp { flex: 1; }
.tkm:focus { outline: none; }
.tk-saved { font-size: var(--h-fs-12); color: var(--h-text-muted); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.tk-saved.is-on { opacity: 1; }
.tkm-done { display: inline-flex; align-items: center; gap: 6px; }
.tkm-done.is-on { background: var(--h-accent-bg); border-color: var(--h-accent); color: var(--h-accent); }
.tkm-body { flex: 1; display: flex; min-height: 0; }
.tkm-main { flex: 1; min-width: 0; overflow-y: auto; padding: var(--h-sp-4) var(--h-sp-5) var(--h-sp-5); }
.tkm-side { width: 300px; flex-shrink: 0; overflow-y: auto; background: var(--h-bg); border-left: 1px solid var(--h-border); padding: var(--h-sp-4); }
.tkm-parent {
    display: inline-block; font-size: var(--h-fs-13); color: var(--h-accent); margin-bottom: var(--h-sp-2); text-decoration: none;
    background: none; border: none; padding: 4px 0; cursor: pointer; text-align: left;
}
.tkm-parent:hover { text-decoration: underline; }
.tkm-num { font-size: var(--h-fs-12); color: var(--h-text-muted); font-family: var(--h-font-mono); }
.tkm-title {
    display: block; width: calc(100% + 14px); resize: none; overflow: hidden; border: 1px solid transparent; background: transparent;
    font-size: var(--h-fs-20); font-weight: var(--h-fw-sem); color: var(--h-text); padding: 4px 6px; margin: 2px 0 var(--h-sp-1) -7px; line-height: 1.3;
}
.tkm-title:hover { border-color: var(--h-border); }
.tkm-title:focus { outline: none; border-color: var(--h-accent); background: var(--h-surface); }
.tkm-lab { font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); text-transform: uppercase; letter-spacing: .4px; margin: var(--h-sp-4) 0 var(--h-sp-2); }
/* wysokość z treści (_tzFit po pokazaniu okna); gdyby nie objęła całości, tekst da się przewinąć */
.tkm-desc { min-height: 76px; width: 100%; resize: none; overflow-x: hidden; overflow-y: auto; }
/* opis z mikrofonem w prawym górnym rogu pola */
.tkm-pole { position: relative; }
.tkm-pole .tkm-desc { padding-right: 46px; }
.tkm-mic { position: absolute; top: 1px; right: 1px; width: 42px; height: 42px; min-height: 0; border-left: none; }
.tkm-mic2 { padding: 6px 10px; }
/* maile zadania (od 0.9.1): "Otwórz mail" z tematem pod opisem */
.tkm-mail:empty { display: none; }
.tkm-mail { margin-top: var(--h-sp-3); }
.tkm-mail-r { display: flex; align-items: center; gap: var(--h-sp-2); min-width: 0; margin-top: var(--h-sp-2); }
.tkm-mail-o { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tkm-mail-s { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--h-fs-13); color: var(--h-text-muted); }
.tkm-mic2[aria-pressed="true"] { color: #fff; background: var(--h-accent); border-color: var(--h-accent); }
.tkm-sub { display: flex; align-items: center; gap: var(--h-sp-2); padding: 6px 0; border-bottom: 1px solid var(--h-border); font-size: var(--h-fs-13); }
.tkm-sub-cb { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
.tkm-sub input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--h-accent); cursor: pointer; margin: 0; flex-shrink: 0; }
.tkm-sub-t { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: 0; color: var(--h-text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkm-sub-t:hover { color: var(--h-accent); }
.tkm-sub.is-done .tkm-sub-t { text-decoration: line-through; color: var(--h-text-muted); }
.tkm-sub-m { font-size: var(--h-fs-12); color: var(--h-text-muted); white-space: nowrap; }
.tkm-sub-m.is-late { color: var(--h-error); font-weight: var(--h-fw-sem); }
.tkm-x { background: none; border: none; color: var(--h-text-muted); cursor: pointer; padding: 4px; display: inline-flex; margin-left: auto; }
.tkm-x:hover { color: var(--h-error); }
.tkm-sub-add { display: flex; align-items: center; gap: var(--h-sp-2); padding: 6px 0; color: var(--h-text-muted); }
.tkm-sub-in { flex: 1; min-width: 0; border: none; border-bottom: 1px solid transparent; background: transparent; font-size: var(--h-fs-13); padding: 4px 0; color: var(--h-text); outline: none; }
.tkm-sub-in:focus { border-bottom-color: var(--h-accent); }
.tkm-atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--h-sp-2); }
.tkm-att { position: relative; border: 1px solid var(--h-border); background: var(--h-surface); }
.tkm-att:hover { border-color: var(--h-border-strong); }
.tkm-att a, .tkm-att button.tkm-att-o { display: flex; flex-direction: column; text-decoration: none; color: var(--h-text); width: 100%; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
.tkm-att img { width: 100%; height: 86px; object-fit: cover; display: block; background: var(--h-bg); }
.tkm-ext { height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--h-bg); color: var(--h-graphite); }
.tkm-ext b { font-size: var(--h-fs-11); letter-spacing: .5px; }
.tkm-att-n { font-size: var(--h-fs-12); padding: 5px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-top: 1px solid var(--h-border); }
.tkm-att-x {
    position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(35,39,46,.72); color: #fff; border: none; cursor: pointer; opacity: 0;
}
.tkm-att:hover .tkm-att-x, .tkm-att-x:focus { opacity: 1; }
.tkm-drop {
    position: relative; min-height: 114px; border: 1px dashed var(--h-border-strong); display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; font-size: var(--h-fs-12); color: var(--h-text-muted); cursor: pointer; text-align: center; padding: var(--h-sp-2);
}
.tkm-drop:hover, .tkm-drop.is-over { border-color: var(--h-accent); color: var(--h-accent); background: var(--h-accent-bg); }
.tkm-drop.is-busy { cursor: progress; border-style: solid; }
.tkm-drop:focus-within { outline: 2px solid var(--h-accent); outline-offset: 1px; }
/* pole pliku pod etykietą: niewidoczne, ale nie display:none (Safari na starszych iPadach nie otwierało wtedy wyboru) */
.tkm-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
/* podgląd obrazu albo PDF nad oknem zadania */
.tkm-podglad { position: fixed; inset: 0; z-index: 1000; background: rgba(20,22,26,.92); display: flex; flex-direction: column; }
.tkm-podglad-top {
    display: flex; align-items: center; gap: var(--h-sp-2); color: #fff; font-size: var(--h-fs-14);
    padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px calc(max(16px, env(safe-area-inset-left)) + var(--okno-l, 0px));
}
.tkm-podglad-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkm-podglad .h-icon-btn { color: #fff; width: 40px; height: 40px; }
.tkm-podglad .h-icon-btn:hover { background: rgba(255,255,255,.12); }
.tkm-podglad-b { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px max(16px, env(safe-area-inset-bottom)); }
.tkm-podglad-b img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.tkm-podglad-b iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.tkm-ftabs { display: flex; border-bottom: 1px solid var(--h-border); margin: var(--h-sp-5) 0 var(--h-sp-3); }
.tkm-ftabs button { background: none; border: none; font-size: var(--h-fs-13); font-weight: var(--h-fw-sem); color: var(--h-graphite); padding: 8px 12px; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; min-height: 40px; }
.tkm-ftabs button:hover { color: var(--h-text); }
.tkm-ftabs button.is-on { color: var(--h-text); box-shadow: inset 0 -2px 0 var(--h-accent); }
.tkm-comp { display: flex; gap: var(--h-sp-2); align-items: flex-start; margin-bottom: var(--h-sp-3); }
.tkm-comp-in { flex: 1; min-width: 0; position: relative; }
.tkm-comp-in .h-textarea { width: 100%; }
.tkm-comp-b { display: flex; align-items: center; gap: var(--h-sp-2); margin-top: 6px; }
.tkm-comp-b .tkm-hint { flex: 1; margin-top: 0; }
.tkm-hint { font-size: var(--h-fs-12); color: var(--h-text-muted); line-height: 1.4; margin-top: 4px; }
.tkm-kom { display: flex; gap: var(--h-sp-2); padding: var(--h-sp-2) 0; border-top: 1px solid var(--h-border); }
.tkm-kom-b { flex: 1; min-width: 0; }
.tkm-kom-h { display: flex; align-items: center; gap: var(--h-sp-2); font-size: var(--h-fs-13); }
.tkm-kom-h span { font-size: var(--h-fs-12); color: var(--h-text-muted); }
.tkm-kom-h .tkm-x { padding: 2px; opacity: 0; }
.tkm-kom:hover .tkm-x, .tkm-kom .tkm-x:focus { opacity: 1; }
.tkm-kom-t { font-size: var(--h-fs-14); color: var(--h-text); line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }
.tkm-empty { font-size: var(--h-fs-13); color: var(--h-text-muted); padding: var(--h-sp-2) 0; }
.tkm-hist { display: flex; gap: var(--h-sp-2); align-items: baseline; padding: 6px 0; border-top: 1px solid var(--h-border); font-size: var(--h-fs-13); flex-wrap: wrap; }
.tkm-hist-t { color: var(--h-graphite); flex: 1; min-width: 0; }
.tkm-hist-w { font-size: var(--h-fs-12); color: var(--h-text-muted); white-space: nowrap; }
.tkm-f { margin-bottom: var(--h-sp-3); }
.tkm-f > label, .tkm-l { display: flex; align-items: center; gap: 6px; font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); margin-bottom: 4px; }
.tkm-v { font-size: var(--h-fs-13); color: var(--h-text); }
.tkm-f .h-select, .tkm-f .h-input { width: 100%; background: var(--h-surface); }
.tkm-row2 { display: flex; gap: 6px; }
.tkm-row2 .h-input[type=time] { width: 104px; flex-shrink: 0; }
.tkm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tkm-chips button { font-size: var(--h-fs-12); padding: 3px 8px; border: 1px solid var(--h-border-strong); background: var(--h-surface); color: var(--h-graphite); cursor: pointer; min-height: 30px; }
.tkm-chips button:hover { border-color: var(--h-accent); color: var(--h-accent); }

/* -- Dziś: pulpit (od 0.9.4, crm/dzis.js; makieta ux-analiza/makiety/dzis.html) -- */
.pd-head { display: flex; align-items: baseline; gap: var(--h-sp-3); margin-bottom: var(--h-sp-3); }
.pd-head h1 { font-size: var(--h-fs-22); font-weight: var(--h-fw-sem); }
.pd-head .pd-date { color: var(--h-text-muted); font-size: var(--h-fs-14); }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--h-sp-4); align-items: start; }
.pd-col { min-width: 0; display: flex; flex-direction: column; gap: var(--h-sp-4); }
.pd-stan { margin-bottom: var(--h-sp-3); }
.pd-star { background: var(--h-surface); border: 1px solid var(--h-border); box-shadow: inset 0 3px 0 var(--h-accent); padding: var(--h-sp-3) var(--h-sp-4) var(--h-sp-3); }
.pd-star.is-done .pd-star-t { text-decoration: line-through; color: var(--h-text-muted); }
.pd-star-l { display: flex; align-items: center; gap: 6px; font-size: var(--h-fs-11); font-weight: var(--h-fw-sem); color: var(--h-accent); text-transform: uppercase; letter-spacing: .5px; }
.pd-star-l svg { width: 14px; height: 14px; fill: var(--h-accent); stroke: var(--h-accent); stroke-width: 1.5; }
.pd-star-r { display: flex; align-items: flex-start; gap: var(--h-sp-3); margin-top: 6px; }
.pd-star-b { flex: 1; min-width: 0; }
.pd-star-t { display: -webkit-box; width: 100%; text-align: left; background: none; border: none; padding: 0; font-size: var(--h-fs-16); font-weight: var(--h-fw-med); line-height: 1.35; color: var(--h-text); cursor: pointer; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.pd-star-m { display: flex; align-items: center; flex-wrap: wrap; gap: var(--h-sp-2); margin-top: 6px; font-size: var(--h-fs-12); color: var(--h-text-muted); }
.pd-fb { font-size: var(--h-fs-13); color: var(--h-text-muted); padding: 0 var(--h-sp-1); margin-top: calc(-1 * var(--h-sp-2)); }
.pd-sec { display: flex; align-items: baseline; gap: var(--h-sp-2); font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); text-transform: uppercase; letter-spacing: .4px; padding: 0 var(--h-sp-1) var(--h-sp-2); }
.pd-sec .tz-k { font-family: var(--h-font-mono); font-weight: var(--h-fw-med); color: var(--h-text-muted); font-size: var(--h-fs-12); }
.pd-sec .is-late { color: var(--h-error); text-transform: none; letter-spacing: 0; font-weight: var(--h-fw-sem); }
.pd-blok { display: flex; flex-direction: column; }
.pd-fold { display: flex; align-items: center; gap: var(--h-sp-2); width: 100%; min-height: 52px; padding: 8px var(--h-sp-3) 8px var(--h-sp-4); background: var(--h-surface); border: 1px solid var(--h-border); text-align: left; cursor: pointer; font-size: var(--h-fs-14); color: var(--h-text); text-decoration: none; }
.pd-fold + .pd-fold, .pd-fold-in + .pd-fold { border-top: none; }
.pd-fold:hover { background: var(--h-bg); }
.pd-fold b { font-weight: var(--h-fw-sem); white-space: nowrap; }
.pd-fold .tz-k { color: var(--h-text-muted); font-family: var(--h-font-mono); font-size: var(--h-fs-13); }
.pd-fold .pd-fold-m { color: var(--h-text-muted); font-size: var(--h-fs-13); margin-left: 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-fold .pd-fold-m .is-late { color: var(--h-error); font-weight: var(--h-fw-sem); }
.pd-fold svg.chev { margin-left: auto; width: 18px; height: 18px; color: var(--h-text-muted); transition: transform .15s; }
.pd-fold[aria-expanded="true"] svg.chev { transform: rotate(90deg); }
.pd-fold[aria-expanded="true"] { border-bottom: none; }
.pd-fold-in { border: 1px solid var(--h-border); background: var(--h-surface); }
.pd-fold-in .tz-row { padding-left: var(--h-sp-3); }
.pd-fold-in .tz-pusto { border: none; margin: 0; padding: var(--h-sp-3); }
.pd-osoba { font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); padding: var(--h-sp-2) var(--h-sp-4) 2px; text-transform: uppercase; letter-spacing: .4px; border-top: 1px solid var(--h-border); }
.pd-osoba:first-child { border-top: none; }
.pd-dzien { font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); padding: var(--h-sp-2) var(--h-sp-4) 2px; border-top: 1px solid var(--h-border); }
.pd-dzien:first-child { border-top: none; }
.pd-rytual { margin-top: var(--h-sp-2); }
.pd-rytual .h-btn { gap: var(--h-sp-2); }
.pd-ok { font-size: var(--h-fs-13); color: var(--h-text-muted); text-align: center; padding: var(--h-sp-2); }
.pd-ok a { color: var(--h-accent); }
.pd-pusto { padding: var(--h-sp-4); text-align: center; color: var(--h-text-muted); font-size: var(--h-fs-13); background: var(--h-surface); border: 1px dashed var(--h-border); }
/* świeżo dodany wiersz (Zapisz, Udostępnij): obwódka przez 4 s */
.pd .tz-row.pd-row-new { box-shadow: inset 0 0 0 2px var(--h-accent); }
/* na iPadzie i laptopie prawa kolumna to karty z nagłówkiem (jak .h-card w Hegios) */
.pd-card { background: var(--h-surface); border: 1px solid var(--h-border); }
.pd-card-h { display: flex; align-items: center; gap: var(--h-sp-2); padding: 10px var(--h-sp-4); border-bottom: 1px solid var(--h-border); font-size: var(--h-fs-15); font-weight: var(--h-fw-sem); color: var(--h-text); text-decoration: none; }
.pd-card-h .tz-k { font-family: var(--h-font-mono); font-size: var(--h-fs-13); color: var(--h-text-muted); font-weight: var(--h-fw-med); }
.pd-card-h a, .pd-card-h .pd-card-a { margin-left: auto; font-size: var(--h-fs-13); font-weight: var(--h-fw-reg); text-decoration: none; color: var(--h-accent); background: none; border: none; cursor: pointer; padding: 0; }
.pd-card-b { padding: var(--h-sp-2) var(--h-sp-4) var(--h-sp-3); font-size: var(--h-fs-14); }
.pd-card-b .pd-l { display: flex; align-items: center; justify-content: space-between; gap: var(--h-sp-2); min-height: 36px; border-top: 1px solid var(--h-border); color: var(--h-text); text-decoration: none; }
.pd-card-b .pd-l:first-child { border-top: none; }
.pd-card-b .pd-l .tz-k { font-family: var(--h-font-mono); color: var(--h-text-muted); font-size: var(--h-fs-13); }
.pd-card-b .pd-l .is-late { color: var(--h-error); font-weight: var(--h-fw-sem); }
.pd .tz-row { min-height: 52px; flex-wrap: wrap; row-gap: 2px; padding-left: var(--h-sp-3); }
.pd .tz-cbw { width: 48px; height: 48px; margin: -8px; }
.pd .tz-cb { width: 22px; height: 22px; }
.pd .tz-due { order: 1; min-height: 40px; min-width: 72px; display: inline-flex; align-items: center; justify-content: flex-end; }
.pd .tz-due.is-empty { opacity: 1; color: var(--h-graphite); }
.pd .tz-meta { flex-basis: 100%; order: 2; flex-wrap: wrap; padding-left: 40px; }
.pd .tz-meta:empty { display: none; }
@media (min-width: 760px) {
    .pd-grid { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); }
}

/* -- Zapisz: arkusz od dołu (telefon) albo okno na środku (od 760 px), crm/zapisz.js -- */
.zp-bg { position: fixed; inset: 0; background: rgba(35,39,46,.45); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.zp { background: var(--h-surface); width: 100%; box-shadow: var(--h-shadow-lg); padding: var(--h-sp-4) var(--h-sp-4) calc(var(--h-sp-5) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--h-sp-3); max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
.zp-top { display: flex; align-items: center; gap: var(--h-sp-2); }
.zp-top b { flex: 1; font-size: var(--h-fs-16); }
.zp-pole { position: relative; }
.zp-pole .h-textarea { min-height: 112px; padding-right: 52px; font-size: 16px; resize: none; }
.zp-mic { position: absolute; top: 1px; right: 1px; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; border-left: 1px solid var(--h-border); color: var(--h-graphite); cursor: pointer; }
.zp-mic[aria-pressed="true"] { background: var(--h-accent); color: #fff; }
.zp-dykt { font-size: var(--h-fs-12); color: var(--h-text-muted); min-height: 18px; margin: calc(-1 * var(--h-sp-2)) 0 0; }
.zp-chips { display: flex; flex-wrap: wrap; gap: var(--h-sp-2); }
.zp-chips:empty { display: none; }
.zp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--h-border-strong); background: var(--h-surface); color: var(--h-graphite); font-size: var(--h-fs-13); cursor: pointer; max-width: 100%; }
.zp-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-chip[aria-pressed="true"], .zp-chip.is-on { background: var(--h-accent); border-color: var(--h-accent); color: #fff; }
.zp-chip.is-sug { border-style: dashed; }
.zp-chip svg { width: 15px; height: 15px; }
.zp-foot { display: flex; align-items: center; gap: var(--h-sp-2); }
.zp-foot .h-btn-secondary { min-height: 44px; }
.zp-foot .h-btn-accent { flex: 1; min-height: 48px; font-size: var(--h-fs-15); min-width: 0; white-space: normal; }
.zp-info { font-size: var(--h-fs-12); color: var(--h-text-muted); }
.zp-info:empty { display: none; }
@media (min-width: 760px) {
    .zp-bg { align-items: center; padding: var(--h-sp-4); }
    .zp { width: 520px; max-height: calc(100vh - 32px); }
}

/* -- Plan na jutro i Ułóż dzień (od 0.9.5, crm/plan.js): cały ekran nad Dziś, pasek z X, sekcje, pole linijki, przycisk -- */
.pl { position: fixed; inset: 0; z-index: 850; background: var(--h-bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.pl-top { display: flex; align-items: center; gap: var(--h-sp-2); padding: 4px var(--h-sp-3); padding-left: calc(var(--h-sp-3) + var(--okno-l, 0px)); background: var(--h-surface); border-bottom: 1px solid var(--h-border); flex-shrink: 0; min-height: 52px; }
.pl-top .h-icon-btn { width: 44px; height: 44px; margin-left: -8px; color: var(--h-text); }
.pl-titles { display: flex; align-items: baseline; gap: var(--h-sp-2); min-width: 0; flex-wrap: wrap; }
.pl-titles b { font-size: var(--h-fs-16); font-weight: var(--h-fw-sem); white-space: nowrap; }
.pl-date { font-size: var(--h-fs-13); color: var(--h-text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-date::before { content: "· "; }
.pl-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overflow-anchor: none; padding: var(--pl-pad-top, 0) 0 var(--pl-pad-bottom, 0); }
.pl-list { padding: var(--h-sp-3) var(--h-sp-4) 0; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--h-sp-4); }
.pl-list .pd-fold { border-bottom: 1px solid var(--h-border); }
.pl-list .pd-fold[aria-expanded="true"] { border-bottom: none; }
.pl-head { display: flex; align-items: center; gap: var(--h-sp-2); font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); text-transform: uppercase; letter-spacing: .4px; padding: 0 var(--h-sp-1) var(--h-sp-2); }
.pl-head.is-done { color: var(--h-success); }
.pl-head svg { color: var(--h-success); }
.pl-sub { font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-text-muted); padding: var(--h-sp-3) var(--h-sp-1) var(--h-sp-2); }
.pl-note { font-size: var(--h-fs-13); color: var(--h-text-muted); padding: 0 var(--h-sp-1) var(--h-sp-2); }
.pl-note.pl-warn { color: var(--h-error); }
.pl-row { flex-wrap: wrap; row-gap: 2px; min-height: 52px; padding-left: var(--h-sp-3); }
.pl-row .tz-cbw { width: 48px; height: 48px; margin: -8px; }
.pl-row .tz-cb { width: 22px; height: 22px; }
.pl-row .tz-m2 { white-space: normal; }
.pl-chip { color: var(--h-graphite); font-weight: var(--h-fw-med); }
.pl-chip.is-sug { color: var(--h-text-muted); border: 1px dashed var(--h-border-strong); padding: 0 4px; }
.pl-acts { display: flex; align-items: center; gap: var(--h-sp-1); flex-shrink: 0; order: 1; }
.pl-acts .h-btn-sm { min-height: 40px; white-space: nowrap; }
.pl-more { width: 40px; height: 40px; color: var(--h-graphite); border-color: var(--h-border-strong); }
.pl-row .tz-meta { flex-basis: 100%; order: 2; flex-wrap: wrap; padding-left: 40px; }
.pl-row.pl-day .tz-meta { padding-left: 46px; }
.pl-row .tz-meta:empty { display: none; }
.pl-limit { flex-basis: 100%; order: 3; font-size: var(--h-fs-13); color: var(--h-error); font-weight: var(--h-fw-sem); padding: 2px 0 2px 40px; }
.pl-star { width: 40px; height: 40px; flex-shrink: 0; background: none; border: none; cursor: pointer; color: var(--h-border-strong); display: inline-flex; align-items: center; justify-content: center; margin-left: -4px; }
.pl-star svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.pl-star[aria-pressed="true"] { color: var(--h-accent); }
.pl-star[aria-pressed="true"] svg { fill: var(--h-accent); }
.pl-decided { min-height: 48px; flex-wrap: nowrap; }
.pl-decided .pl-line { flex: 1; min-width: 0; display: flex; align-items: baseline; font-size: var(--h-fs-14); }
.pl-decided .pl-label { color: var(--h-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.pl-decided .pl-what { flex-shrink: 0; white-space: nowrap; color: var(--h-text); }
.pl-undo { flex-shrink: 0; min-height: 40px; }
.pl-fb { padding: var(--h-sp-4); max-width: 760px; margin: 0 auto; width: 100%; }
.pl-fb > label { display: block; font-size: var(--h-fs-13); font-weight: var(--h-fw-med); margin-bottom: var(--h-sp-1); }
.pl-fb-row { display: flex; gap: var(--h-sp-2); align-items: stretch; }
.pl-fb-row .h-input { flex: 1; min-width: 0; text-overflow: ellipsis; min-height: 48px; }
.pl-fb-row .tz-mic { width: 48px; min-height: 48px; border: 1px solid var(--h-border); }
.pl-err { font-size: var(--h-fs-12); color: var(--h-error); min-height: 0; }
.pl-err:empty { display: none; }
.pl-foot { padding: 0 var(--h-sp-4) calc(var(--h-sp-5) + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; width: 100%; }
@media (max-width: 420px) {
    .pl-row .tz-main { flex-basis: calc(100% - 44px); }
    .pl-acts { margin-left: auto; }
}

/* -- Listy (od 0.9.5, crm/listy.js): karta na listę, wiersze, pole Dopisz do listy, Wyślij i Kopiuj -- */
.ls { display: flex; flex-direction: column; gap: var(--h-sp-4); max-width: 760px; }
.ls-head { gap: var(--h-sp-2); }
.ls-body { padding: 0 0 var(--h-sp-3); }
.ls-rows .tz-grp { border: none; border-bottom: 1px solid var(--h-border); }
.ls-rows .tz-pusto { border: none; margin: 0; padding: var(--h-sp-3) var(--h-sp-4); }
.ls .tz-row { min-height: 52px; padding-left: var(--h-sp-3); }
.ls .tz-main { margin: -8px 0; padding: 8px 0; min-height: 52px; }   /* tytuł (menu pozycji) na całą wysokość wiersza */
.ls .tz-cbw { width: 48px; height: 48px; margin: -8px; }
.ls .tz-cb { width: 22px; height: 22px; }
.ls-add { display: flex; gap: var(--h-sp-2); padding: var(--h-sp-3) var(--h-sp-4) 0; }
.ls-add .h-input { flex: 1; min-width: 0; min-height: 48px; }
.ls-add .h-btn { min-height: 48px; flex-shrink: 0; }
.ls-err { font-size: var(--h-fs-12); color: var(--h-error); padding: 2px var(--h-sp-4) 0; }
.ls-err:empty { display: none; }
.ls-foot { display: flex; flex-wrap: wrap; gap: var(--h-sp-2); padding: var(--h-sp-3) var(--h-sp-4) 0; align-items: center; }
.ls-foot:empty { display: none; }
.ls-foot .h-btn { min-height: 48px; }
.ls-foot .ls-err { flex-basis: 100%; padding: 0; }
.ls-msg { font-size: var(--h-fs-12); color: var(--h-text-muted); padding: var(--h-sp-2) var(--h-sp-4) 0; }
.ls-msg:empty { display: none; }

/* -- Konto (od 0.9.5, crm/konto.js): karty, zdanie o stanie, urządzenia, powiadomienia, pory, skrót, kosz, wersja -- */
.ko { display: flex; flex-direction: column; gap: var(--h-sp-4); max-width: 760px; }
.ko .pd-card-b { padding-top: var(--h-sp-3); display: flex; flex-direction: column; gap: var(--h-sp-3); }
.ko-state { font-size: var(--h-fs-14); }
.ko-state.is-red { color: var(--h-error); font-weight: var(--h-fw-med); }
.ko-state.is-grey { color: var(--h-text-muted); }
.ko-lines { display: flex; flex-direction: column; gap: 4px; font-size: var(--h-fs-13); color: var(--h-text-muted); }
.ko-lines .is-self { color: var(--h-text); }
.ko-hint { font-size: var(--h-fs-13); color: var(--h-text-muted); }
.ko-hint:empty { display: none; }
.ko-hint-top { padding: 0 var(--h-sp-1); }
.ko-btns { display: flex; flex-wrap: wrap; gap: var(--h-sp-2); }
.ko-btns .h-btn { min-height: 48px; }
.ko-logout { justify-content: flex-start; padding-bottom: var(--h-sp-5); }
.push-dev { display: flex; align-items: center; gap: var(--h-sp-2); min-height: 44px; }
.push-dev .push-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.push-dev.is-self .push-text { color: var(--h-text); }
.push-dev .h-btn { flex-shrink: 0; min-height: 44px; }
.ko .h-field .h-input[type=time] { width: 140px; min-height: 48px; }
.ko-pole { display: block; width: 100%; resize: none; overflow: hidden; font-family: var(--h-font-mono); font-size: var(--h-fs-13); overflow-wrap: anywhere; word-break: break-all; min-height: 48px; }
.ko-help summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: var(--h-fw-med); }
.ko-help ol { margin: var(--h-sp-2) 0 0 var(--h-sp-5); display: flex; flex-direction: column; gap: var(--h-sp-2); font-size: var(--h-fs-14); }
.ko-help .ko-hint { margin-top: var(--h-sp-2); }
.trash-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--h-sp-3); align-items: center; padding: var(--h-sp-2) 0; border-top: 1px solid var(--h-border); }
.trash-row:first-child { border-top: none; }
.trash-row .t { font-weight: var(--h-fw-med); color: var(--h-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .s { grid-column: 1; font-size: var(--h-fs-12); }
.trash-row .h-btn { grid-column: 2; grid-row: 1 / 3; min-height: 44px; }
.ko-wersja { flex-direction: row !important; flex-wrap: wrap; align-items: center; }
.ko-wersja .h-btn { min-height: 48px; }
.ko-wersja #m-version { flex-basis: 100%; }


/* -- dotyk: akcje wierszy widać zawsze, pola 16 px (Safari nie powiększa strony), większe cele -- */
@media (hover: none) {
    .tz-due.is-empty { opacity: 1; }
    .tz-grip:not(.is-empty) { opacity: 1; }
    .tkm-att-x { opacity: 1; }
    .tkm-kom-h .tkm-x { opacity: 1; }
    .tkm-hint-klaw { visibility: hidden; }
}
@media (hover: none) and (pointer: coarse) {
    /* pole daty w małym menu terminu miało 13 px (.tz-pop-data .h-input) i Safari powiększał przy nim stronę */
    input[type=text], input[type=search], input[type=date], input[type=time], select, textarea, .h-input, .h-select, .h-textarea, .tz-add-t,
    .tz-search input[type=search], .tz-pop-data .h-input { font-size: 16px; }
    .tz-cb { width: 22px; height: 22px; }
    .tz-pop-data .h-input { min-height: 40px; }   /* pole daty w małym menu pod palcem */
    /* odhaczenie: etykieta 48 x 48 px wokół pola; ujemne marginesy, więc wiersz nie rośnie, a cel nie wchodzi na sąsiadów */
    .tz-cbw { width: 48px; height: 48px; margin: -8px; }
    .tz-row { min-height: 52px; }
    .tz-pw { min-height: 44px; }
    .tz-pw-m { width: 36px; height: 36px; }
    .tz-due { min-height: 40px; }
    .tkm-sub { min-height: 48px; }
    .tkm-sub input[type=checkbox] { width: 22px; height: 22px; }
    .tkm-sub-cb { width: 48px; height: 48px; margin: -6px -8px -6px -13px; }
    .tkm-sub-t { align-self: stretch; margin: -6px 0; }
    .tkm-x { min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
    .tkm-chips button { min-height: 40px; min-width: 44px; padding: 4px 10px; }
    .tkm-top .h-icon-btn { width: 44px; height: 44px; }
    .tkm-att-x { width: 40px; height: 40px; top: 2px; right: 2px; }
    .tkm-ftabs button { min-height: 44px; }
    .tkm-done { min-height: 44px; }
    /* Cofnij w toaście jak w Notatniku od 0.8.3; małe przyciski (Wyślij, mikrofon, + Nowy projekt, X okna), dni i widok */
    .h-toast button { min-height: 48px; min-width: 48px; }
    .h-btn, .h-btn-sm { min-height: 44px; }
    .h-check { min-height: 44px; }
    .tkm-mic2 { min-width: 44px; }
    .h-icon-btn { width: 44px; height: 44px; }
    .tz-seg button { min-height: 44px; min-width: 44px; }
    .tz-mic { width: 44px; min-height: 44px; }
}

/* -- poniżej 900 px: nawigacja Zadania | Notatnik na dole, projekty jako pasek nad listą -- */
@media (max-width: 899px) {
    .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr) var(--crm-dol); }
    .topbar { grid-column: 1; grid-row: 1; }
    .sidebar { grid-column: 1; grid-row: 3; }
    .content { grid-column: 1; grid-row: 2; padding: 12px 16px 40px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .pd-head { display: none; }

    .tz-layout { display: block; }
    .tz-side { display: flex; align-items: center; gap: var(--h-sp-1); overflow-x: auto; -webkit-overflow-scrolling: touch; padding: var(--h-sp-2); margin-bottom: var(--h-sp-3); }
    .tz-side-t { display: none; }
    .tz-projs { flex-direction: row; gap: var(--h-sp-1); }
    .tz-pw { flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--h-border); padding: 6px var(--h-sp-3); }
    .tz-pw.is-active { box-shadow: none; border-color: var(--h-accent); color: var(--h-accent); }
    .tz-pw.is-sub { padding-left: var(--h-sp-3); }
    .tz-pw-br, .tz-pw-m { display: none !important; }
    .tz-pw.is-active .tz-pw-m { display: inline-flex !important; }
    .tz-side-new { flex: 0 0 auto; margin-top: 0; }
    /* bez projektów pasek pokazuje zdanie i przyciski w wierszach, nie w przewijanym rzędzie */
    .tz-side.is-pusto { flex-wrap: wrap; overflow-x: visible; }
    .tz-side.is-pusto .tz-side-pusto { flex-basis: 100%; }
}
@media (max-width: 759px) {
    .tz-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--h-sp-2); padding-bottom: var(--h-sp-3); min-width: 0; max-width: 100%; }
    .tz-bar1, .tz-bar2, .tz-bar1-r { display: contents; }
    .tz-tabs { order: 1; flex-basis: 100%; min-width: 0; max-width: 100%; border-bottom: 1px solid var(--h-border); }
    .tz-search, .tz-search:focus-within, .tz-search.is-filled { order: 2; flex: 1; width: auto; margin: 0 var(--h-sp-3); cursor: text; }
    .tz-head > .tz-bar1 .tz-seg { order: 3; margin-right: var(--h-sp-3); }
    .tz-add { order: 4; flex-basis: 100%; padding: 0 var(--h-sp-3); }
    .tz-sec-h { flex-basis: 100%; }
    .tz-tab { padding-right: 8px; }
    .tz-tab-b { padding: 12px 4px 10px 10px; font-size: var(--h-fs-14); gap: 6px; }
    .tz-add .tz-seg { flex: 1 1 100%; }
    .tz-add .tz-seg button { flex: 1 1 auto; justify-content: center; padding: 6px 6px; }
    .tz-add-time { width: 100px; padding-left: 8px; padding-right: 8px; }
    .tz-add .h-select { flex: 1 1 40%; max-width: none; min-width: 0; }
    /* pusty tytuł: tylko wiersz z polem (dzień, godzina i projekt z pierwszą literą, zadania.js _tzAddPusto) */
    .tz-add.is-pusto > .tz-seg, .tz-add.is-pusto > .tz-add-time, .tz-add.is-pusto > .h-select { display: none; }
    .tz-row { flex-wrap: wrap; row-gap: 4px; padding-left: var(--h-sp-3); }
    .tz-grip { display: none; }
    .tz-due { order: 1; min-width: 0; }
    .tz-meta { order: 2; flex-basis: 100%; flex-wrap: wrap; padding-left: 26px; }
    .tz-meta:empty { display: none; }
    .tz-board { grid-template-columns: repeat(4, minmax(250px, 84vw)); }
    .tkm { top: 0; bottom: 0; left: 0; transform: none; width: 100vw; border: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .tz-seg#tz-views button { padding: 6px 10px; }
    .tkm-top { padding: 8px var(--h-sp-3); flex-wrap: wrap; }
    .tkm-body { flex-direction: column; overflow-y: auto; }
    .tkm-main { display: contents; }
    .tkm-head { order: 1; padding: var(--h-sp-3) var(--h-sp-4) 0; }
    .tkm-side { order: 2; width: auto; overflow: visible; border-left: none; border-top: 1px solid var(--h-border); border-bottom: 1px solid var(--h-border); margin-top: var(--h-sp-3); }
    .tkm-rest { order: 3; padding: 0 var(--h-sp-4) var(--h-sp-5); }
}
@media (max-width: 759px) and (hover: none) and (pointer: coarse) {
    .tz-meta { padding-left: 40px; }   /* pod tytułem: wyżej etykieta odhaczenia jest szersza */
}

/* -- Notatki (od 0.9.6, crm/notatki.js; makieta ux-analiza/makiety/notatki.html): pasek narzędzi w ramce, karty, kalendarz -- */
.nt { max-width: 1120px; }
.nt-head { background: var(--h-surface); border: 1px solid var(--h-border); display: flex; align-items: center; gap: var(--h-sp-2); padding: var(--h-sp-2) var(--h-sp-3); flex-wrap: wrap; }
.nt-head .tz-seg button { min-height: 40px; }
/* pole szukania zawsze rozwinięte (w Zadaniach .tz-search zwija się do ikony) */
.nt-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--h-border); background: var(--h-surface); padding: 0 10px; color: var(--h-graphite); height: 42px; flex: 1 1 160px; min-width: 0; cursor: text; }
.nt-search:focus-within { border-color: var(--h-accent); box-shadow: 0 0 0 2px var(--h-accent-bg); }
.nt-search input[type=search] { flex: 1; min-width: 0; width: auto; height: 40px; border: none; outline: none; background: transparent; font-size: var(--h-fs-13); padding: 0; color: var(--h-text); -webkit-appearance: none; appearance: none; }
.nt-new { display: flex; gap: var(--h-sp-2); flex-wrap: wrap; }
.nt-new .h-btn { min-height: 40px; }
.nt-sec { font-size: var(--h-fs-12); font-weight: var(--h-fw-sem); color: var(--h-graphite); text-transform: uppercase; letter-spacing: .4px; padding: var(--h-sp-4) var(--h-sp-1) var(--h-sp-2); }
.nt-sec:first-child { padding-top: var(--h-sp-3); }
.nt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--h-sp-3); }
.notes .card { background: var(--h-surface); border: 1px solid var(--h-border); box-shadow: var(--h-shadow-sm); cursor: pointer; display: flex; flex-direction: column; min-width: 0; -webkit-user-select: none; user-select: none; }
.notes .card:hover { border-color: var(--h-border-strong); }
.notes .card .thumb { aspect-ratio: 4 / 3; background: #FFFEFB; border-bottom: 1px solid var(--h-border); position: relative; overflow: hidden; display: block; }
.notes .card .thumb.lines { background-image: repeating-linear-gradient(to bottom, transparent 0 15px, #D6DCE8 15px 16px); }
.notes .card .thumb.grid { background-image: repeating-linear-gradient(to bottom, transparent 0 11px, #DDE2EC 11px 12px), repeating-linear-gradient(to right, transparent 0 11px, #DDE2EC 11px 12px); }
.notes .card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.notes .card .thumb.textthumb { padding: 8px 10px; font-size: var(--h-fs-12); line-height: 1.4; color: var(--h-text); white-space: pre-line; word-break: break-word; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.notes .card .meta { padding: 8px 10px 10px; }
.notes .card .name { font-weight: var(--h-fw-sem); font-size: var(--h-fs-14); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes .card .date { color: var(--h-text-muted); font-size: var(--h-fs-12); margin-top: 2px; font-family: var(--h-font-mono); }
.notes .card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.notes .card .tag { font-size: var(--h-fs-12); }
.empty { margin: 24vh auto 0; max-width: 520px; padding: 0 var(--h-sp-4); text-align: center; color: var(--h-text-muted); font-size: var(--h-fs-14); line-height: var(--h-lh-loose); }
.home-version { margin: var(--h-sp-5) var(--h-sp-1) 0; color: var(--h-text-muted); font-size: var(--h-fs-12); font-family: var(--h-font-mono); }
.home-version:empty { display: none; }
@media (max-width: 759px) {
    .nt-new { flex-basis: 100%; }
    .nt-new .h-btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
    .nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 760px) and (max-width: 1099px) {
    .nt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* kalendarz: siatka miesiąca i lista dnia w tokenach (dni jako kwadraty z obrysem, dziś z niebieską ramką) */
.calendar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--h-sp-3); align-content: start; margin-top: var(--h-sp-3); }
@media (max-width: 860px) { .calendar { grid-template-columns: 1fr; } }
.cal-main { background: var(--h-surface); border: 1px solid var(--h-border); padding: var(--h-sp-3); min-width: 0; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: var(--h-sp-2); }
.cal-head h2 { flex: 1 1 auto; margin: 0; font-size: var(--h-fs-16); font-weight: var(--h-fw-sem); text-align: center; text-transform: capitalize; }
.cal-head .h-icon-btn { width: 40px; height: 40px; color: var(--h-text); }
.cal-head .h-btn { min-height: 40px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 0 6px; text-align: center; font-size: var(--h-fs-11); font-weight: var(--h-fw-sem); letter-spacing: .4px; text-transform: uppercase; color: var(--h-text-muted); }
.cal-dow span:nth-child(n+6) { color: var(--h-error); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-cell { min-height: 88px; min-width: 0; background: var(--h-bg); border: 1px solid var(--h-border); padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.other { opacity: .45; }
.cal-cell.sel { background: var(--h-surface); border-color: var(--h-border-strong); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--h-accent); }
.cal-cell .num { font-size: var(--h-fs-13); font-weight: var(--h-fw-sem); color: var(--h-text-muted); font-family: var(--h-font-mono); font-variant-numeric: tabular-nums; }
.cal-cell.today .num { color: var(--h-accent); }
.chip { appearance: none; border: 0; text-align: left; font: inherit; font-size: var(--h-fs-11); font-weight: var(--h-fw-sem); line-height: 1.3; color: #fff; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; background: var(--h-accent); display: block; width: 100%; }
.chip.rem::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 5px; vertical-align: 1px; }
.more { font-size: var(--h-fs-11); color: var(--h-text-muted); padding-left: 2px; }
.cal-side { display: flex; flex-direction: column; gap: var(--h-sp-3); min-width: 0; }
.side-sec h3 { margin: 0; }
.side-sec h3::first-letter { text-transform: uppercase; }
.side-list { display: flex; flex-direction: column; padding: var(--h-sp-2) var(--h-sp-3); }
.side-item { appearance: none; border: 0; border-top: 1px solid var(--h-border); background: none; padding: 8px 4px; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font: inherit; text-align: left; cursor: pointer; color: var(--h-text); min-height: 44px; }
.side-item:first-child { border-top: none; }
.side-item:hover { background: var(--h-bg); }
.side-item .t { font-weight: var(--h-fw-med); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .s { color: var(--h-text-muted); font-size: var(--h-fs-12); font-family: var(--h-font-mono); white-space: nowrap; }
.side-empty { color: var(--h-text-muted); font-size: var(--h-fs-13); margin: 4px 0; }
.side-actions { display: flex; gap: 8px; padding: var(--h-sp-2) var(--h-sp-3) var(--h-sp-3); }
.side-actions .h-btn { flex: 1 1 auto; min-height: 40px; }

/* -- logowanie (od 0.9.6 warstwa nad każdym modułem, crm/notatki-dane.js): pełny ekran albo mała karta nad notatką -- */
.login { position: fixed; inset: 0; z-index: 1300; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: var(--h-bg); }
.login-box { width: min(380px, 100%); background: var(--h-surface); border: 1px solid var(--h-border); box-shadow: var(--h-shadow-lg); padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.login-box img { align-self: center; }
.login-box h1 { margin: 0; font-size: var(--h-fs-22); font-weight: var(--h-fw-sem); }
.login-box .muted { color: var(--h-text-muted); margin: 0; font-size: var(--h-fs-14); }
.login-box .h-input { font-size: 17px; min-height: 46px; text-align: center; }
.login-box .err { margin: 0; color: var(--h-error); font-size: var(--h-fs-13); min-height: 1.2em; }
/* nad otwartą notatką (sesja wygasła w trakcie pisania): mała karta w rogu, notatka zostaje i pisać da się dalej */
.login.sheet { z-index: 1300; background: transparent; pointer-events: none; padding: 0; justify-content: flex-start; align-items: flex-end; padding-top: calc(60px + env(safe-area-inset-top)); padding-right: calc(10px + env(safe-area-inset-right)); padding-left: 10px; }
.login.sheet .login-box { pointer-events: auto; width: min(340px, 100%); padding: 16px; gap: 10px; }
.login.sheet .login-box img, .login.sheet .login-box h1 { display: none; }
@media (max-width: 560px) {
    .login.sheet { align-items: stretch; padding-top: calc(56px + env(safe-area-inset-top)); padding-left: calc(8px + env(safe-area-inset-left)); padding-right: calc(8px + env(safe-area-inset-right)); }
    .login.sheet .login-box { width: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 10px; text-align: left; }
    .login.sheet .login-box .muted { grid-column: 1 / -1; font-size: var(--h-fs-13); }
    .login.sheet .login-box .h-input { grid-row: 2; grid-column: 1; min-width: 0; min-height: 40px; padding: 8px 10px; font-size: 16px; text-align: left; }
    .login.sheet .login-box .h-btn { grid-row: 2; min-height: 40px; padding: 6px 12px; }
    .login.sheet .login-box .err { grid-column: 1 / -1; grid-row: 3; }
    .login.sheet .login-box .err:empty { display: none; }
}

/* -- bez sesji (artefakt, file:, przed zalogowaniem): menu pokazuje same Notatki, bez Konta w pasku -- */
body.bez-sesji .sidebar a:not(#nav-notatki) { display: none; }
body.bez-sesji #tb-konto { visibility: hidden; }

/* -- Zespół (od 0.9.8, crm/zespol.js) -- */
.zs { display: flex; flex-direction: column; gap: var(--h-sp-3); max-width: 1100px; }
.zs-bar { display: flex; align-items: center; gap: var(--h-sp-2); flex-wrap: wrap; }
.zs-sp { flex: 1 1 auto; }
.zs-count { color: var(--h-text-muted); font-size: var(--h-fs-13); font-family: var(--h-font-mono); }
.zs-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--h-sp-3); }
.zs-os { display: flex; flex-direction: column; gap: 3px; padding: var(--h-sp-3) var(--h-sp-4); color: var(--h-text); text-decoration: none; min-height: 44px; }
.zs-os:hover { background: var(--h-bg); }
.zs-os-n { font-weight: var(--h-fw-sem); font-size: var(--h-fs-15); overflow-wrap: anywhere; }
.zs-os-r { color: var(--h-text); font-size: var(--h-fs-13); }
.zs-os-m { color: var(--h-text-muted); font-size: var(--h-fs-12); font-family: var(--h-font-mono); }
.zs-imie { margin: 0 0 2px; font-size: 20px; font-weight: var(--h-fw-sem); overflow-wrap: anywhere; }
.zs-tekst { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--h-fs-14); line-height: var(--h-lh-loose); }
.zs-noty { display: flex; flex-direction: column; gap: var(--h-sp-2); }
.zs-dzien { margin: var(--h-sp-3) 0 0; font-size: var(--h-fs-13); font-weight: var(--h-fw-sem); color: var(--h-text-muted); text-transform: capitalize; }
.zs-nota { background: var(--h-surface); border: 1px solid var(--h-border); padding: var(--h-sp-2) var(--h-sp-3); }
.side-sec .zs-nota { margin-bottom: var(--h-sp-2); background: var(--h-bg); }
.zs-nota-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.zs-nota-h strong { overflow-wrap: anywhere; }
.cal-cell .chip { cursor: inherit; }

/* -- notatki odręczne przy zadaniu (od 0.9.9, crm/zadania.js) -- */
.tkm-notes { display: flex; flex-direction: column; gap: var(--h-sp-2); }
.tkm-nota { position: relative; border: 1px solid var(--h-border); background: var(--h-surface); }
.tkm-nota-o { display: flex; align-items: center; gap: var(--h-sp-3); width: 100%; min-height: 56px; padding: 6px 40px 6px 6px; border: 0; background: none; font: inherit; text-align: left; color: var(--h-text); text-decoration: none; cursor: pointer; }
a.tkm-nota-o:hover, button.tkm-nota-o:hover { background: var(--h-bg); }
.tkm-nota-o.is-brak { cursor: default; color: var(--h-text-muted); }
.tkm-nota-m { flex: 0 0 44px; height: 52px; display: flex; align-items: center; justify-content: center; background: var(--h-bg); border: 1px solid var(--h-border); overflow: hidden; color: var(--h-text-muted); }
.tkm-nota-m img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tkm-nota-t { display: flex; flex-direction: column; min-width: 0; }
.tkm-nota-t b { font-weight: var(--h-fw-sem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkm-nota-t small { color: var(--h-text-muted); font-size: var(--h-fs-12); }
.tkm-nota-akcje { display: flex; gap: var(--h-sp-2); flex-wrap: wrap; }
.tkm-nota > .tkm-att-x { top: 50%; transform: translateY(-50%); }
.tkm-nw { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin-bottom: var(--h-sp-3); }
.tkm-nw-r { padding-right: 6px; border: 1px solid var(--h-border); background: var(--h-surface); }
.tkm-nota .tkm-att-x { opacity: 1; }
