/* Заметки Yune (notes.js; макет mockups/yune-notes.html, владелец 23.11.2026). Окно — роль «всплывающее»
   (--surface-float, --float-line, --float-shadow — как окно солнца look.css); поиск — .lz-find (значок → поле, как на
   страницах, brand/pickers.css); меню привязки — .lz-cmenu;
   наведение — роль hover-role (roles.css: бугорок или «только цвет» по профилю), правка — бугорок, выбранная — обводка;
   «Новая задача» — главная.
   Здесь только раскладка */

/* значок: слева от солнца, та же роль «системная иконка»; без notes.js (Ложка) — нет */
html:not(.lz-notes-on) .lz-notes-open { display: none !important }
.rb-sidebar__brand .lz-notes-open { margin: 0 0 0 auto }
html.lz-notes-on .rb-sidebar__brand .lz-notes-open + .lz-look-open { margin-left: 0 }
.lz-notes-open[aria-expanded="true"] { color: var(--rb-ink); box-shadow: var(--yn-in, none) }
@media (max-width: 820px) {
  .rb-sidebar__brand .lz-notes-open { display: grid; width: 30px; height: 30px; margin: 0 0 0 auto }
  .rb-sidebar__brand .lz-notes-open .ic { width: 16px; height: 16px }
  html.lz-notes-on .rb-sidebar__brand .lz-notes-open + .lz-look-open { margin: 0 4px 0 0 }
}

/* ── окно ── */
.lz-nt { position: fixed; z-index: 90; left: 8px; top: 56px; width: 420px; max-width: calc(100vw - 16px); max-height: min(640px, calc(100vh - 72px));
  display: flex; flex-direction: column; border-radius: 20px;
  background: var(--surface-float, var(--rb-canvas)); box-shadow: var(--float-shadow, 0 12px 40px rgba(0, 0, 0, .14)), inset 0 0 0 1px var(--float-line, var(--rb-line));
  color: var(--rb-ink); font: 13px/1.45 var(--rb-font-body) }
.lz-nt[hidden] { display: none }
.lz-nt > * { flex: none; min-width: 0 }
.lz-nt > .lz-nt__list { flex: 0 1 auto; min-height: 0 }      /* список сжимается, шапка и низ — всегда на месте */
@media (prefers-reduced-motion: no-preference) {
  .lz-nt { transform-origin: var(--nt-origin, 24px 0); animation: lz-nt-in .18s cubic-bezier(.2, .8, .2, 1) }
  @keyframes lz-nt-in { from { opacity: 0; transform: translateY(-4px) scale(.98) } }
}
.lz-nt__head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 18px }
.lz-nt__head h3 { margin: 0; font: 600 15px/1.2 var(--rb-font-heading) }
.lz-nt__n { color: var(--rb-faint); font-size: 12.5px }
.lz-nt__head .lz-nt__find { margin-left: auto; min-width: 0 }
.lz-nt__head .lz-nt__find.is-searching { flex: 1 1 0 }
.lz-nt__head .lz-nt__find.is-searching .lz-models__search { flex: 1 1 auto; width: auto }
.lz-nt__head:has(.lz-nt__find.is-searching) .lz-nt__n { display: none }
.lz-nt__head .lz-nt__back { margin-left: -10px }
.lz-nt__ib { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 10px; background: transparent;
  color: var(--rb-muted); cursor: pointer; transition: box-shadow .2s, color .2s }
.lz-nt__ib:hover { color: var(--rb-ink) }
/* наведение и нажатие значков, меток, строк и кнопок выделения — роль hover-role (brand/roles.css, «наведение»): бугорок
   или «только цвет» — по выбору в профиле; здесь — только поверхность, на которой растёт бугорок */
.lz-nt, .lz-ntsel { --bump-bg: var(--surface-float, var(--rb-canvas)) }
.lz-nt__ib .ic { display: block; width: 17px; height: 17px }

/* поле новой заметки (notes.js newField) — строка заметки в правке, вид её же; здесь только раскладка: поля как у списка,
   текст — в одной строке с ✓ и ✕ (сведений над ним нет) */
