/* ============================================================================
   15b-notatki.css — kartoteka „Notatki” wg zatwierdzonego wyglądu (v15-b5, 02.10.2026)
   ----------------------------------------------------------------------------
   Wzór: scratchpad/pulpit/Notatki.html (notatki_nowy_czesc.txt). Renderer: public/js/zadania/akcje-zadan-i-notatki.js
   (renderZnNotatki, renderNoteTopicRow, renderNoteTopicPanel, renderNoteShare), zachowanie: zadania/notatki-ekran.js.
   JEDNA karta: Tematy (lewa kolumna, 320 px) | temat (lista notatek → notatka). Nagłówki 64 px z linią, każda kolumna
   przewija się osobno, pasek działań notatki przyklejony na dole panelu. Edytor (richTextEditor) jest wspólny z Czatem —
   wszystkie reguły edytora są tu ZAWĘŻONE do `.note-editor2` (wygląd Czatu nie jest jeszcze zatwierdzony).
   Telefon: 9-telefon/4c-notatki.css. Kolory, krój i odstępy — tokeny programu, progi z kanonu.
   ============================================================================ */
/* --- Karta widoku --- */
/* v15 b19 (ZN3): odstęp strony jak we wzorze — komputer 16 / 32 / 24 px, do 1180 px 12 / 16 / 12 px (telefon: 9-telefon/4c-notatki.css). */
@media (min-width: 1181px) { .content:has(.zn-notes) { --margines-roboczy-x: var(--s-6); --margines-roboczy-dol: var(--s-5); } }
@media (max-width: 1180px) { :root:not([data-ui="mobile"]) .content:has(.zn-notes) { --margines-roboczy-y: var(--s-3); --margines-roboczy-x: var(--s-4); --margines-roboczy-dol: var(--s-3); } }
.zn-notes { display: grid; grid-template-columns: 320px minmax(0, 1fr); flex: 1; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--cien-1); }
/* --- Lewa kolumna: tematy --- */
.zn-notes-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.notes2-head { display: flex; flex: none; align-items: center; min-height: 64px; padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--line); }
.notes2-lbl { margin: 0; color: var(--text); font-family: var(--font-tytul); font-size: var(--t-md); font-weight: var(--w-bold); line-height: var(--lh-base); }
.notes2-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s-2); }
.notes2-topics { display: flex; flex-direction: column; gap: 2px; }
.notes2-empty { padding: var(--s-5) var(--s-3); color: var(--text-faint); line-height: 1.5; text-align: center; }
.notes2-add { padding: var(--s-2) var(--s-1) var(--s-1); }
.notes2-add > .button { width: 100%; }
.note-topic-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: var(--r-sm); }
.note-topic-row:hover { background: var(--surface-2); }
.note-topic-row.is-sel { background: var(--accent-soft); }
.note-topic-main { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: 56px; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.note-topic-main:focus-visible, .note-row-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.note-topic-name { overflow: hidden; font-size: var(--t-base); font-weight: var(--w-bold); text-overflow: ellipsis; white-space: nowrap; }
.note-topic-row.is-sel .note-topic-name { color: var(--accent-strong); }
.note-topic-sub { display: flex; align-items: center; gap: var(--s-1); min-width: 0; color: var(--text-faint); font-size: var(--t-xs); white-space: nowrap; }
.note-topic-sub > * { flex-shrink: 0; }
.note-topic-sub > .note-topic-owner { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Poziom dostępu do tematu — prywatny / wgląd / edycja. */
.note-badge { --ton: var(--text-muted); padding: 0 var(--s-2); border-radius: var(--r-pill); background: color-mix(in srgb, var(--ton) 14%, var(--surface)); color: var(--ton); font-size: var(--t-xs); font-weight: var(--w-bold); line-height: 18px; white-space: nowrap; }
.note-badge.view { --ton: var(--accent-strong); }
.note-badge.edit { --ton: var(--ok-strong); }
/* Akcje tematu (Udostępnij / Usuń) i notatki (Usuń) — pod kursorem, przy wybranym i przy fokusie z klawiatury. */
.note-topic-acts { display: flex; gap: 2px; padding-right: var(--s-1); opacity: 0; transition: opacity var(--szybko); }
.note-topic-row:hover .note-topic-acts, .note-topic-row.is-sel .note-topic-acts, .note-row:hover .note-topic-acts, .note-topic-acts:focus-within { opacity: 1; }
.note-topic-act { display: inline-grid; place-items: center; width: var(--h-control); height: var(--h-control); padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-faint); cursor: pointer; }
.note-topic-act:hover { background: var(--accent-soft); color: var(--accent-strong); }
.note-topic-act.is-danger:hover { background: var(--danger-soft); color: var(--danger); }
/* --- Prawa kolumna: temat --- */
.zn-notes-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.note-panel-empty { display: grid; flex: 1; place-items: center; padding: var(--s-6); color: var(--text-faint); line-height: 1.5; text-align: center; }
.note-topic-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.note-panel-head { display: flex; flex: none; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-2) var(--s-4) var(--s-2) var(--s-5); border-bottom: 1px solid var(--line); }
.note-panel-back { display: none; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: calc(var(--s-2) * -1); padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--accent-strong); cursor: pointer; }
.note-panel-back:hover { background: var(--accent-soft); }
.note-panel-back .icon { width: 18px; height: 18px; }
.note-panel-title { flex: 1; min-width: 0; }
.note-panel-title h3 { margin: 0; overflow: hidden; font-family: var(--font-tytul); font-size: var(--t-md); font-weight: var(--w-bold); line-height: var(--lh-base); text-overflow: ellipsis; white-space: nowrap; }
.note-panel-title small { display: block; margin-top: 2px; color: var(--text-faint); font-size: var(--t-xs); }
.note-panel-body { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; padding: var(--s-3) var(--s-5) var(--s-4); }
/* Lista notatek: płaskie wiersze z kreską, „Autor · data” z prawej. */
.note-panel-list { display: flex; flex-direction: column; }
.note-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--line-soft); }
.note-row:hover { background: var(--surface-2); }
.note-row-main { display: flex; align-items: center; gap: var(--s-3); min-width: 0; min-height: 52px; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-1); border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.note-row-title { flex: 1; min-width: 0; overflow: hidden; font-weight: var(--w-bold); text-overflow: ellipsis; white-space: nowrap; }
.note-row-sub { flex: none; color: var(--text-faint); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.note-new-btn { align-self: flex-end; margin-top: var(--s-3); }
.note-info { margin: var(--s-2) 0 0; color: var(--text-muted); }
.note-dz { margin: auto 0 0; padding-top: var(--s-4); color: var(--text-faint); font-size: var(--t-xs); }
/* --- Notatka: tytuł bez ramki, edytor na wysokość panelu, pasek działań na dole --- */
.note-editor2 { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.note-editor2-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--s-2); border-bottom: 1px solid var(--line-soft); }
.note-editor2-head:focus-within { border-bottom-color: var(--accent); }
.note-editor2-sub { color: var(--text-faint); font-size: var(--t-xs); font-weight: var(--w-bold); }
.note-editor2 .note-editor2-head > input.note-editor2-title { width: 100%; height: auto; min-height: var(--h-control); padding: var(--s-1) 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); font-family: var(--font-tytul); font-size: var(--t-xl); font-weight: var(--w-bold); letter-spacing: -.01em; cursor: text; }
.note-editor2-audit { margin: var(--s-2) 0 var(--s-3); color: var(--text-faint); font-size: var(--t-sm); }
.note-rich-content { line-height: var(--lh-base); }
.note-editor2 .rich-editor { display: flex; flex: 1 0 auto; flex-direction: column; min-height: 260px; overflow: visible; }
.note-editor2 .rich-toolbar { position: sticky; top: calc(var(--s-3) * -1); z-index: 2; gap: 2px; border-bottom-color: var(--line-soft); border-radius: var(--r) var(--r) 0 0; background: var(--surface); }
.note-editor2 .rich-toolbar :is(button, .rich-image-button) { gap: var(--s-1); min-width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); font-size: var(--t-base); font-weight: var(--w-regular); }
.note-editor2 .rich-toolbar .icon { width: 16px; height: 16px; }   /* wzór: ikony paska 16 px */
.note-editor2 .rich-toolbar :is(button, .rich-image-button):hover { background: var(--surface-3); color: var(--text); }
.note-editor2 .rich-toolbar :is(button.is-active, [aria-pressed="true"], [aria-expanded="true"]) { border-color: transparent; background: var(--accent-soft); color: var(--accent-strong); }
/* Listy „Tekst” i „Skala” jak we wzorze (.cz-nar select): natywna strzałka, bez ramki, odstęp 0 4 px, promień 8. */
.note-editor2 .rich-toolbar select { height: 32px; min-height: 32px; padding: 0 var(--s-1); border: 0; border-radius: var(--r-sm); background: transparent; box-shadow: none; appearance: auto; color: var(--text-muted); }
.note-editor2 .rich-toolbar select:hover { background: var(--surface-3); }
.note-editor2 .task-rich-notes .rich-editable { flex: 1; min-height: 200px; max-height: none; overflow: visible; }
.note-editor2-actions { display: flex; flex: none; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); background: var(--surface); }
.note-editor2-actions > .spacer { flex: 1; }
.note-editor2-actions > .button { flex: none; }
/* „Przypomnienie”: bursztynowy obrys; ustawione — bursztynowe tło i data (dawniej kolory inline z !important). */
.button.ghost.note-back-btn { border-color: var(--line-strong); background: var(--surface); color: var(--text); }   /* wzór: „← Notatki” to zwykły przycisk z ramką */
.button.ghost.note-back-btn:hover { background: var(--surface-2); }
.button.note-remind-btn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--surface); color: var(--warn-strong); }
.button.note-remind-btn:hover, .button.note-remind-btn.has-reminder { background: var(--warn-soft); }
/* „Zapisz” → zielone „Zapisano” na 1,8 s (flashNoteSaved dokłada klasę; dawniej style inline z !important). */
.note-editor2-actions > .button.primary.note-save-btn.is-zapisano, .note-editor2-actions > .button.primary.note-save-btn.is-zapisano:disabled { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); color: var(--ok-strong); opacity: 1; cursor: default; }
/* „Obraz” z podpisem (jak we wzorze); w innych edytorach podpis zostaje tylko dla czytnika ekranu. */
.note-editor2 .rich-toolbar .rich-image-button { padding: 0 var(--s-1); }
.note-editor2 .rich-toolbar .rich-image-button > span:not(.icon) { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
/* „Kto pisał” w Notatkach: każdy akapit w ramce, podpis „Imię Nazwisko · data” NAD nim jako pigułka w kolorze działu autora
   (--autor-kolor, napis --autor-napis z kontrastem WCAG — okna/edytor-tekstu.js). Czat zostaje przy podpisie pod akapitem. */
.note-editor2 .rich-editor.pokaz-autorow [data-rich-editable] [data-podpis] { position: relative; margin: var(--s-5) 0 var(--s-2); padding: var(--s-1) var(--s-2); border: 1px solid color-mix(in srgb, var(--autor-kolor, var(--accent)) 45%, var(--line-strong)); border-radius: var(--r-sm); background: transparent; }
.note-editor2 .rich-editor.pokaz-autorow [data-rich-editable] .rt-check[data-podpis] { display: flex; }
.note-editor2 .rich-editor.pokaz-autorow [data-rich-editable] :is(ul, ol)[data-podpis] { padding-left: var(--s-5); }
.note-editor2 .rich-editor.pokaz-autorow [data-rich-editable] [data-podpis]::after { position: absolute; top: -21px; left: var(--s-2); max-width: calc(100% - var(--s-4)); margin: 0; padding: 0 var(--s-2); overflow: hidden; border: 0; border-radius: var(--r-pill); background: var(--autor-kolor, var(--accent)); color: var(--autor-napis, var(--on-accent)); font-size: var(--t-xs); line-height: 18px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.note-editor2 .rich-editor.pokaz-autorow [data-rich-editable] > :first-child[data-podpis] { margin-top: var(--s-4); }
/* Ciemny motyw: kolor działu bywa bardzo ciemny (domyślny #1f2a44) i pigułka znikała na tle — tło = kolor działu rozjaśniony
   napisem i zmieszany z powierzchnią (widoczne na --surface), napis jasny --text (kontrast > 4,5 : 1). Tylko w Notatkach. */
:root[data-theme="dark"] .note-editor2 .rich-editor.pokaz-autorow [data-rich-editable] [data-podpis]::after { background: color-mix(in srgb, color-mix(in srgb, var(--autor-kolor, var(--accent)) 60%, var(--text)) 35%, var(--surface)); color: var(--text); }
/* Powiększony edytor (notatki-ekran.js): notatka zajmuje cały panel — znika nagłówek tematu, tytuł, autor i Dziennik. */
.note-topic-panel.is-pelny :is(.note-panel-head, .note-editor2-head, .note-editor2-audit, .note-dz) { display: none; }
/* --- Udostępnianie tematu: osoba + przełącznik Brak / Wgląd / Edycja --- */
.note-share-hint { margin: 0 0 var(--s-3); color: var(--text-muted); line-height: var(--lh-base); }
.note-share-list { display: flex; flex-direction: column; }
.note-share-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.note-share-who { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: var(--lh-tight); }
.note-share-who b { overflow: hidden; font-weight: var(--w-bold); text-overflow: ellipsis; white-space: nowrap; }
.note-share-who small { color: var(--text-muted); font-size: var(--t-xs); }
.note-share-seg { display: inline-grid; flex-shrink: 0; grid-auto-flow: column; gap: 3px; padding: 3px; border-radius: var(--r); background: var(--surface-3); }
.note-share-seg button { min-width: 72px; height: var(--h-control); padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); font: inherit; font-weight: var(--w-bold); cursor: pointer; }
.note-share-seg button:hover { color: var(--text); }
.note-share-seg button.on { background: var(--surface); box-shadow: var(--cien-1); color: var(--text); }
.note-share-back { flex: none; }
/* --- Okno „Przypomnienie” notatki (handleNoteEntryRemind / handleNoteRemind — klasa .reminder-modal tylko tam) ---
   Wzór: małe okno, kalendarz z ‹ ›, dni 32 px (dziś w ramce, wybrany pełny niebieski, minione szare), „Godzina” — dwa pola
   76 px z „:”, szybkie terminy obramowane, stopka: „Usuń” (czerwony obrys) z lewej, „Anuluj”, „Ustaw”. Kalendarz (.rcal) ma
   dom w 15-zadania.css i służy też terminowi zadania — tu tylko w tym oknie. Telefon: arkusz od dołu (9-telefon/4c-notatki.css). */
.modal.reminder-modal { --okno-w: 420px; }
.modal.reminder-modal > header { padding: var(--s-4) var(--s-3) var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.modal.reminder-modal > header h2 { font-size: var(--t-lg); }
.modal.reminder-modal > header p { margin-top: 2px; font-size: var(--t-xs); }
.modal.reminder-modal > .reminder-picker { gap: var(--s-2); padding: var(--s-3) var(--s-4) var(--s-4); overflow-y: auto; }
.reminder-modal .rcal { gap: var(--s-2); }
.reminder-modal .rcal-head .icon-button { border-color: transparent; background: transparent; color: var(--text-muted); }
.reminder-modal .rcal-head .icon-button:hover { background: var(--surface-3); color: var(--text); }
.reminder-modal .rcal-title { font-weight: var(--w-strong); }
.reminder-modal .rcal-day { height: var(--h-control); color: var(--text); font-size: var(--t-base); font-variant-numeric: tabular-nums; }
.reminder-modal .rcal-day:hover { background: var(--surface-3); }
.reminder-modal .rcal-day.is-today { border-color: var(--line-strong); font-weight: var(--w-strong); }
.reminder-modal .rcal-day.is-past { color: var(--text-faint); }
.reminder-modal .rcal-day.is-sel { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: var(--w-strong); }
.reminder-modal .rtime { gap: var(--s-1); margin-top: var(--s-2); }
.reminder-modal .rtime .task-detail-label { margin: 0; color: var(--text-muted); font-size: var(--t-xs); font-weight: var(--w-bold); }
.reminder-modal .rtime-row > :is(select, .combo) { flex: 0 0 76px; width: 76px; min-width: 76px; }
.reminder-modal .rtime-row :is(select, .combo-input) { font-size: var(--t-md); font-weight: var(--w-bold); }
.reminder-modal .rtime-sep { color: var(--text-faint); font-size: var(--t-md); }
.reminder-modal .rquick { margin-top: var(--s-2); }
.reminder-modal .rquick > .button { height: var(--h-control); padding: 0 var(--s-3); border-color: var(--line-strong); background: var(--surface); font-size: var(--t-base); }
.reminder-modal .rquick > .button:hover { background: var(--surface-2); }
.modal.reminder-modal > footer { padding: var(--s-3) var(--s-4); }
.modal.reminder-modal > footer > .button[data-action$="-clear"] { order: -1; margin-right: auto; border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--surface); color: var(--danger); }
.modal.reminder-modal > footer > .button[data-action$="-clear"]:hover { background: var(--danger-soft); }
.modal.reminder-modal > footer > .button[data-action="close-modal"] { border-color: var(--line-strong); background: var(--surface); }
.modal.reminder-modal > footer > .button[data-action="close-modal"]:hover { background: var(--surface-2); }
@media (max-width: 980px) {
  .zn-notes { grid-template-columns: 260px minmax(0, 1fr); }
  .note-panel-head, .note-panel-body { padding-inline: var(--s-4); }
  .note-editor2-actions { padding-inline: var(--s-4); }
}
/* --- Tablet (dotyk): cele 44 px (--h-control), akcje tematu tylko przy wybranym, kosz notatki zawsze; formatowanie pod „Aa”
   (widać Aa, szkicownik i powiększ — jak Czat na telefonie; „Aa” obsługuje zdarzenia/akcje-czat.js). Telefon: 9-telefon/4c-notatki.css. --- */
:root[data-ui="tablet"] .zn-notes { grid-template-columns: 320px minmax(0, 1fr); }
:root[data-ui="tablet"] .note-topic-acts { opacity: 1; }
:root[data-ui="tablet"] .note-topic-row:not(.is-sel) .note-topic-acts { visibility: hidden; }
:root[data-ui="tablet"] .note-row .note-topic-acts { visibility: visible; }
:root[data-ui="tablet"] .note-panel-head { min-height: 68px; padding-left: var(--s-4); }
:root[data-ui="tablet"] .note-panel-body { padding: var(--s-3) var(--s-4) var(--s-4); }
:root[data-ui="tablet"] .note-editor2-actions { padding: var(--s-2) var(--s-4); }
:root[data-ui="tablet"] #content .note-row-main { min-height: 56px; }
:root[data-ui="tablet"] #modal-root .reminder-modal :is(.rcal-head .icon-button, header .modal-help-btn) { width: 44px; min-width: 44px; height: 44px; }
:root[data-ui="tablet"] .note-editor2 .rich-toolbar { gap: var(--s-1); }
/* #content: reguła dotyku z 03-kontrolki.css (min. 40 px dla każdego przycisku) ma wagę (0,7,1) — tu cel 44 px. */
:root[data-ui="tablet"] #content .note-editor2 .rich-toolbar :is(button, .rich-image-button) { min-width: 44px; height: 44px; }
:root[data-ui="tablet"] .note-editor2 .rich-toolbar select { min-width: 64px; height: 44px; min-height: 44px; }
:root[data-ui="tablet"] .note-editor2 .rich-toolbar .rich-aa-toggle { display: inline-flex; font-weight: var(--w-strong); }
:root[data-ui="tablet"] .note-editor2 .rich-editor:not(.is-format-open) .rich-toolbar > :is([data-rich-command], [data-rich-font-size], [data-rich-image-size], .rich-image-button, [data-action="rich-checklist"], .rich-emoji-wrap, .rich-authors-toggle, .combo:has([data-rich-font-size], [data-rich-image-size])) { display: none; }
@media (prefers-reduced-motion: reduce) { .note-topic-acts { transition: none; } }
