/* ============================================================================
 * notes.css — единственный источник правды по презентационному слою вкладки
 * «Заметки» (паритет Obsidian Mobile 1.14.4).
 *
 * Числа взяты из docs/obsidian-ref-metrics-2026-10-23.md (реальный
 * obsidian-app.css + кадры видео), а не подобраны на глаз:
 *   • drawer 84vw · clamp(300px, 84vw, 450px), на ≤380px — 100vw, radius 0;
 *   • строка дерева — визуальная пилюля 37px (тач) / 25px (мышь),
 *     тап-зона 44px, радиус 30 (тач) / 8 (мышь), левый жёлоб 24px, шаг 16px;
 *   • шеврон 10×10, stroke 4, поворот 100ms ease-in-out;
 *   • скрим rgba(0,0,0,.15) 200ms linear, drawer 200ms ease-in-out;
 *   • push «список → заметка» 150ms (входящий ±100%→0 cubic-bezier(.33,1,.68,1),
 *     уходящий 0→∓20% + opacity .65, ease-out);
 *   • слои: cover 5 · sidedock 10 · statusbar 15 · popover 30 (drawer и правая
 *     панель) · slides 45 · modal 50 · notice 60 · menu 65 (шит и мобильный
 *     тулбар) · tooltip 70 · dragged 80.
 *
 * Состав файла:
 *   1. Токены
 *   2. Каркас .notes-shell (телефон: базовый экран = список; десктоп: колонки)
 *   3. Файловый менеджер (.fm): поиск → дерево → действия → пилюля → хранилище
 *   4. Строки дерева (.fm-row) и состояния
 *   5. Состояния списка: skeleton / empty / error
 *   6. Экран заметки: шапка 44, капсула форматирования над таб-баром
 *   7. Правая панель (второй drawer)
 *   8. Правая панель: док-пилюля
 *   9. Bottom-sheet (меню строки) — слой menu
 *  10. Push-переход и режимы движения (reduced-motion, [data-motion-force])
 *
 * Цвета/поверхности берутся из base.css (--bg, --surface, --text, --accent…).
 * Здесь только геометрия, состояния и моушен.
 * ========================================================================= */

/* ---------------------------------------------------------------------------
 * 1. ТОКЕНЫ
 * ------------------------------------------------------------------------ */
:root {
  /* --- Строка дерева ------------------------------------------------ */
  /* Тап-зона строки = 44px (a11y), визуальная пилюля = 37px (Obsidian 36,8). */
  --notes-row-h: 44px;
  --notes-row-pill-h: 37px;
  --notes-indent: 16px;      /* шаг уровня: 4px padding + 12px margin */
  --notes-r-row: 30px;       /* телефон/тач — пилюля */
  --notes-r-row-fine: 8px;   /* мышь — --radius-m */
  --notes-row-gutter: 24px;  /* жёлоб шеврона/иконки */
  --notes-row-font: 16px;    /* --font-ui-medium (телефон) */
  --notes-tree-pad-x: 12px;  /* .nav-files-container padding-inline */
  /* Уровень вложенности строки: пишет fm.js (el.style.setProperty) на каждой
     строке; 0 — верхний уровень. */
  --fm-depth: 0;

  /* --- Колонки ------------------------------------------------------ */
  --notes-col-list: 300px;
  --notes-drawer-w: clamp(300px, 84vw, 450px);
  --notes-drawer-r: 0px;     /* телефон: радиус 0 (планшет: 24px) */

  /* --- Нижняя зона: таб-бар не перекрывается ни одним слоем заметок --- */
  --notes-ui-bottom: calc(var(--tabbar-h) + var(--safe-area-inset-bottom));

  /* --- Длительности (эталон Obsidian; --motion-scale — глобальный гейт) --- */
  --notes-dur-fast: 100ms;   /* строка, шеврон, пункт меню */
  --notes-dur-base: 200ms;   /* drawer, скрим, шапка */
  --notes-dur-push: 150ms;   /* push «список ↔ заметка» */
  --notes-dur-slow: 300ms;   /* список вкладок drawer */
  --notes-ease-in-out: ease-in-out;
  --notes-ease-out: ease-out;
  --notes-ease-push-in: cubic-bezier(0.33, 1, 0.68, 1);
  --notes-ease-swing: cubic-bezier(0, 0.55, 0.45, 1);

  --notes-t-fast: calc(var(--notes-dur-fast) * var(--motion-scale, 1));
  --notes-t-base: calc(var(--notes-dur-base) * var(--motion-scale, 1));
  --notes-t-push: calc(var(--notes-dur-push) * var(--motion-scale, 1));
  --notes-t-slow: calc(var(--notes-dur-slow) * var(--motion-scale, 1));

  /* --- Слои (карта Obsidian §11) ------------------------------------ */
  --notes-z-cover: 5;
  --notes-z-sidedock: 10;
  --notes-z-statusbar: 15;
  --notes-z-popover: 30;     /* drawer (список) и правая панель */
  --notes-z-modal: 50;
  --notes-z-notice: 60;
  --notes-z-menu: 65;        /* bottom-sheet и мобильная капсула */
  --notes-z-tooltip: 70;
  --notes-z-dragged: 80;

  /* --- Поверхности --------------------------------------------------- */
  --notes-scrim-color: rgba(0, 0, 0, 0.15);
  --notes-shadow-panel: 0 8px 40px rgba(0, 0, 0, 0.18);
}