.lz-nt__newbox { padding: 0 14px }
.lz-nt__note--new { margin: 2px 0 }
.lz-nt__note--new .lz-nt__body { grid-column: 2; grid-row: 1 }
.lz-nt__note--new.is-edit.is-empty .lz-nt__no { display: none }        /* пусто — стирать нечего */
/* сочетание «сохранить» (.lz-hotkey, app.css) — слева от ✓, только пока правят и курсор на ✓ */
.lz-nt__acts { align-items: center }
.lz-nt__key { display: none; margin: 0 2px 0 0; padding: 0 }
.lz-nt__note.is-edit .lz-nt__key { display: block }
.lz-nt__acts:has(.lz-nt__ok:hover) .lz-nt__key { opacity: 1 }
@media (hover: none) { .lz-nt__note.is-edit .lz-nt__key { display: none } }   /* на касаниях наведения нет — как у меню */
/* фильтр по проекту — роль «выбор» */
.lz-nt__filter { display: flex; gap: 6px; padding: 10px 14px 4px; overflow-x: auto; scrollbar-width: none }
.lz-nt__filter::-webkit-scrollbar { display: none }
.lz-nt__chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; flex: none; padding: 0 11px; border: 0; border-radius: 999px;
  background: transparent; color: var(--rb-muted); font: 12.5px/1 var(--rb-font-body); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--section-line, var(--rb-line)); transition: box-shadow .2s, color .2s }
.lz-nt__chip:hover { color: var(--rb-ink) }
.lz-nt__chip[aria-pressed="true"] { color: var(--choice-on-ink, var(--rb-ink)); background: var(--choice-on-bg, transparent); box-shadow: var(--choice-on-shadow, var(--yn-in, inset 0 0 0 1.5px var(--rb-ink))) }
.lz-nt__chip .ic { width: 13px; height: 13px }

/* список: заметки подряд, между ними волосяная линия; под курсором строка выступает */
.lz-nt__list { min-height: 0; overflow-y: auto; padding: 6px 14px 16px; scrollbar-width: thin; overscroll-behavior: contain }
/* подпись дня — в потоке (липкая перекрывала тень заметки под ней); поля у списка — чтобы тень строки не обрезалась */
.lz-nt__day { padding: 12px 8px 6px; color: var(--rb-faint); font-size: 11.5px; letter-spacing: .02em }
.lz-nt__note { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 6px; margin: 3px 0; padding: 14px 6px 15px;
  border-radius: 14px; transition: box-shadow .2s }
.lz-nt__note + .lz-nt__note::before { content: ""; position: absolute; left: 34px; right: 10px; top: 0; height: 1px; background: var(--section-divider, var(--rb-line)) }
.lz-nt__note:is(:hover, .is-edit, .is-on)::before, .lz-nt__note:is(:hover, .is-edit, .is-on) + .lz-nt__note::before { opacity: 0 }
.lz-nt__note.is-on { box-shadow: inset 0 0 0 1px var(--section-line, var(--rb-line)) }   /* выбрана: обводка (впадин здесь нет) */
.lz-nt__note.is-edit, .lz-nt__note.is-edit:hover { box-shadow: var(--bump-shadow, inset 0 0 0 1px var(--rb-line)) }
/* кружок выбора: под курсором и когда что-то уже выбрано; на телефоне — всегда */
.lz-nt__pick { grid-row: 1 / 3; align-self: start; display: grid; place-items: center; width: 22px; height: 22px; margin-top: -1px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--rb-faint); cursor: pointer; opacity: 0; transition: opacity .15s }
.lz-nt__pick > i { position: relative; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.4px currentColor }
.lz-nt__note:hover .lz-nt__pick, .lz-nt.is-picking .lz-nt__pick, .lz-nt__pick:focus-visible { opacity: 1 }
.lz-nt__note.is-on .lz-nt__pick { color: var(--rb-ink) }
.lz-nt__note.is-on .lz-nt__pick > i { background: currentColor; box-shadow: none }
.lz-nt__note.is-on .lz-nt__pick > i::after { content: ""; position: absolute; left: 5px; top: 4px; width: 6px; height: 3.5px; border: solid var(--surface-float, var(--rb-canvas));
  border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg) }
