/* ============ ЗАМЕТКИ: перенос и правка внутри — веб и андроид ============
   Разметку дописывает web/notes-edit.js. */

/* ---- перенос карточек ---- */
.nlist { position: relative; }
/* Удержание пальцем — это «взять», а не выделить текст или вызвать меню. */
.nlist > .row-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.nlist > .row-card.ne-lifted {
  position: relative; z-index: 30;
  transition: none !important;
  cursor: grabbing;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .16), 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
}
.nlist > .row-card.ne-shift { transition: transform .2s cubic-bezier(.2, .7, .3, 1); }
html.ne-dragging, html.ne-dragging * { cursor: grabbing !important; user-select: none !important; }
@media (prefers-reduced-motion: reduce) { .nlist > .row-card.ne-shift { transition: none; } }

/* Превью с оформлением: заголовок и цитата в нём — обычные строки. */
.nlist .row-card .sub b { color: var(--fg); font-weight: 650; }

/* ---- заметка ---- */
.ne { padding: 20px 22px 16px; }
.ne-touch { padding: 0; }

.ne-title {
  display: block; width: 100%; border: 0; background: transparent; outline: none;
  font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.035em; line-height: 1.2;
  color: var(--fg); padding: 2px 0 8px; margin: 0;
}
.ne-title::placeholder { color: var(--fg-2); opacity: .55; }
.ne-touch .ne-title { font-size: 24px; }

.ne-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 5px; margin: 6px 0 14px; border-radius: 13px;
  background: var(--soft);
}
.ne-fmts { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ne-out { display: flex; align-items: center; gap: 2px; flex: none; }
.ne:not(.ne-touch) .ne-bar { position: sticky; top: 10px; z-index: 5; }
.ne-tool {
  min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; color: var(--fg-2); font: inherit; font-size: 15.5px; line-height: 1; cursor: pointer;
}
.ne-tool b, .ne-tool i, .ne-tool u, .ne-tool s { font-family: var(--display); color: inherit; }
.ne-tool b { font-weight: 800; }
.ne-tool i { font-style: italic; font-weight: 600; }
.ne-tool u, .ne-tool s { font-weight: 600; }
.ne-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ne-tool:hover { background: color-mix(in srgb, var(--card) 75%, transparent); color: var(--fg); }
.ne-tool.on { background: var(--card); color: var(--accent-text, var(--accent)); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.ne-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ne-wide { font-size: 13.5px; font-weight: 600; padding: 0 11px; }
.ne-wide.ok { color: var(--accent-text, var(--accent)); }
.ne-sep { width: 1px; height: 20px; background: var(--line); margin: 0 5px; }
/* На телефоне — одна строка. Подписи у «Копировать» и «Поделиться» уходят,
   кнопки оформления ужимаются, а не поместившиеся листаются вбок: две
   строки панели съедали экран над текстом. */
.ne-touch .ne-bar { gap: 4px; }
.ne-touch .ne-fmts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 0; }
.ne-touch .ne-fmts::-webkit-scrollbar { display: none; }
.ne-touch .ne-tool { min-width: 31px; padding: 0 6px; flex: none; }
.ne-touch .ne-sep { flex: none; margin: 0 3px; }
.ne-touch .ne-out { padding-left: 4px; border-left: 1px solid var(--line); }
.ne-touch .ne-wide span { display: none; }

.ne-body {
  min-height: calc(100dvh - 340px);
  outline: none; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 15.5px; line-height: 1.62; color: var(--fg);
  padding: 2px 2px 24px;
}
.ne-touch .ne-body { min-height: calc(100dvh - 300px); }
.ne-body:empty::before { content: attr(data-placeholder); color: var(--fg-2); opacity: .6; pointer-events: none; }
.ne-body h3 { font-family: var(--display); font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.3; margin: 14px 0 4px; }
.ne-body > h3:first-child { margin-top: 0; }
.ne-body ul, .ne-body ol { margin: 4px 0; padding-left: 1.5em; }
.ne-body li { margin: 2px 0; }
.ne-body blockquote {
  margin: 4px 0; padding: 1px 0 1px 13px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--fg-2);
}
.ne-body blockquote + blockquote { margin-top: -4px; }
.ne-body b, .ne-body strong { font-weight: 700; }

.ne-foot { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---- окно «поделиться» ---- */
.ne-share { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.ne-share .btn { justify-content: center; text-decoration: none; }

/* ---- Syn помогает с текстом ---- */
.ne-ai svg { color: var(--accent-text, var(--accent)); }
.ne-ai.on { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.ne-ai-slot:empty { display: none; }
.ne-ai-panel {
  margin: -6px 0 14px; padding: 12px 12px 10px; border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--card));
}
.ne-ai-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.ne-ai-head b { font-size: 13.5px; font-weight: 650; color: var(--fg); }
.ne-ai-head span { font-size: 12px; color: var(--fg-2); }
.ne-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ne-ai-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
}
.ne-ai-chip:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent-text, var(--accent)); }
.ne-ai-chip:disabled { opacity: .5; cursor: default; }
.ne-ai-own { display: flex; gap: 8px; margin-top: 10px; --inp-py: 8px; --inp-fs: 13.5px; }
.ne-ai-own .inp { flex: 1; min-width: 0; }
.ne-ai-own .btn { flex: none; }
.ne-ai-busy { display: flex; align-items: center; gap: 9px; margin: 2px 0; font-size: 13.5px; color: var(--fg-2); }
.ne-ai-spin {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent);
  animation: ne-ai-spin .8s linear infinite;
}
@keyframes ne-ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ne-ai-spin { animation-duration: 2.4s; } }
.ne-ai-err { margin: 8px 0 0; font-size: 13px; color: var(--danger); }
.ne-ai-done {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -6px 0 14px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--soft);
  font-size: 13.5px; color: var(--fg-2);
}
.ne-ai-done span { display: inline-flex; align-items: center; gap: 7px; }
.ne-ai-done svg { width: 16px; height: 16px; fill: none; stroke: var(--accent-text, var(--accent)); stroke-width: 1.7; stroke-linejoin: round; }
.ne-touch .ne-ai-own { flex-wrap: wrap; }
.ne-touch .ne-ai-own .btn { width: 100%; }

/* Окошко у выделения: «Что тут поменять?» — Syn правит только выделенное. */
.ne { position: relative; }
.ne-pop {
  position: absolute; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  width: min(340px, calc(100% - 16px)); padding: 5px 5px 5px 10px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--card);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08);
  animation: ne-pop-in .14s ease-out;
}
@keyframes ne-pop-in { from { transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .ne-pop { animation: none; } }
.ne-pop-ic { display: inline-flex; flex: none; }
.ne-pop-ic svg, .ne-pop-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ne-pop-ic { color: var(--accent-text, var(--accent)); }
.ne-pop-in {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg);
  font: inherit; font-size: 14px; padding: 6px 0;
}
.ne-pop-in::placeholder { color: var(--fg-2); }
.ne-pop-go {
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent, #fff);
}
.ne-pop-go:hover { filter: brightness(1.06); }
.ne-pop-err { flex-basis: 100%; margin: 0 0 4px; font-size: 12.5px; line-height: 1.35; color: var(--danger); }
.ne-pop.busy { width: auto; gap: 9px; padding: 9px 14px; font-size: 13.5px; color: var(--fg-2); }
.ne-touch .ne-pop-in { font-size: 16px; }
::highlight(ne-pick) { background: color-mix(in srgb, var(--accent) 24%, transparent); }