/* Телефон/планшет: та же тач-геометрия (класс ставит приложение). */
.is-phone,
.is-mobile {
  --notes-row-h: 44px;
  --notes-row-pill-h: 37px;
  --notes-r-row: 30px;
  --notes-row-font: 16px;
}

/* Узкий телефон: drawer во всю ширину, без радиусов (css:19402–19405). */
@media (max-width: 380px) {
  :root {
    --notes-drawer-w: 100vw;
    --notes-drawer-r: 0px;
  }
}

/* Планшет: скругление drawer 24px. */
@media (min-width: 601px) and (max-width: 1023px) {
  :root { --notes-drawer-r: 24px; }
}

/* Мышь на широком экране — компактные строки Obsidian (24,9px). */
@media (min-width: 1024px) and (pointer: fine) {
  :root {
    --notes-row-h: 25px;
    --notes-row-pill-h: 25px;
    --notes-r-row: 8px;
    --notes-row-font: 13px;
  }
}

/* ---------------------------------------------------------------------------
 * 2. КАРКАС .notes-shell
 *
 * Телефон (≤1023): базовый экран — файловый менеджер на всю ширину;
 * заметка «въезжает» push-переходом, список становится drawer'ом 84vw.
 * Десктоп (≥1024): колонки список | центр | правая панель.
 * Ни один слой заметок не заходит на нижний таб-бар (--notes-ui-bottom).
 * ------------------------------------------------------------------------ */
.notes-view {
  position: relative;
  display: none;
  min-height: 0;
}
.notes-view.active-view { display: block; }
.notes-view > .notes-shell { width: 100%; height: 100%; }

.notes-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}
.notes-shell > * { min-height: 0; min-width: 0; }

/* Телефон: каркас заканчивается над таб-баром. */
@media (max-width: 1023px) {
  .notes-view > .notes-shell { height: calc(100% - var(--notes-ui-bottom)); }
}

.notes-col-center {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

/* Панель заметки внутри нового каркаса — обычный поток, не absolute. */
.notes-shell .note-editor-pane,
.notes-view > .notes-shell .notes-col-center > .note-editor-pane {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 1;
  visibility: visible;
}

/* Левая панель — колонка-контейнер. */
.notes-col-notes {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-secondary);
  overflow: hidden;
  /* Вертикаль — скроллу списка, горизонталь — свайпу-закрытию drawer'а:
     без pan-y браузер забирает жест и pointercancel срывает анимацию. */
  touch-action: pan-y;
}
.notes-drawer-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.notes-drawer-body > .fm {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* --- Скрим drawer -------------------------------------------------------
 * Очень лёгкий (15 % чёрного, css:19333): контент под панелью читается.
 * Скрим не закрывает таб-бар — он заканчивается на линии --notes-ui-bottom. */
.notes-scrim {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--notes-ui-bottom);
  left: 0;
  z-index: calc(var(--notes-z-popover) - 1);
  background: var(--notes-scrim-color);
  opacity: 1;
  transition: opacity var(--notes-t-base) linear;
}
.notes-scrim[hidden] { display: none; }
/* Базовый экран телефона — сам список: затемнять нечего. */
.notes-shell.is-base-list .notes-scrim { display: none; }

/* Pull-таб не используется: список открывается ☰/жестом от левой кромки. */
.notes-pull-tab { display: none; }

/* ---------------------------------------------------------------------------
 * 3. ФАЙЛОВЫЙ МЕНЕДЖЕР .fm
 * ------------------------------------------------------------------------ */
.fm {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* --- Поиск (44px, как --input-height на телефоне) ---------------------- */
.fm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  margin: 4px 12px 0;
  padding: 0 4px 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: border-color var(--notes-t-fast) var(--notes-ease-in-out),
    box-shadow var(--notes-t-fast) var(--notes-ease-in-out);
}
.fm-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.fm-search__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: color-mix(in srgb, var(--text) 55%, transparent);
}
.fm-search input,
.fm-search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--font-sm);
  outline: none;
}
.fm-search input::placeholder { color: color-mix(in srgb, var(--text) 45%, transparent); }
.fm-search input::-webkit-search-cancel-button { display: none; }
.fm-search__clear {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--r-pill);
  background: none;
  color: inherit;
  cursor: pointer;
}
.fm-search__clear[hidden] { display: none; }
@media (hover: hover) {
  .fm-search__clear:hover { background: var(--hover-bg); }
}
.fm-search__clear:active { background: var(--active-bg); }
.fm-search__clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Скроллер списка ----------------------------------------------------
 * ЕДИНСТВЕННЫЙ скроллер панели — .fm-body. Дерево внутри него не скроллится
 * и не перехватывает жест (overflow: visible), иначе touch-жест «залипал»
 * в .fm-tree и список не прокручивался (дефект 8.list-touch-scroll). */