.lz-nt__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-width: 0; color: var(--rb-faint); font-size: 11.5px; line-height: 20px }
.lz-nt__t { margin-right: 4px }
.lz-nt__tag { display: inline-flex; align-items: center; gap: 4px; max-width: 170px; height: 20px; padding: 0 6px; border: 0; border-radius: 7px;
  background: transparent; color: var(--rb-muted); font: inherit; cursor: pointer; transition: box-shadow .2s, color .2s }
.lz-nt__tag > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lz-nt__tag .ic { width: 12px; height: 12px; flex: none }
.lz-nt__tag:hover { color: var(--rb-ink) }
.lz-nt__tag--add { color: var(--rb-faint); opacity: 0; transition: opacity .15s }
.lz-nt__note:is(:hover, :focus-within) .lz-nt__tag--add { opacity: 1 }
.lz-nt__body { grid-column: 2 / -1; min-height: 21px; outline: none; color: var(--rb-ink); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  cursor: text; -webkit-user-modify: read-write-plaintext-only; max-height: 7.5em; overflow: hidden }   /* свёрнутая — до 5 строк */
.lz-nt__note.is-long:not(.is-edit) .lz-nt__body { -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent) }
/* правка — не выше ~¾ окна, дальше своя прокрутка: остальные заметки и низ окна видны (владелец 23.11.2026) */
.lz-nt__note.is-edit .lz-nt__body { max-height: min(420px, 48vh); overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain }
.lz-nt__body:empty::before { content: attr(data-ph); color: var(--rb-faint) }
.lz-nt__body mark { border-radius: 3px; background: var(--lz-mark-soft, rgba(0, 0, 0, .08)); color: inherit }
.lz-nt__acts { grid-column: 3; grid-row: 1; align-self: start; display: flex; gap: 2px; margin: -3px 0 }
.lz-nt__acts .lz-nt__ib { width: 28px; height: 26px }
.lz-nt__del { opacity: 0 }
.lz-nt__note:hover .lz-nt__del, .lz-nt__del:focus-visible { opacity: 1 }
.lz-nt__ok, .lz-nt__no, .lz-nt__note.is-edit .lz-nt__del { display: none }
.lz-nt__note.is-edit :is(.lz-nt__ok, .lz-nt__no) { display: grid }
.lz-nt__ok, .lz-nt__ok:hover { color: var(--yn-ok, var(--rb-good)) }       /* 若竹 — «готово» */
.lz-nt__del:hover { color: var(--yn-err, var(--rb-bad)) }
@media (hover: none) { .lz-nt__pick, .lz-nt__tag--add { opacity: 1 } .lz-nt__del { opacity: .6 } }
/* «Удалённые»: без кружка выбора, текст только читать — нажали, раскрылся целиком; «Вернуть» видно всегда */
.lz-nt__note.is-gone { grid-template-columns: minmax(0, 1fr) auto }
.lz-nt__note + .lz-nt__note.is-gone::before { left: 10px }
.lz-nt__note.is-gone .lz-nt__acts { grid-column: 2 }
.lz-nt__note.is-gone .lz-nt__body { grid-column: 1 / -1; cursor: pointer; -webkit-user-modify: read-only; color: var(--rb-muted) }
.lz-nt__note.is-gone.is-open .lz-nt__body { max-height: none }
.lz-nt__tag.is-static { cursor: default }
.lz-nt__tag.is-static:hover { color: var(--rb-muted); box-shadow: none }
.lz-nt__del.is-armed { opacity: 1; color: var(--yn-err, var(--rb-bad)) }
.lz-nt__empty { display: grid; justify-items: center; gap: 6px; padding: 36px 20px; color: var(--rb-muted); text-align: center }
.lz-nt__empty b { color: var(--rb-ink); font-size: 14px; font-weight: 500 }

