/* Стили раздела «Заметки»: лента, «По дням», фильтры, папки, поиск, этикетки, блоки «Дописать» в открытой записи (часть 2, этап 2.2; SPEC-NEW-LOOK-2, 1.5).
   Наполняет этап 2.2 и больше никто. Корень раздела — #notesRoot (класс notes-root) внутри #scrNotes: когда экран нарисован, 114-notes.js ставит #scrNotes класс nl-on, и заглушка «Скоро» прячется.
   Классы экрана — с приставкой nl-, открытая запись (105-note.js; основа её стилей — 45-chat.css) — nt-. Только переменные из 10-tokens.css (свои — в блоке «часть 2 · 2.2»):
   цветов, радиусов и размеров текста числами здесь быть не должно (сторож — tests/web-tokens.test.ts). */

/* окно «Название» (новая папка, новая этикетка) — выше открытой записи и окна выбора, как остальные маленькие листы */
#noteName { z-index: 54; }

/* ---------- раздел ---------- */
#scrNotes.nl-on { padding: 0; align-items: stretch; justify-content: flex-start; gap: 0; text-align: start; }
#scrNotes.nl-on > h2, #scrNotes.nl-on > p { display: none; }
.notes-root { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

/* вверху: «Лента · По дням» и (в «По дням») лупа */
.nl-top { flex: none; display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-8) var(--sp-10) var(--gutter); }
.nl-seg { flex: 1; min-width: 0; display: flex; padding: var(--sp-4); border-radius: var(--r-seg); background: var(--c-field); }
.nl-seg button { flex: 1; min-height: var(--seg-h); border-radius: var(--r-seg-in); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-medium); color: var(--c-text-2); }
.nl-seg button[aria-selected="true"] { background: var(--c-raised); color: var(--c-text); font-weight: var(--fw-semibold); box-shadow: 0 1px 2px color-mix(in srgb, var(--c-shade) var(--shade-weak), transparent); }
.nl-find-btn { margin-left: var(--sp-4); }

/* всё остальное прокручивается вместе */
.nl-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gutter) calc(var(--nl-fab) + var(--sp-24) + var(--sp-16)); }

/* поиск */
.nl-find { display: flex; align-items: center; gap: var(--sp-8); min-height: 40px; padding: 0 var(--sp-4) 0 var(--sp-12); border-radius: var(--r-12); background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-edge); }
.nl-find > .ico { flex: none; width: 17px; height: 17px; color: var(--c-text-2); }
.nl-find input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; outline: none; font-family: inherit; font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--c-text); }
.nl-find input::placeholder { color: var(--c-text-2); }
.nl-find-x { flex: none; width: var(--tap); height: 40px; display: grid; place-items: center; border-radius: var(--r-round); color: var(--c-text-2); }
.nl-find-x .ico { width: 16px; height: 16px; }

/* этикетки-фильтры: ряд листается вбок */
.nl-chips, .nl-folders { display: flex; gap: var(--sp-6); margin: var(--sp-10) calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.nl-chips::-webkit-scrollbar, .nl-folders::-webkit-scrollbar { display: none; }
.nl-chip {
  flex: none; height: var(--nl-chip-h); padding: 0 var(--sp-12); border-radius: var(--r-pill);
  border: 1px solid var(--c-line); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--c-text); white-space: nowrap;
}
.nl-chip i, .nl-folder-n i { font-style: normal; font-weight: var(--fw-regular); color: var(--c-text-2); }
.nl-chip[data-tone="idea"] { border-color: color-mix(in srgb, var(--c-tag-idea-text) 38%, transparent); color: var(--c-tag-idea-text); }
.nl-chip[data-tone="instruction"] { border-color: color-mix(in srgb, var(--c-tag-instr-text) 38%, transparent); color: var(--c-tag-instr-text); }
.nl-chip[data-tone="contact"] { border-color: color-mix(in srgb, var(--c-tag-contact-text) 38%, transparent); color: var(--c-tag-contact-text); }
.nl-chip[data-tone="custom"] { border-color: color-mix(in srgb, var(--c-tag-custom-text) 38%, transparent); color: var(--c-tag-custom-text); }
.nl-chip[aria-pressed="true"] { border-color: transparent; background: var(--c-text); color: var(--c-inverse); font-weight: var(--fw-semibold); }
.nl-chip[aria-pressed="true"] i { color: inherit; opacity: .6; }