.fm-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  /* .nav-files-container: 4px 12px max(safe, 24px) 12px */
  padding: 4px var(--notes-tree-pad-x) 24px;
  scrollbar-width: thin;
  touch-action: pan-y;
}
.fm-tree {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: visible;
  /* раскрытие папки анимирует высоту (inline height из fm.js) */
  will-change: height;
}

/* --- Ряд иконок-действий (44×44, gap 8) -------------------------------- */
.fm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  padding: 2px 12px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.fm-actions button,
.fm-action {
  flex: 1 1 0;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--notes-r-row-fine);
  background: none;
  color: inherit;
  cursor: pointer;
  transition: background-color var(--notes-t-fast) var(--notes-ease-in-out);
}
@media (hover: hover) {
  .fm-actions button:hover,
  .fm-action:hover { background: var(--hover-bg); }
}
.fm-actions button:active,
.fm-action:active { background: var(--active-bg); }
.fm-actions button:focus-visible,
.fm-action:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fm-actions .icon,
.fm-action .fm-i svg { width: 20px; height: 20px; }
.fm-i { display: inline-flex; }
.fm-i svg { width: 20px; height: 20px; }

/* --- Пилюля-селектор панели (--touch-size-l = 52) ----------------------
 * На телефоне панель одна (файловый менеджер) — селектор не нужен и съедал
 * 68px высоты дерева; строки уезжали под сгиб. Показываем только там, где
 * панелей действительно несколько (планшет/десктоп).
 * --------------------------------------------------------------------- */
.fm-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: calc(100% - 24px);
  min-height: 52px;
  margin: 8px 12px;
  padding: 0 20px;
  border: none;
  border-radius: var(--notes-r-row);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background-color var(--notes-t-fast) var(--notes-ease-in-out);
}
@media (hover: hover) {
  .fm-pill:hover { background: var(--active-bg); }
}
.fm-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fm-pill .icon,
.fm-pill .fm-i svg { width: 16px; height: 16px; }
.fm-pill__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Телефон: панель одна — селектор скрыт (освобождает 68px дерева). */
@media (max-width: 600px) {
  .fm-pill { display: none; }
}

/* --- Строка хранилища (внизу панели, над таб-баром) -------------------- */
.fm-store {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.fm-store__name {
  margin-right: auto;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-store__counts {
  color: color-mix(in srgb, var(--text) 55%, transparent);
  font-size: var(--font-xs);
  white-space: nowrap;
}
.fm-store__gear,
.fm-vault__gear {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: background-color var(--notes-t-fast) var(--notes-ease-in-out);
}
@media (hover: hover) {
  .fm-store__gear:hover,
  .fm-vault__gear:hover { background: var(--surface-2); }
}
.fm-store__gear:focus-visible,
.fm-vault__gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fm-store__gear .fm-i svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------------------
 * 4. СТРОКИ ДЕРЕВА .fm-row
 *
 * Визуал: пилюля 37px (тач) с радиусом 30; тап-зона — 44px по высоте.
 * Жирность НЕ меняется ни в одном состоянии (Obsidian: --nav-item-weight:
 * inherit) — активный файл отличается только фоном и цветом.
 * ------------------------------------------------------------------------ */
.fm-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: var(--notes-row-h);
  margin: 0;
  padding: 0 var(--notes-row-gutter) 0 calc(var(--fm-depth, 0) * var(--notes-indent) + var(--notes-row-gutter));
  border: 0;
  border-radius: var(--notes-r-row);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--notes-row-font);
  font-weight: inherit;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--notes-t-fast) var(--notes-ease-in-out);
}
/* Визуальная пилюля: фон рисуется подложкой, а не всей кнопкой, —
   так тап-зона остаётся 44px при высоте пилюли 37px. */
.fm-row::before {
  content: '';
  position: absolute;
  inset: calc((var(--notes-row-h) - var(--notes-row-pill-h)) / 2) 0;
  border-radius: inherit;
  background: transparent;
  transition: background-color var(--notes-t-fast) var(--notes-ease-in-out);
  pointer-events: none;
}
@media (hover: hover) {
  .fm-row:hover::before { background: var(--hover-bg); }
}
.fm-row:active::before { background: var(--active-bg); }
.fm-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Активный файл: только фон-пилюля + text-normal. */
.fm-row[aria-selected='true']::before,
.fm-row.is-selected::before {
  background: var(--selected-bg);
}
/* Мультивыбор — тот же язык: accent 15 %, без жирности. */
.fm-row.is-multi-selected::before { background: var(--selected-bg); }
.fm-row[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }
/* DnD-состояния. */
.fm-row.is-dragover::before {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.fm-row.is-dragging { opacity: 0.4; }

/* Направляющая уровня (1px, mono 12 %). */
.fm-row::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--fm-depth, 0) * var(--notes-indent) + 4px);
  width: 1px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  pointer-events: none;
}
.fm-row[data-depth='0']::after { display: none; }