/* низ: выбрано N — «Новая задача»; удалили — «Вернуть»; иначе — подсказка */
.lz-nt__foot { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 10px 12px 12px 16px; border-top: 1px solid var(--section-divider, var(--rb-line)) }
.lz-nt__hint, .lz-nt__status { color: var(--rb-faint); font-size: 12px }
.lz-nt__status { display: inline-flex; align-items: center; gap: 5px }
.lz-nt__status .ic { width: 14px; height: 14px }
.lz-nt__status.is-saved .ic { color: var(--yn-ok, var(--rb-good)) }
.lz-nt__status.is-error { color: var(--yn-err, var(--rb-bad)) }
.lz-nt__count { color: var(--rb-muted); font-size: 12.5px; white-space: nowrap }
.lz-nt__clr, .lz-nt__undo { padding: 4px 6px; border: 0; background: transparent; color: var(--rb-faint); font: 12.5px/1 var(--rb-font-body); cursor: pointer }
.lz-nt__undo { color: var(--rb-ink); font-weight: 500 }
.lz-nt__clr:hover { color: var(--rb-ink) }
.lz-nt__sp { flex: 1 }
.lz-nt__go { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap }
.lz-nt__go .ic { width: 16px; height: 16px }

/* меню привязки — .lz-cmenu приложения, место — у метки (notes.js menu) */
.lz-cmenu.lz-nt__menu { position: fixed; top: auto; right: auto; z-index: 95; width: 250px; max-height: min(340px, calc(100vh - 16px)); overflow-y: auto; border: 0;
  background: var(--surface-float, var(--rb-canvas)); box-shadow: var(--float-shadow, var(--rb-shadow-lift)), inset 0 0 0 1px var(--float-line, var(--rb-line)); font-size: 13px }
.lz-nt__menu .lz-cmenu__item { padding: 7px 10px }
.lz-nt__menu .lz-cmenu__item > span:not(.lz-nt__sub) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lz-nt__sub { margin-left: auto; color: var(--rb-faint); font-size: 11.5px; white-space: nowrap }
.lz-nt__sep { height: 1px; margin: 4px 6px; background: var(--section-divider, var(--rb-line)) }

/* телефон: окно — лист снизу во всю ширину, с ручкой */
@media (max-width: 820px) {
  .lz-nt { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; max-height: 86vh; max-height: 86dvh; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom) }
  .lz-nt::before { content: ""; position: absolute; left: 50%; top: 8px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--section-line, var(--rb-line)) }
  .lz-nt__head { padding-top: 20px }
  .lz-nt__body { font-size: 16px }        /* Safari на телефоне не приближает поле */
  .lz-nt .lz-models__search { font-size: 16px }
}

/* ── кнопки у выделенного текста в ленте ── */
.lz-ntsel { position: fixed; z-index: 92; display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface-float, var(--rb-canvas));
  box-shadow: var(--float-shadow, 0 8px 30px rgba(0, 0, 0, .14)), inset 0 0 0 1px var(--float-line, var(--rb-line)) }
.lz-ntsel[hidden] { display: none }
@media (prefers-reduced-motion: no-preference) { .lz-ntsel { animation: lz-ntsel-in .14s ease-out } @keyframes lz-ntsel-in { from { opacity: 0; transform: translateY(4px) } } }
.lz-ntsel button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--rb-ink); font: 500 12.5px/1 var(--rb-font-body); white-space: nowrap; cursor: pointer; transition: box-shadow .2s }
.lz-ntsel button .ic { width: 15px; height: 15px; color: var(--rb-muted) }

/* выделение в ленте — нативное (без DOM-подложек и пересчёта на каждом кадре: легко по CPU/памяти и ровно в Safari);
   явный цвет без прозрачности, чтобы Safari 17 не перекрашивал выделение при наведении на кнопки */
html.lz-notes-on #workspace-content :is(.lz-msg, .lz-srv-work__say) ::selection,
html.lz-notes-on #workspace-content :is(.lz-msg, .lz-srv-work__say)::selection { background: rgba(20, 20, 20, .15); color: inherit }
html.lz-notes-on.lz-dark #workspace-content :is(.lz-msg, .lz-srv-work__say) ::selection,
html.lz-notes-on.lz-dark #workspace-content :is(.lz-msg, .lz-srv-work__say)::selection { background: rgba(255, 255, 255, .22); color: inherit }
.lz-srv-work__sum { -webkit-user-select: none; user-select: none }

/* цитата над полем (app.js quoteChip) — чип ссылки из ленты, текст в одну строку */
.lz-file--quote { max-width: 320px }
.lz-file--quote .rb-composer__file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
@media (prefers-reduced-motion: reduce) { .lz-nt, .lz-ntsel, .lz-nt__note { animation: none; transition: none } }