/* папки плитками и «+» */
.nl-folders { gap: var(--sp-8); }
.nl-folder {
  flex: none; width: var(--nl-folder-w); min-height: var(--nl-folder-h); box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  padding: var(--sp-8) var(--sp-10); border-radius: var(--r-12); background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-edge); color: var(--c-text); text-align: left;
}
.nl-folder > .ico { width: 18px; height: 18px; color: var(--nl-fc); }
.nl-folder-n { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-semibold); }
.nl-folder[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--nl-fc); }
.nl-folder-new { width: 60px; align-items: center; justify-content: center; border: 1px dashed var(--c-line); background: transparent; box-shadow: none; color: var(--c-text-2); }
.nl-folder-new > .ico { width: 20px; height: 20px; color: inherit; }
.nl-fhead { display: flex; align-items: center; gap: var(--sp-8); margin-top: var(--sp-12); }
.nl-fhead-t { flex: 1; min-width: 0; font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-fhead-b { flex: none; min-height: var(--tap); padding: 0 var(--sp-12); border-radius: var(--r-pill); color: color-mix(in srgb, var(--c-accent) 75%, var(--c-text)); font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.nl-fhead-x { flex: none; }

/* этикетка записи: цвет по виду */
.nl-tag, .nl-hit-h .nl-tag {
  display: inline-block; padding: var(--sp-2) var(--sp-6); border-radius: var(--r-8); background: var(--c-tag-note-bg); color: var(--c-tag-note-text);
  font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-bold); letter-spacing: var(--ls-caps); text-transform: uppercase; white-space: nowrap;
}
.nl-tag[data-tone="idea"] { background: var(--c-tag-idea-bg); color: var(--c-tag-idea-text); }
.nl-tag[data-tone="instruction"] { background: var(--c-tag-instr-bg); color: var(--c-tag-instr-text); }
.nl-tag[data-tone="contact"] { background: var(--c-tag-contact-bg); color: var(--c-tag-contact-text); }
.nl-tag[data-tone="custom"] { background: var(--c-tag-custom-bg); color: var(--c-tag-custom-text); }
.nl-tag[data-tone="task"] { background: var(--c-tag-task-bg); color: var(--c-tag-task-text); }
.nl-tag[data-tone="file"] { background: var(--c-tag-file-bg); color: var(--c-tag-file-text); }

/* «Лента»: карточки */
.nl-list { display: flex; flex-direction: column; gap: var(--sp-8); margin-top: var(--sp-12); }
.nl-card, .nl-hit {
  display: block; width: 100%; box-sizing: border-box; min-height: var(--tap); padding: var(--sp-10) var(--sp-12); border-radius: var(--r-14);
  background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-edge); color: var(--c-text); text-align: left;
}
.nl-card:active, .nl-hit:active, .nl-row:active { background: var(--c-field); }
.nl-card-h, .nl-hit-h { display: flex; align-items: center; gap: var(--sp-8); }
.nl-when { margin-left: auto; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--c-text-2); white-space: nowrap; }
.nl-card-t, .nl-hit-t { display: block; margin-top: var(--sp-6); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.nl-card-b { display: flex; align-items: flex-start; gap: var(--sp-10); margin-top: var(--sp-4); }
.nl-card-x, .nl-row-x, .nl-hit-s {
  flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  font-size: var(--fs-small); line-height: var(--lh-small); color: var(--c-text-2);
}
.nl-pv { flex: none; display: block; width: var(--nl-pv-w); height: var(--nl-pv-h); overflow: hidden; border-radius: var(--r-8); background: var(--c-raised); }
.nl-pv img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* «По дням» */
.nl-day-h { margin: var(--sp-14) var(--sp-2) var(--sp-6); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-semibold); color: var(--c-text-2); }
.nl-day:first-child .nl-day-h { margin-top: var(--sp-12); }
.nl-day-card { padding: 0 var(--sp-12); border-radius: var(--r-14); background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-edge); }
.nl-row { display: flex; gap: var(--sp-12); width: 100%; box-sizing: border-box; min-height: var(--tap); padding: var(--sp-12) 0; border-top: 1px solid var(--c-line); color: var(--c-text); text-align: left; }
.nl-row:first-child { border-top: 0; }
.nl-time { flex: none; width: 40px; padding-top: var(--sp-2); font-size: var(--fs-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; color: var(--c-text-2); }
.nl-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
.nl-row-t { display: block; font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.nl-row-x { flex: none; }
.nl-thumbs { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin-top: var(--sp-6); }
.nl-thumbs .nl-pv { width: var(--nl-thumb); height: var(--nl-thumb); }

/* результаты поиска */
.nl-hit-w { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--c-text-2); }
.nl-hit-s { display: -webkit-box; margin-top: var(--sp-2); }
.nl-hit mark { background: color-mix(in srgb, var(--c-accent) 28%, transparent); color: inherit; }

/* пусто */
.nl-empty { padding: var(--sp-24) var(--sp-16); text-align: center; color: var(--c-text-2); }
.nl-empty b { display: block; margin-bottom: var(--sp-6); font-size: var(--fs-strong); line-height: var(--lh-strong); font-weight: var(--fw-semibold); color: var(--c-text); }
.nl-empty p { margin: 0 auto; max-width: 20em; font-size: var(--fs-body); line-height: var(--lh-body); }

/* «Сказать ассистенту» */
.nl-fab {
  position: absolute; right: var(--sp-16); bottom: var(--sp-16); width: var(--nl-fab); height: var(--nl-fab); display: grid; place-items: center; border-radius: var(--r-round);
  background: var(--c-text); color: var(--c-inverse); box-shadow: var(--shadow-pop);
}
.nl-fab .ico { width: 22px; height: 22px; }

/* ---------- открытая запись (105-note.js) ---------- */
.nt-top.nt-top-note { grid-template-columns: 1fr auto auto; gap: var(--sp-4); padding-right: var(--sp-8); }
.nt-more .ico { width: 22px; height: 22px; }
.nt-tags { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin: 0 0 var(--sp-12); }
.nt-chip {
  display: inline-flex; align-items: center; gap: var(--sp-6); min-height: var(--tap-chip); max-width: 100%; padding: 0 var(--sp-10) 0 var(--sp-12); border-radius: var(--r-10);
  font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-semibold); white-space: nowrap; position: relative;
}
.nt-chip::after { content: ""; position: absolute; inset: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-2)); }
.nt-chip .ico { flex: none; width: 14px; height: 14px; }
.nt-lab { background: var(--c-tag-note-bg); color: var(--c-tag-note-text); font-weight: var(--fw-bold); letter-spacing: var(--ls-caps); text-transform: uppercase; }
.nt-lab[data-tone="idea"] { background: var(--c-tag-idea-bg); color: var(--c-tag-idea-text); }
.nt-lab[data-tone="instruction"] { background: var(--c-tag-instr-bg); color: var(--c-tag-instr-text); }
.nt-lab[data-tone="contact"] { background: var(--c-tag-contact-bg); color: var(--c-tag-contact-text); }
.nt-lab[data-tone="custom"] { background: var(--c-tag-custom-bg); color: var(--c-tag-custom-text); }
.nt-fld { background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-edge); color: var(--c-text); font-weight: var(--fw-medium); }
.nt-fld::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: var(--r-round); background: var(--nt-fc, var(--c-text-2)); }
.nt-fld[data-none] { background: transparent; box-shadow: inset 0 0 0 1px var(--c-line); color: var(--c-text-2); }
.nt-fld[data-none]::before { background: transparent; box-shadow: inset 0 0 0 1px var(--c-text-2); }
.nt-chip[data-busy] { opacity: .6; }
.nt-meta { margin: var(--sp-4) 0 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--c-text-2); }
.nt-meta:empty { display: none; }
.nt-adds { display: flex; flex-direction: column; gap: var(--sp-10); margin-top: var(--sp-12); }
.nt-adds:empty { display: none; }
.nt-add { padding: var(--sp-10) var(--sp-12); border-radius: var(--r-14); background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-edge); }
.nt-add-h { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--c-text-2); }
.nt-add-text {
  display: block; width: 100%; margin: var(--sp-4) 0 0; padding: 0; border: 0; background: none; color: var(--c-text); font-family: var(--font-ui);
  font-size: var(--fs-lead); line-height: var(--lh-lead); resize: none; overflow: hidden; outline: none; overflow-wrap: break-word;
}
.nt-add-text::placeholder { color: var(--c-text-2); }
.nt-bar { grid-template-columns: 1fr 1fr; }
.nt-append .ico { width: 20px; height: 20px; margin-right: var(--sp-8); }