/* Шеврон папки: 10×10, stroke 4, поворот 100ms ease-in-out. */
.fm-row__chev {
  position: absolute;
  left: calc(var(--fm-depth, 0) * var(--notes-indent) + 4px);
  top: 50%;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: color-mix(in srgb, var(--text) 45%, transparent);
  transition: transform var(--notes-t-fast) var(--notes-ease-in-out);
  pointer-events: none;
}
.fm-row__chev .icon,
.fm-row__chev svg {
  width: 10px;
  height: 10px;
  stroke-width: 4px;
}
/* Раскрытая папка: chevron-right → вниз (matrix(0,1,-1,0) = rotate(90deg)). */
.fm-row[data-kind='folder'][aria-expanded='true'] .fm-row__chev { transform: rotate(90deg); }
.fm-row__chev.is-open { transform: rotate(90deg); }
.fm-row__chev.is-opening { animation: fm-chev-open var(--notes-t-fast) var(--notes-ease-in-out) both; }
@keyframes fm-chev-open { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }
/* Свёрнутая папка — приглушённый шеврон. */
.fm-row[data-kind='folder'].is-collapsed .fm-row__chev {
  color: color-mix(in srgb, var(--text) 38%, transparent);
}

/* Имя файла/папки: ellipsis, без выталкивания строки по max-content. */
.fm-row__label,
.fm-row__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: pre;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
}

/* Счётчик вложений — приглушённый, справа. */
.fm-row__flair {
  flex: 0 0 auto;
  margin-inline-start: auto;
  padding: 0 4px;
  font-size: var(--font-xs);
  color: color-mix(in srgb, var(--text) 38%, transparent);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
 * 5. СОСТОЯНИЯ СПИСКА: skeleton / empty / error
 * ------------------------------------------------------------------------ */
.fm-slot[hidden] { display: none; }

.fm-empty,
.fm-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}
.fm-empty__title,
.fm-empty__hint,
.fm-error__text,
.fm-error__title,
.fm-error__hint { margin: 0; }
.fm-empty__title,
.fm-error__title,
.fm-error__text { font-size: var(--font-sm); font-weight: 600; color: var(--text); }
.fm-empty__hint,
.fm-error__hint { font-size: var(--font-xs); color: color-mix(in srgb, var(--text) 45%, transparent); }
.fm-empty__btn,
.fm-error__btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--notes-r-row-fine);
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: var(--font-sm);
  cursor: pointer;
}
.fm-empty__btn:focus-visible,
.fm-error__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fm-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
  width: 100%;
}
.fm-skeleton__row {
  height: var(--notes-row-pill-h);
  border-radius: var(--notes-r-row);
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    color-mix(in srgb, var(--text) 8%, var(--surface-2)) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: notes-shimmer calc(var(--notes-dur-slow) * 2) linear infinite;
}
.fm-skeleton__row:nth-child(2) { width: 88%; }
.fm-skeleton__row:nth-child(3) { width: 72%; }
.fm-skeleton__row:nth-child(4) { width: 80%; }

@keyframes notes-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------------------------------------------------------------------------
 * 6. ЭКРАН ЗАМЕТКИ: шапка 44px и капсула форматирования
 * ------------------------------------------------------------------------ */
.note-editor-pane.mode-preview .note-title-inline,
.note-editor-pane.mode-preview .pane-toolbar .note-title { display: none; }
.note-editor-pane .editor-crumbs { min-width: 0; }
.note-editor-pane .editor-crumbs-more { min-width: 44px; min-height: 44px; }
.note-props-add { min-height: 44px; }
/* Лента форматирования: на планшете (601–1023) лента физически не влезает в
   одну строку — переносим, как раньше (иначе .md-toolbar становится
   горизонтальным скроллером и его ловит проверка 2.hscroll-note-768).
   На десктопе (≥1024) — ОДНА строка со скроллом и fade-краями (Obsidian). */
@media (min-width: 601px) and (max-width: 1023px) {
  .notes-view .md-toolbar { flex-wrap: wrap; overflow: visible; max-height: none; height: auto; }
}
@media (min-width: 1024px) {
  .notes-view .md-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: 44px;
    height: 44px;
  }
}
/* Fade-края ленты: классы ставит updateCapsuleFade (index.js) по факту
   переполнения и позиции скролла. */
.md-toolbar.is-fade-right {
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.md-toolbar.is-fade-left {
  mask-image: linear-gradient(to right, transparent, #000 24px);
}
.md-toolbar.is-fade-left.is-fade-right {
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.mdt-btn { width: 36px; min-width: 36px; height: 44px; min-height: 44px; }

@media (max-width: 600px) {
  /* --- Шапка: 44px, три зоны (назад · крошки · пилюля действий) -------- */
  .note-editor-pane .editor-toolbar {
    position: relative;
    z-index: var(--notes-z-sidedock);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 44px;
    min-height: 44px;
    padding: 0 8px;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--surface);
    border: 0;
    box-shadow: none;
    transition: opacity var(--notes-t-base) var(--notes-ease-in-out),
      transform var(--notes-dur-slow) var(--notes-ease-in-out);
  }
  /* В шапке телефона живут только три элемента: список, назад и пилюля
     действий. Остальные (заголовок-инпут, сплит, вложения, напоминание,
     корзина, статус) — в ⋮-меню или на десктопе. */
  .note-editor-pane .editor-toolbar > * { display: none; }
  .note-editor-pane .editor-toolbar > .back-btn,
  .note-editor-pane .editor-toolbar > .editor-drawer-btn,
  .note-editor-pane .editor-toolbar > .editor-topbar-pill,
  .note-editor-pane .editor-toolbar > .editor-crumbs { display: flex; }

  .note-editor-pane .editor-toolbar > .back-btn,
  .note-editor-pane .editor-toolbar > .editor-drawer-btn {
    flex: 0 0 auto;
    display: grid !important;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 44px;
    background: transparent;
    color: var(--text);
  }
  .note-editor-pane .editor-toolbar > .back-btn:active,
  .note-editor-pane .editor-toolbar > .editor-drawer-btn:active { background: var(--active-bg); }
  .note-editor-pane .editor-toolbar > .back-btn .icon,
  .note-editor-pane .editor-toolbar > .editor-drawer-btn .icon { width: 24px; height: 24px; }

  /* Крошки — одна строка с ellipsis (второй узел «…» скрыт: на телефоне
     путь доступен из меню ⋮). */
  .note-editor-pane .editor-toolbar > .editor-crumbs {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    color: color-mix(in srgb, var(--text) 55%, transparent);
    font-size: var(--font-sm);
  }
  .note-editor-pane .editor-crumbs-part,
  .note-editor-pane .editor-crumbs-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Пилюля действий: 2 кнопки по 44 (режим + ⋮). */
  .note-editor-pane .editor-topbar-pill {
    display: flex;
    flex: 0 0 auto;
    margin-inline-start: auto;
    width: 88px;
    height: 44px;
    padding: 0;
    border-radius: 22px;
    background: var(--surface-2, var(--surface));
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    overflow: hidden;
  }
  .note-editor-pane .editor-topbar-pill .btn-icon,
  .note-editor-pane .editor-topbar-pill .mode-toggle-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 0;
  }
  .note-editor-pane .editor-topbar-pill .btn-icon + .btn-icon {
    border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  }
  /* Скрытие шапки при скролле — только кадр самого редактора. */
  .note-editor-pane .editor-toolbar.is-chrome-hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
  }
}

/* --- Нав-пилюля: слот «[N]» в layout.css был 36px — добиваем до тач-цели 44 --- */
.nav-pill-tabs { min-width: 44px; min-height: 44px; }

/* --- Поверхности drawer'а непрозрачны -----------------------------------
 * Эталон: `.workspace-drawer`/`-inner` = --mobile-sidebar-background (alpha 1),
 * backdrop-filter и opacity у панели НЕТ (полупрозрачен только скрим).
 * Двойная экспозиция «список + текст заметки» была именно из-за
 * прозрачности/отрисовки панели поверх центра. */
.notes-col-notes,
.notes-col-notes .fm,
.right-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* --- Капсула форматирования (mobile-toolbar, слой menu) -----------------
 * Obsidian: высота полосы 52, капсула 44, опции 40–50, gap 8; над клавиатурой
 * и НАД таб-баром (z 65). Одна строка, snap по опциям, fade у краёв. */
.editor-actions-pill {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: var(--notes-z-menu);
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  height: 52px;
  padding: 4px 0;
  border-radius: 44px;
  justify-content: center;
  background: var(--surface);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--separator);
  transition: transform calc(var(--dur-kb) * var(--motion-scale, 1)) var(--ease-kb);
  overflow: hidden;
}
.note-editor-pane.no-doc .editor-actions-pill { display: none; }
.editor-actions-pill .md-toolbar {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.editor-actions-pill .md-toolbar::-webkit-scrollbar { display: none; }
.editor-actions-pill .mdt-group { display: contents; }
.editor-actions-pill .mdt-sep { display: none; }
.editor-actions-pill .mdt-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.editor-actions-pill .mdt-btn .icon,
.editor-actions-pill .mdt-btn svg { width: 18px; height: 18px; }

/* Мобильный набор команд (как в Obsidian: тулбар — курируемый поднабор).
   Остальные команды доступны через «…» (overflow-меню ленты). */
@media (max-width: 600px) {
  .editor-actions-pill .mdt-btn[data-cmd]:not([data-cmd='hcycle']):not([data-cmd='bold']):not([data-cmd='italic']):not([data-cmd='ul']):not([data-cmd='checkbox']):not([data-cmd='quote']):not([data-cmd='link']) {
    display: none;
  }
}
/* Капсула — ТОЛЬКО в правке (эталон: .mobile-toolbar виден при фокусе
   редактора; в чтении нижней капсулы нет: кадр v1-021.5s). */
@media (max-width: 1023px) {
  .note-editor-pane.mode-preview .editor-actions-pill { display: none; }
}

/* Узкие экраны: 44px × N опций должны влезать в (100vw − 16) без скролла.
   7 опций → от 324px, 6 опций → от 280px (см. 5.pill-320/412 в харнессе). */
@media (max-width: 367px) {
  .editor-actions-pill .mdt-btn[data-cmd='link'] { display: none; }
}
@media (max-width: 323px) {
  .editor-actions-pill .mdt-btn[data-cmd='quote'] { display: none; }
}

/* ---------------------------------------------------------------------------
 * 7. ПРАВАЯ ПАНЕЛЬ — второй drawer (не bottom-sheet, §4 эталона)
 * ------------------------------------------------------------------------ */
@media (max-width: 1023px) {
  .right-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: var(--notes-ui-bottom);
    left: auto;
    width: var(--notes-drawer-w);
    max-width: var(--notes-drawer-w);
    z-index: var(--notes-z-popover);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--notes-drawer-r) 0 0 var(--notes-drawer-r);
    box-shadow: var(--notes-shadow-panel);
    transform: translate3d(100%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition:
      transform var(--notes-t-base) var(--notes-ease-in-out),
      visibility 0s linear var(--notes-t-base);
  }
  .right-panel.open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    transition:
      transform var(--notes-t-base) var(--notes-ease-in-out),
      visibility 0s;
  }
  /* Жест drag-to-dismiss: панель следует за пальцем по Y. */
  .right-panel.is-dragging,
  .right-panel.is-settling {
    transition: none;
  }
  .right-panel.is-settling {
    transition: transform var(--notes-t-base) var(--notes-ease-out);
  }
}

/* Вкладки панели — видимы и на телефоне (Структура | Обратные | Исходящие). */
.right-panel-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.right-panel-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: color-mix(in srgb, var(--text) 60%, transparent);
  font: inherit;
  font-size: 11px;
  line-height: 1.15;
  cursor: pointer;
  transition: background-color var(--notes-t-fast) var(--notes-ease-in-out),
    color var(--notes-t-fast) var(--notes-ease-in-out);
}
.right-panel-tab .icon,
.right-panel-tab svg { width: 18px; height: 18px; }
.right-panel-tab[aria-selected='true'] {
  background: var(--selected-bg);
  color: var(--text);
}
.right-panel-tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right-panel-tab-label-short { display: none; }
@media (max-width: 600px) {
  .right-panel-tabs { padding: 4px; }
  .right-panel-tab-label { display: none; }
  .right-panel-tab-label-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Кнопка закрытия оверлея внутри ряда вкладок — тач-цель 44. */
.right-panel .right-panel-close {
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}
.right-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
@media (max-width: 600px) {
  .right-panel-body { padding-bottom: 120px; }
}

/* ---------------------------------------------------------------------------
 * 8. ДОК ПРАВОЙ ПАНЕЛИ: пилюля-переключатель
 * ------------------------------------------------------------------------ */
.right-panel .right-panel-dock {
  flex: 0 0 auto;
  padding-bottom: 8px;
}
.right-panel .right-panel-dock .right-panel-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 16px);
  min-height: 52px;
  margin: 0 8px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--notes-r-row);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.right-panel .right-panel-actions { display: flex; justify-content: space-between; gap: 4px; padding: 4px 8px; }
.right-panel-switcher-menu {
  position: absolute;
  right: 8px;
  bottom: 72px;
  left: 8px;
  z-index: var(--notes-z-menu);
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: var(--notes-r-row);
  background: var(--surface);
  box-shadow: var(--notes-shadow-panel);
}
.right-panel-switcher-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.right-panel-switcher-item.active { background: var(--selected-bg); }

/* ---------------------------------------------------------------------------
 * 9. BOTTOM-SHEET (меню строки/заметки) — слой menu, радиус 30
 * ------------------------------------------------------------------------ */
.sheet-root { position: fixed; inset: 0; z-index: var(--notes-z-menu); }
.sheet-root[hidden] { display: none; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: var(--notes-scrim-color);
  opacity: 0;
  transition: opacity var(--notes-t-base) var(--notes-ease-out);
}
.sheet-root.is-open .sheet-scrim { opacity: 1; }
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-radius: 30px 30px 0 0;
  transform: translateY(102%);
  transition: transform var(--notes-t-base) var(--notes-ease-out),
    opacity var(--notes-t-base) linear;
  touch-action: none;
}
.sheet-root.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }
.sheet.is-settling { transition: transform var(--notes-t-base) var(--notes-ease-out); }
.sheet-grabber {
  flex: 0 0 auto;
  width: 15%;
  height: 4px;
  margin: 8px auto;
  border-radius: 18px;
  background: color-mix(in srgb, var(--text) 30%, transparent);
}
.sheet-title {
  padding: 4px 16px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-scroll {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  max-height: 60vh;
  padding: 0 8px 12px;
  -webkit-overflow-scrolling: touch;
}
.sheet-group {
  margin: 0 0 8px;
  border-radius: 24px;
  background: var(--surface);
  overflow: hidden;
}
.sheet-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44.8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--notes-t-fast) var(--notes-ease-in-out);
}
.sheet-item + .sheet-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 56px;
  right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}
.sheet-item:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
@media (hover: hover) {
  .sheet-item:hover { background: var(--hover-bg); }
}
.sheet-item-icon { display: grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; }
.sheet-item-icon svg { width: 20px; height: 20px; }
.sheet-item-label { flex: 1 1 auto; min-width: 0; }
.sheet-item-hint { color: color-mix(in srgb, var(--text) 55%, transparent); }
.sheet-item.is-danger,
.sheet-item.is-danger .sheet-item-label { color: var(--destructive, #d33); }
.sheet-item:disabled { opacity: 0.45; }

/* ---------------------------------------------------------------------------
 * 10. ПЕРЕХОДЫ: push «список → заметка», drawer, скрим
 * ------------------------------------------------------------------------ */

/* --- Телефон/планшет: список — drawer поверх базового экрана ----------- */
@media (max-width: 1023px) {
  .notes-col-notes {
    position: fixed;
    top: 0;
    bottom: var(--notes-ui-bottom);
    left: 0;
    z-index: var(--notes-z-popover);
    display: flex;
    flex-direction: column;
    width: var(--notes-drawer-w);
    max-width: var(--notes-drawer-w);
    border-radius: 0 var(--notes-drawer-r) var(--notes-drawer-r) 0;
    box-shadow: var(--notes-shadow-panel);
    transform: translate3d(-100%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    will-change: transform;
    transition:
      transform var(--notes-t-base) var(--notes-ease-in-out),
      visibility 0s linear var(--notes-t-base);
  }
  /* Закрытая панель — ПОД центром: уходящий список не просвечивает сквозь
     заметку (двойная экспозиция на кадрах) и не перекрывает её шапку. */
  .notes-col-notes { z-index: var(--notes-z-cover); }
  .notes-col-notes.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: var(--notes-z-popover);
    transition:
      transform var(--notes-t-base) var(--notes-ease-in-out),
      visibility 0s;
  }
  /* Жест «закрыть свайпом»: панель следует за пальцем. */
  .notes-col-notes.is-dragging,
  .notes-col-notes.is-settling { transition: none; }
  .notes-col-notes.is-settling {
    transition: transform var(--notes-t-base) var(--notes-ease-out);
  }
  .notes-col-notes .fm {
    position: static;
    inset: auto;
    width: 100%;
    height: 100%;
    transform: none;
    visibility: visible;
  }
  /* Центр всегда выше закрытого списка (opaque-поверхность заметки). */
  .notes-col-center { position: relative; z-index: var(--notes-z-statusbar); }
  /* Базовый экран телефона: список = сам экран (100 % ширины, без тени). */
  .notes-shell.is-base-list > .notes-col-notes {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }
}

/* --- Push: входящая заметка ±100%→0 (150ms), уходящий список 0→∓20% --- */
@media (max-width: 600px) {
  .notes-shell.is-narrow > .notes-col-center {
    transform: translate3d(100%, 0, 0);
    transition: transform var(--notes-t-push) var(--notes-ease-push-in),
      visibility 0s linear var(--notes-t-push);
    will-change: transform;
    /* В покое экран заметки скрыт целиком (не «прозрачен»): иначе его шапка
       и капсула попадают в hit-test и в кадры поверх списка. */
    visibility: hidden;
  }
  .notes-shell.is-narrow.is-push-in > .notes-col-center {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    transition: transform var(--notes-t-push) var(--notes-ease-push-in),
      visibility 0s;
  }
  .notes-shell.is-narrow > .notes-col-notes {
    transition:
      transform var(--notes-t-push) var(--notes-ease-out),
      opacity var(--notes-t-push) var(--notes-ease-out),
      visibility 0s;
  }
  .notes-shell.is-narrow.is-push-in:not(.is-drawer-open) > .notes-col-notes {
    transform: translate3d(-20%, 0, 0);
    opacity: 0.65;
    pointer-events: none;
    /* Уходящий список виден только во время 150ms перехода, в покое — скрыт:
       иначе футер «Хранилище» и его шапка дублируются поверх заметки. */
    visibility: hidden;
    transition:
      transform var(--notes-t-push) var(--notes-ease-out),
      opacity var(--notes-t-push) var(--notes-ease-out),
      visibility 0s linear var(--notes-t-push);
  }
}

/* ---------------------------------------------------------------------------
 * 11. ДЕСКТОП (≥1024): три колонки, без оверлеев
 * ------------------------------------------------------------------------ */
@media (min-width: 1024px) {
  .notes-shell {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
  }
  .notes-col-notes {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--notes-col-list);
    width: var(--notes-col-list);
    max-width: var(--notes-col-list);
    min-width: 0;
    position: static;
    inset: auto;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }
  .notes-col-notes.is-open { transform: none; }
  .notes-col-notes .fm {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .notes-col-center { flex: 1 1 auto; min-width: 0; }
  .notes-col-right { flex: 0 0 var(--right, 280px); min-width: 0; overflow: hidden; }
  .notes-scrim { display: none; }
  .notes-pull-tab { display: none; }
  /* На десктопе капсулы нет: лента живёт строкой над полотном
     (notes/index.js placeToolbar переносит .md-toolbar в editor-stack). */
  .editor-actions-pill { display: none; }
}
@media (min-width: 1600px) {
  .notes-col-notes { flex-basis: 320px; width: 320px; max-width: 320px; }
  .notes-col-right { flex-basis: 320px; }
}

/* ---------------------------------------------------------------------------
 * 12. ДВИЖЕНИЕ: reduced-motion и принудительный выключатель
 * ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .fm-search,
  .fm-row,
  .fm-row__chev,
  .fm-actions button,
  .fm-action,
  .fm-pill,
  .fm-store__gear,
  .fm-vault__gear,
  .notes-scrim,
  .notes-col-notes,
  .notes-col-center,
  .right-panel,
  .right-panel-tab,
  .sheet,
  .sheet-scrim,
  .sheet-item,
  .editor-actions-pill,
  .note-editor-pane .editor-toolbar {
    transition-duration: 1ms !important;
  }
  .fm-skeleton__row { animation: none !important; }
  .fm-row__chev.is-opening { animation: none !important; }
}

[data-motion-force='off'] .fm-search,
[data-motion-force='off'] .fm-row,
[data-motion-force='off'] .fm-row__chev,
[data-motion-force='off'] .fm-actions button,
[data-motion-force='off'] .fm-action,
[data-motion-force='off'] .fm-pill,
[data-motion-force='off'] .fm-store__gear,
[data-motion-force='off'] .notes-scrim,
[data-motion-force='off'] .notes-col-notes,
[data-motion-force='off'] .notes-col-center,
[data-motion-force='off'] .right-panel,
[data-motion-force='off'] .right-panel-tab,
[data-motion-force='off'] .sheet,
[data-motion-force='off'] .sheet-scrim,
[data-motion-force='off'] .sheet-item,
[data-motion-force='off'] .editor-actions-pill,
[data-motion-force='off'] .note-editor-pane .editor-toolbar {
  transition-duration: 1ms !important;
}
[data-motion-force='off'] .fm-skeleton__row { animation: none !important; }
[data-motion-force='off'] .fm-row__chev.is-opening { animation: none !important; }
/* --- Кнопка «×» — только у drawer'а поверх заметки --------------------- */
/* В базовом списке закрывать нечего (эталон: у списка только действия). */
.fm-action[data-testid='fm-action-close'] { display: none; }
.notes-shell.overlay-drawer .fm-action[data-testid='fm-action-close'] { display: grid; }

/* --- Одна шапка у заметки: без дублирующих переключателей --------------- */
@media (max-width: 600px) {
  .note-editor-pane .editor-toolbar > .editor-panel-btn { display: none !important; }
}
/* --- Дети папки: реальная анимация раскрытия (0fr → 1fr) ----------------
 * Логическая модель строк плоская, но у раскрытой папки появляется
 * DOM-контейнер: grid-template-rows 0fr → 1fr даёт промежуточные высоты
 * (160 мс, ease-out). Внутренний слой с overflow:hidden схлопывает строки. */
.fm-children {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 160ms ease-out;
}
.fm-children > .fm-children-inner {
  min-height: 0;
  overflow: hidden;
}
/* Контейнер есть у каждой папки; раскрытие — только смена атрибута строки. */
.fm-row[data-kind='folder'][aria-expanded='true'] + .fm-children {
  grid-template-rows: 1fr;
}
@media (prefers-reduced-motion: reduce) {
  .fm-children { transition: none; }
}
[data-motion-force='off'] .fm-children { transition: none; }


/* ============================================================================
   ДЕСКТОП (≥1200): один механизм переключения панели — вкладки-иконки сверху.
   Нижняя пилюля-селектор дублировала их и оставалась в доке на широком экране.
   ========================================================================== */
@media (min-width: 1200px) {
  .right-panel .right-panel-dock .right-panel-switcher { display: none; }
}

/* Метаданные файла («Создано/Изменено») — часть блока свойств, не отдельная
   строка под заголовком (Obsidian: file properties). */
.note-editor-pane .note-props .note-meta {
  max-width: none;
  margin: 0;
  padding: 0 var(--s1) var(--s2);
  font-size: 12px;
  line-height: 1.3;
  color: var(--hint);
}
.note-editor-pane .note-props .note-meta.hidden { display: none; }
