/* Мост между UI-китом v4 и текущей разметкой нод Netfold */
.node { overflow: visible; }
.node .node-pattern-layer { border-radius: inherit; overflow: hidden; }
.node.search-active { animation: none; }
/* заголовок центра — шрифт уровня, если пользователь не выбрал свой */
.node.lv-0:not([class*="font-"]) .node-title { font-family: var(--nf-n0-font); font-weight: var(--nf-n0-weight); letter-spacing: -.01em; }
.node.lv-1:not([class*="font-"]) .node-title, .node.lv-2:not([class*="font-"]) .node-title { font-weight: var(--nf-n1-weight); }
/* стикер без clip-path: рамки состояний рисуются ::before, уголок — ::after */
.node.shape-sticky { clip-path: none; box-shadow: 2px 3px 0 color-mix(in srgb, var(--nf-ink) 18%, transparent) !important; padding-bottom: 14px; }
.node.shape-sticky::after { content: ""; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; pointer-events: none; background: linear-gradient(135deg, rgba(0,0,0,.18) 50%, transparent 50%); }
/* бейджи: служебные иконки поверх угла ноды */
.node > .n-badge { pointer-events: none; }
.node.pinned, .node.locked { }
.node.is-locked:hover { transform: none; }
/* линии связей: цвета и толщина темы — только для связей без собственного цвета */
.nf-edge.df-edge.e1 { stroke: var(--nf-edge-1); stroke-width: var(--nf-edge-w1); }
.nf-edge.df-edge.e2 { stroke: var(--nf-edge-2); stroke-width: var(--nf-edge-w2); }
/* inline-стили нод (фон #fff, цвет #1d1d1f) перекрываем только у df-bg / df-color */
.node.lv-0.df-bg { background-color: var(--nf-n0-bg) !important; background-image: none !important; }
.node.lv-1.df-bg { background-color: var(--nf-n1-bg) !important; }
.node.lv-2.df-bg { background-color: var(--nf-n2-bg) !important; }
.node.lv-0.df-color { color: var(--nf-n0-fg) !important; }
.node.lv-1.df-color { color: var(--nf-n1-fg) !important; }
.node.lv-2.df-color { color: var(--nf-n2-fg) !important; }
.node.shape-sticky.df-bg { background-color: var(--nf-sticky-bg) !important; }
body.theme-lagoon .node.lv-0.df-bg { background-image: linear-gradient(135deg, #0F7489, #1B94AD) !important; }
/* поле заголовка и md-текст внутри ноды наследуют цвет ноды */
.node.df-color .node-title, .node.df-color .md-view { color: inherit; }
/* у ноды своя заливка, а цвет текста не задан: текст тёмный, как и был, иначе в тёмных темах он сливается */
.node.lv-0:not(.df-bg).df-color, .node.lv-1:not(.df-bg).df-color, .node.lv-2:not(.df-bg).df-color { color: #1d1d1f !important; }

/* ═══ Верхняя панель: мост между UI-китом и текущей разметкой ═══ */
.net-status-editor { display: none !important; }
.nf-sync.is-offline { display: none; }
body.net-offline .nf-sync.is-ok { display: none; }
body.net-offline .nf-sync.is-offline { display: inline-flex; }
#project-name.nf-mapname, #toolbar.nf-toolbar {
  position: static; transform: none; top: auto; left: auto; margin: 0;
  background: var(--nf-panel-bg); color: var(--nf-ink);
  border: var(--nf-panel-bw) solid var(--nf-panel-line);
  border-radius: calc(var(--nf-panel-r) - 4px);
  box-shadow: var(--nf-float-shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  overflow: visible; white-space: nowrap; text-overflow: clip;
  display: flex; align-items: center;
}
#project-name.nf-mapname { height: var(--nf-toolbar-h); padding: 0 6px 0 14px; gap: 10px; max-width: 360px; cursor: pointer; font-size: 14px; }
#project-name.nf-mapname:hover { background: var(--nf-panel-bg); }
#project-name .nm-title { font-family: var(--nf-title-font); font-weight: var(--nf-title-weight); max-width: 240px; }
#toolbar.nf-toolbar { height: var(--nf-toolbar-h); padding: 0 5px; gap: 2px; }
.nf-tb.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); }
.nf-tb.is-label { font-size: 13px; font-weight: 500; }
.nf-menu { position: fixed; z-index: 1100; }
.nf-menu .mi .on { visibility: hidden; }
.nf-menu .mi.active .on { visibility: visible; }
.nf-menu .mi { font-size: 13.5px; }
#toolbar .nf-tb[disabled], #toolbar .nf-tb.disabled { opacity: .35; }
@media (min-width: 701px) {
  #map-topbar { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: calc(16px + env(safe-area-inset-left)); display: flex; align-items: flex-start; gap: 12px; z-index: 1000; pointer-events: none; }
  #map-topbar > * { pointer-events: auto; }
  
  #left-panel { top: calc(116px + env(safe-area-inset-top)); }
}
@media (max-width: 700px) {
  /* телефон: название слева (справа место под переключатель языка), под ним тулбар с прокруткой вбок */
  #map-topbar {
    position: fixed; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right));
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px; z-index: 1000; pointer-events: none;
  }
  #map-topbar > * { pointer-events: auto; }
  #map-topbar #project-name.nf-mapname { position: static !important; transform: none !important; width: calc(100% - 76px); max-width: none; height: 44px; margin: 0; }
  #map-topbar #toolbar.nf-toolbar {
    position: static !important; transform: none !important; inset: auto !important; margin: 0; width: auto; max-width: 100%;
    overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; scrollbar-width: none; touch-action: pan-x; height: 50px;
  }
  #map-topbar #toolbar.nf-toolbar::-webkit-scrollbar { display: none; }
  #map-topbar #toolbar .nf-tb { flex: none; }
}

/* ── Вкладки карт: компактная кнопка + выпадающий список ── */
#map-tabs { position: static; display: flex; max-width: none; overflow: visible; padding: 0; }
#map-tabs[hidden] { display: none; }
.nf-tabs-btn { height: 52px; min-width: 0; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 600 13px var(--nf-font-ui); color: inherit; }
.nf-tabs-btn svg { width: 18px; height: 18px; }
.nf-tabs-btn .caret { width: 14px; height: 14px; opacity: .6; }
.nf-tabs-btn .cnt { font-weight: 700; min-width: 18px; text-align: center; }
#map-tabs-menu { min-width: 260px; max-width: 340px; }
#map-tabs-menu .map-tab { width: 100%; max-width: none; height: 36px; border: 0; box-shadow: none; background: none; padding: 0 6px 0 10px; border-radius: var(--nf-ctl-r); font-size: 13.5px; color: inherit; }
#map-tabs-menu .map-tab:hover { background: var(--nf-ctl-bg-hover); }
#map-tabs-menu .map-tab .map-tab-name { flex: 1; max-width: none; text-align: left; }
#map-tabs-menu .map-tab .map-tab-x { width: 24px; height: 24px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: inherit; opacity: .55; font-size: 16px; }
#map-tabs-menu .map-tab .map-tab-x:hover { opacity: 1; background: var(--nf-ctl-bg-hover); }
#map-tabs-menu .map-tab.active, body.theme-netfold #map-tabs-menu .map-tab.active, body.theme-midnight #map-tabs-menu .map-tab.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); border: 0; font-weight: 600; }
#map-tabs-menu .map-tab-add { width: 100%; height: 36px; margin-top: 4px; padding: 0 10px; justify-content: flex-start; display: flex; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--nf-line); border-radius: 0 0 var(--nf-ctl-r) var(--nf-ctl-r); background: none; color: var(--nf-muted); cursor: pointer; font: inherit; font-size: 13.5px; }
#map-tabs-menu .map-tab-add:hover { color: inherit; background: var(--nf-ctl-bg-hover); }
#map-tabs-menu .map-tab-add svg { width: 16px; height: 16px; }

/* ── Плавающая панель форматирования (кит, этап 3) ── */
#floating-md-toolbar.nf-bar {
  transform: none; margin-top: 0; flex-wrap: nowrap; height: 42px; padding: 0 4px; gap: 1px;
  background: var(--nf-panel-bg); color: var(--nf-ink);
  border: var(--nf-panel-bw) solid var(--nf-panel-line); border-radius: calc(var(--nf-panel-r) - 4px);
  box-shadow: var(--nf-float-shadow); max-width: calc(100vw - 16px);
}
body.theme-netfold #floating-md-toolbar.nf-bar { box-shadow: 3px 3px 0 #16181D; border-width: 1.5px; border-color: #16181D; }
body.theme-botanical #floating-md-toolbar.nf-bar { border-radius: 999px; }
#floating-md-toolbar.nf-bar.below::after { bottom: auto; top: -7px; transform: rotate(225deg); }
/* кнопки и иконки (общие для плавающей и встроенной панели) */
.md-toolbar .md-btn { color: inherit; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.md-toolbar .md-btn svg, .md-toolbar .md-font-btn svg { width: 17px; height: 17px; flex: none; }
.md-toolbar .md-btn { width: var(--nf-ctl-h-sm, 30px); height: var(--nf-ctl-h-sm, 30px); border-radius: var(--nf-ctl-r); }
.md-toolbar .md-btn:hover, .md-toolbar .md-font-btn:hover { background: var(--nf-ctl-bg-hover); }
.md-toolbar .md-btn:active { background: var(--nf-ctl-bg-hover); }
.md-toolbar .md-btn.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); }
.md-toolbar .md-caret, .md-toolbar .caret { width: 12px; height: 12px; opacity: .6; }
.md-toolbar .md-font-btn { height: var(--nf-ctl-h-sm, 30px); width: 104px; min-width: 0; justify-content: space-between; padding: 0 6px 0 10px; border-radius: var(--nf-ctl-r); font: 500 13px var(--nf-font-ui); }
.md-toolbar .md-font-name { max-width: 70px; }
.md-toolbar .md-size { background: var(--nf-ctl-bg); border-radius: var(--nf-ctl-r); gap: 0; }
.md-toolbar .md-size .md-btn { width: 24px; }
.md-toolbar .md-size .md-btn svg { width: 13px; height: 13px; }
.md-toolbar .md-size-input { width: 28px; height: 26px; border: 0; background: transparent; font: 600 12.5px var(--nf-font-mono); color: inherit; border-radius: 6px; }
.md-toolbar .md-size-input:focus { background: var(--nf-panel-bg); box-shadow: 0 0 0 2px var(--nf-focus); }
.md-toolbar .md-split { display: flex; align-items: center; border-radius: var(--nf-ctl-r); }
.md-toolbar .md-split-main { flex-direction: row; width: 28px; }
.md-toolbar .md-split-arrow { width: 14px; padding: 0; opacity: .75; font-size: 0; }
.md-toolbar .md-split-arrow svg { width: 12px; height: 12px; }
.md-toolbar .md-btn-wide { width: auto; padding: 0 6px; gap: 2px; }
.md-toolbar .md-btn-wide .caret { width: 12px; height: 12px; }
#floating-md-toolbar .nf-sep, .md-toolbar .nf-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--nf-line); flex: none; }
body.theme-netfold .md-toolbar .nf-sep { background: rgba(22,24,29,.18); }
.md-toolbar-inline .nf-sep { display: none; }
@media (pointer: coarse) { .md-toolbar .md-btn { width: 40px; height: 40px; } #floating-md-toolbar.nf-bar { height: 52px; } }
@media (max-width: 700px) {
  #floating-md-toolbar.nf-bar { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(keyboard-inset-height, 0px)); overflow-x: auto; max-width: none; }
  #floating-md-toolbar.nf-bar::after { display: none; }
  /* когда открыта нижняя панель настроек, форматирование есть в ней — плавающую не показываем */
  body:has(#side-panel.open) #floating-md-toolbar { display: none !important; }
}

/* ── Правая панель настроек ноды (кит, этап 4) ── */
#side-panel.nf-panel {
  width: var(--nf-panel-w); padding: 0; bottom: auto; overflow: hidden;
  top: calc(84px + env(safe-area-inset-top)); max-height: calc(100vh - 100px - env(safe-area-inset-top));
  background: var(--nf-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none;
  border: var(--nf-panel-bw) solid var(--nf-panel-line); border-radius: var(--nf-panel-r); box-shadow: var(--nf-panel-shadow);
  display: none; flex-direction: column;
}
#side-panel.nf-panel.open { display: flex; }
.nf-panel .nfp-body { flex: 1 1 auto; min-height: 0; }
.nf-panel .sp-subsection { padding: 12px 0; border: 0; border-top: 1px solid var(--nf-line); margin: 0; }
.nf-panel .nfp-pane > .sp-subsection:first-child, .nf-panel .nfp-pane > :first-child { border-top: 0; padding-top: 6px; }
.nf-panel .sp-subsection-title { margin: 0 0 8px; font-family: var(--nf-label-font); font-size: var(--nf-label-size); font-weight: 600; letter-spacing: var(--nf-label-ls); text-transform: var(--nf-label-tt); color: var(--nf-muted); }
.nf-panel .content-field, .nf-panel .sp-subsection input[type="text"], .nf-panel .sp-subsection input[type="date"], .nf-panel .sp-subsection input[type="url"], .nf-panel select {
  background: var(--nf-ctl-bg); border: 1px solid var(--nf-ctl-line); border-radius: var(--nf-ctl-r); color: var(--nf-ink);
}
.nf-panel .nfp-title.content-field { height: 40px; border: 1.5px solid transparent; background: transparent; font-size: 16px; padding: 0 10px; margin: 0; }
.nf-panel .nfp-title.content-field:hover { background: var(--nf-ctl-bg); }
.nf-panel .nfp-title.content-field:focus { background: var(--nf-card); border-color: var(--nf-focus); outline: none; }
.nf-panel .panel-btn { background: var(--nf-ctl-bg); border: 1px solid var(--nf-ctl-line); border-radius: var(--nf-ctl-r); color: var(--nf-ink); min-height: var(--nf-ctl-h); }
.nf-panel .panel-btn:hover { background: var(--nf-ctl-bg-hover); }
.nf-panel .panel-btn.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); }
.nf-panel .nfp-btn.is-danger.panel-btn { color: #C2271D; background: transparent; border-color: color-mix(in srgb, #C2271D 35%, transparent); margin: 0; }
body.theme-midnight .nf-panel .nfp-btn.is-danger.panel-btn { color: #FF8A80; border-color: rgba(255,138,128,.35); }
.nf-panel .nfp-del { border-top: 0; padding-top: 4px; }
@media (max-width: 700px) {
  #side-panel.nf-panel { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 70vh; border-radius: var(--nf-panel-r) var(--nf-panel-r) 0 0; }
}

/* мост: старые элементы панели в стиле кита (префикс body #side-panel.nf-panel перебивает старые правила тем) */
body #side-panel.nf-panel .type-grid { gap: 6px; margin: 0; }
body #side-panel.nf-panel .nfp-card, body #side-panel.nf-panel .type-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 60px; padding: 8px 4px; box-sizing: border-box;
  border: 1.5px solid transparent; border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); box-shadow: none;
  font-size: 12px; font-weight: 500; text-align: center; line-height: 1.15; cursor: pointer;
}
body #side-panel.nf-panel .nfp-card:hover { background: var(--nf-ctl-bg-hover); }
body #side-panel.nf-panel .nfp-card[aria-pressed="true"], body #side-panel.nf-panel .nfp-card.active { border-color: var(--nf-accent); background: var(--nf-card); color: var(--nf-ink); }
body.theme-netfold #side-panel.nf-panel .nfp-card[aria-pressed="true"] { border-color: #16181D; box-shadow: 2px 2px 0 #16181D; background: #EEF0FF; }
body.theme-midnight #side-panel.nf-panel .nfp-card[aria-pressed="true"] { background: rgba(110,231,255,.08); color: var(--nf-accent); }
body #side-panel.nf-panel .nfp-card:disabled { opacity: .5; cursor: default; }
/* цвета: кружки, 8 в ряд */
body #side-panel.nf-panel .swatches { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 6px; margin: 0 0 8px; }
body #side-panel.nf-panel .swatch { width: auto; height: auto; aspect-ratio: 1; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); cursor: pointer; }
body.theme-midnight #side-panel.nf-panel .swatch { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
body #side-panel.nf-panel .swatch:hover { transform: scale(1.08); }
body #side-panel.nf-panel .swatch.active { box-shadow: 0 0 0 2px var(--nf-panel-bg), 0 0 0 4px var(--nf-ink); }
/* переключатели закрепить / запретить, копировать / применить */
body #side-panel.nf-panel .panel-toggle-row { display: flex; gap: 6px; margin: 0; }
body #side-panel.nf-panel .toggle-btn { flex: 1; min-height: var(--nf-ctl-h); border: 1px solid var(--nf-ctl-line); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; }
body #side-panel.nf-panel .toggle-btn:hover { background: var(--nf-ctl-bg-hover); }
body #side-panel.nf-panel .toggle-btn.on { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); border-color: transparent; }
/* быстрые стили */
body #side-panel.nf-panel .node-style-presets { gap: 6px; }
body #side-panel.nf-panel .node-style-preset { border: 1.5px solid transparent; border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); box-shadow: none; }
body #side-panel.nf-panel .node-style-preset:hover { background: var(--nf-ctl-bg-hover); }
/* готовность */
body #side-panel.nf-panel .node-readiness-grid { margin-top: 0; gap: 6px; }
body #side-panel.nf-panel .node-readiness-btn { border: 1.5px solid transparent; border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); }
body #side-panel.nf-panel .node-readiness-btn small { font-size: 9.5px; opacity: .85; }
body #side-panel.nf-panel .node-readiness-btn.active { border-color: var(--nf-ink); background: var(--nf-card); box-shadow: none; }
/* таймеры, даты, теги */
body #side-panel.nf-panel .timer-preset-btn, body #side-panel.nf-panel .panel-date-row button, body #side-panel.nf-panel .tag-input-row button { border-radius: var(--nf-ctl-r); border: 1px solid var(--nf-ctl-line); background: var(--nf-ctl-bg); color: var(--nf-ink); }
body #side-panel.nf-panel .tag-input-row button { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); border-color: transparent; }
body #side-panel.nf-panel .sp-subsection input, body #side-panel.nf-panel .timer-custom-input { border-radius: var(--nf-ctl-r); }
body #side-panel.nf-panel details.node-style-advanced { border: 1px solid var(--nf-ctl-line); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); }
/* встроенные панели форматирования в панели настроек */
body #side-panel.nf-panel .md-toolbar-inline { background: var(--nf-ctl-bg); border: 1px solid var(--nf-ctl-line); box-shadow: none; border-radius: var(--nf-ctl-r); color: var(--nf-ink); margin-bottom: 8px; padding: 4px; gap: 2px; }
body #side-panel.nf-panel .md-toolbar-inline .md-group { margin-right: 2px; }
body #side-panel.nf-panel .content-field.body-field { border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); border: 1px solid var(--nf-ctl-line); color: var(--nf-ink); }
body #side-panel.nf-panel .nfp-title.content-field { height: 40px; border: 1.5px solid transparent; background: transparent; box-shadow: none; font-size: 16px; padding: 0 10px; margin: 0; color: var(--nf-ink); }
body #side-panel.nf-panel .nfp-title.content-field:hover { background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .nfp-title.content-field:focus { background: var(--nf-card); border-color: var(--nf-focus); outline: none; }
body #side-panel.nf-panel input[type="color"] { width: 100%; height: var(--nf-ctl-h); padding: 3px; border: 1px solid var(--nf-ctl-line); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); cursor: pointer; }

/* ── Чипы готовности и срока (кит, этап 5) ── */
.node .node-readiness-stripe { display: none; }
.node .n-chip.n-date.overdue { background: color-mix(in srgb, #E5484D 16%, transparent); color: #B4232A; }
.node .n-chip.n-date.today { background: color-mix(in srgb, #2E9E5B 16%, transparent); color: #1E7A44; }
.node .n-chip.n-date.soon { background: color-mix(in srgb, #E8A317 20%, transparent); color: #8A5D00; }
body.theme-midnight .node.df-bg .n-chip.n-date.overdue { color: #FF8A80; }
body.theme-midnight .node.df-bg .n-chip.n-date.today { color: #5EEAA0; }
body.theme-midnight .node.df-bg .n-chip.n-date.soon { color: #FFD166; }
.node .n-meta { position: relative; z-index: 1; }
.node > .n-fold { position: absolute !important; z-index: 3; }
.node > .n-badge { position: absolute !important; }
/* свёрнутая ветка: «стопку» из ::after рисовать нельзя (ложится поверх заливки ноды) — вместо неё пунктирный контур */
.node.is-collapsed::after { content: none !important; }
.node.is-collapsed { outline: 1.5px dashed color-mix(in srgb, var(--nf-ink) 50%, transparent); outline-offset: 4px; }
.node.is-collapsed.selected { outline: none; }

/* ── Телефон: главная («Мои карты») — боковая колонка превращается в верхнюю полосу ── */
@media (max-width: 700px) {
  #home.active { flex-direction: column; }
  #home .home-sidebar {
    width: 100%; min-width: 0; min-height: 0; box-sizing: border-box; flex: none;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 10px;
    padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
    border-right: 0; border-bottom: 1px solid var(--nf-line);
  }
  #home .home-brand { margin: 0; }
  #home .home-nav-label, #home .home-nav-item, #home .home-sidebar-spacer { display: none; }
  #home .home-profile-card { grid-column: 3; grid-row: 1; flex-direction: row; gap: 8px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  #home .home-profile-more { margin: 0; }
  #home .home-resource-cards {
    grid-column: 1 / -1; grid-row: 2; margin: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  #home .home-resource-cards::-webkit-scrollbar { display: none; }
  #home .home-resource-card { flex: 0 0 auto; width: 200px; min-height: 52px; padding: 8px 12px; border-radius: 14px; gap: 9px; }
  #home .home-resource-card small { display: none; }
  #home .home-resource-card > span:last-child { display: none; }
  #home .home-resource-card > span:first-child { width: 30px; height: 30px; flex-basis: 30px; font-size: 18px; }
  #home .home-main { flex: 1 1 auto; min-height: 0; }
}

@media (max-width: 700px) {
  body #home .home-topbar { margin-bottom: 14px; padding: 10px 14px 0; gap: 8px; flex-direction: column; align-items: stretch; }
  body[class] #home .home-actions { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 8px; scrollbar-width: none; padding-bottom: 2px; }
  body[class] #home .home-actions::-webkit-scrollbar { display: none; }
  #home .home-actions > * { flex: 0 0 auto; white-space: nowrap; }
  #home .home-btn { padding: 7px 12px; font-size: 13px; }
  #home .home-welcome { padding-top: 12px; }
}

@media (max-width: 700px) {
  #hint { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
  #map-tabs { margin: 0; }
}

@media (max-width: 700px) {
  #map-topbar #project-name.nf-mapname { width: calc(100% - 76px - 76px); }
  #map-topbar #map-tabs { position: absolute; top: 0; right: 76px; left: auto; width: max-content; margin: 0; }
  #map-topbar #map-tabs .nf-tabs-btn { height: 44px; padding: 0 12px; gap: 6px; }
  #map-topbar #map-tabs .nf-tabs-btn .caret, #map-topbar #map-tabs .nf-tabs-btn svg:last-child:not(:first-child) { display: none; }
}

@media (max-width: 700px) {
  body:has(#side-panel.open) #hint { display: none !important; }
}

/* ── Окно входа / регистрации в стиле кита ── */
body #auth-modal { background: color-mix(in srgb, var(--nf-ink, #16181d) 46%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-family: var(--nf-font-ui); }
body #auth-modal .auth-box {
  width: min(400px, 100%); padding: 26px 24px 22px; border-radius: calc(var(--nf-panel-r, 18px) + 2px);
  background: var(--nf-panel-bg, #fff); color: var(--nf-ink, #1d1d1f); border: 1px solid var(--nf-line, #e5e5ea);
  box-shadow: var(--nf-float-shadow, 0 24px 60px rgba(0,0,0,.3));
}
body #auth-modal .auth-box h2 { margin: 0 0 8px; font-family: var(--nf-font-head); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
body #auth-modal .auth-box p { color: var(--nf-muted, #6b6b73); font-size: 14px; margin-bottom: 14px; }
body #auth-modal .auth-box label { margin: 12px 0 6px; font-family: var(--nf-label-font, var(--nf-font-mono)); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nf-muted, #6b6b73); }
body #auth-modal .auth-box input {
  height: 44px; padding: 0 14px; border-radius: var(--nf-ctl-r, 10px); border: 1px solid var(--nf-line, #d2d2d7);
  background: var(--nf-ctl-bg, transparent); color: inherit; font-family: var(--nf-font-ui); font-size: 15px;
}
body #auth-modal .auth-box input:focus { outline: 2px solid var(--nf-focus, var(--nf-sel, #2f45ff)); outline-offset: 2px; border-color: transparent; }
body #auth-modal .auth-message { min-height: 18px; margin: 10px 0 0 !important; }
body #auth-modal .auth-footer { margin-top: 14px; flex-direction: row-reverse; }
body #auth-modal .auth-footer button { height: 44px; padding: 0 18px; border-radius: var(--nf-ctl-r, 10px); font-family: var(--nf-font-ui); font-size: 15px; transition: transform var(--nf-dur) var(--nf-ease), background var(--nf-dur); }
body #auth-modal #auth-submit { flex: 1; background: var(--nf-ctl-on-bg, #16181d); color: var(--nf-ctl-on-fg, #fff); font-weight: 650; }
body #auth-modal #auth-submit:active { transform: scale(.98); }
body #auth-modal #auth-close { background: transparent; border: 1px solid var(--nf-line, #d2d2d7); color: inherit; }
body #auth-modal #auth-toggle { display: block; width: 100%; margin-top: 14px; padding: 8px 0; color: var(--nf-muted, #6b6b73); font-family: var(--nf-font-ui); font-size: 14px; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
body #auth-modal #auth-toggle:hover { color: inherit; }
@media (max-width: 560px) { #landing .landing-nav-actions #landing-register-top { display: none; } }

/* ── Согласие при регистрации и ссылки на документы ── */
body #auth-modal .auth-box label.auth-consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-family: var(--nf-font-ui); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; line-height: 1.45; color: var(--nf-muted, #6b6b73); }
body #auth-modal .auth-box label.auth-consent[hidden] { display: none; }
body #auth-modal .auth-box label.auth-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; padding: 0; accent-color: var(--nf-ctl-on-bg, #16181d); }
body #auth-modal .auth-box label.auth-consent a { color: inherit; text-underline-offset: 2px; }
#landing .landing-legal { margin-left: auto; display: flex; gap: 14px; }
#landing .landing-legal a { color: inherit; text-decoration: none; }
#landing .landing-legal a:hover { text-decoration: underline; }
#landing .landing-legal + button { margin-left: 18px; }
@media (max-width: 560px) {
  #landing .landing-footer { flex-wrap: wrap; padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); row-gap: 10px; }
  #landing .landing-legal { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  #landing .landing-legal + button { margin-left: auto; }
}

/* ═════ Вкладка «Стиль»: готовые стили, узоры, палитра ═════ */
body #side-panel.nf-panel .sp-minor-label { margin: 10px 0 6px; font-size: 12px; color: var(--nf-muted); }
/* готовые стили: 3 колонки, миниатюра сверху */
body #side-panel.nf-panel .node-style-presets { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
body #side-panel.nf-panel .node-style-preset { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 5px 5px 7px; border: 1.5px solid transparent; border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); cursor: pointer; min-width: 0; }
body #side-panel.nf-panel .node-style-preset > span:last-child { font-size: 11.5px; line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #side-panel.nf-panel .node-style-preset.active, body #side-panel.nf-panel .node-style-preset[aria-pressed="true"] { border-color: var(--nf-ink); background: var(--nf-card, var(--nf-panel-bg)); }
body #side-panel.nf-panel .node-style-preset:disabled { opacity: .5; cursor: default; }
/* миниатюра */
.style-thumb { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); font-size: 15px; line-height: 1; }
.style-thumb > b { position: relative; z-index: 2; font-weight: 700; font-family: var(--nf-font-head); }
.style-thumb .node-pattern-layer { border-radius: inherit; }
body.theme-midnight .style-thumb { box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
/* выпадающий список узоров */
body #side-panel.nf-panel .nfp-select { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; border: 1px solid var(--nf-ctl-line, var(--nf-line)); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
body #side-panel.nf-panel .nfp-select .style-thumb { width: 52px; aspect-ratio: 16 / 10; flex: none; border-radius: 6px; }
body #side-panel.nf-panel .nfp-select .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #side-panel.nf-panel .nfp-select .caret { width: 16px; height: 16px; flex: none; opacity: .6; transition: transform var(--nf-dur) var(--nf-ease); }
body #side-panel.nf-panel .nfp-select[aria-expanded="true"] .caret { transform: rotate(180deg); }
body #side-panel.nf-panel .pattern-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid var(--nf-line); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); max-height: 260px; overflow-y: auto; }
body #side-panel.nf-panel .pattern-grid[hidden] { display: none; }
body #side-panel.nf-panel .pattern-tile { display: flex; flex-direction: column; gap: 4px; padding: 3px; border: 1.5px solid transparent; border-radius: 9px; background: none; color: var(--nf-ink); cursor: pointer; min-width: 0; }
body #side-panel.nf-panel .pattern-tile:hover { background: var(--nf-ctl-bg-hover); }
body #side-panel.nf-panel .pattern-tile.active { border-color: var(--nf-ink); }
body #side-panel.nf-panel .pattern-tile > span:last-child { font-size: 10px; line-height: 1.15; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nf-muted); }
body #side-panel.nf-panel .pattern-tile .style-thumb { border-radius: 6px; aspect-ratio: 4 / 3; }
/* палитра */
body #side-panel.nf-panel .color-block { display: block; margin-bottom: 6px; }
body #side-panel.nf-panel .swatches .swatch { padding: 0; }
body #side-panel.nf-panel .swatches.swatches-full { grid-template-columns: repeat(12, minmax(0,1fr)); gap: 4px; margin-top: 8px; }
body #side-panel.nf-panel .swatches.swatches-full[hidden] { display: none; }
body #side-panel.nf-panel .color-more { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 2px; padding: 4px 2px; border: 0; background: none; color: var(--nf-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
body #side-panel.nf-panel .color-more:hover { color: var(--nf-ink); }
body #side-panel.nf-panel .color-more svg { width: 14px; height: 14px; transition: transform var(--nf-dur) var(--nf-ease); }
body #side-panel.nf-panel .color-more[aria-expanded="true"] svg { transform: rotate(180deg); }
body #side-panel.nf-panel .color-custom { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--nf-ctl-line, var(--nf-line)); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); font-size: 13.5px; cursor: pointer; }
body #side-panel.nf-panel .color-custom .dot { width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(#f44, #fc4, #8e4, #4dd, #48f, #c4f, #f44); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
body #side-panel.nf-panel .color-custom input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
/* режим фона: мягче, чем тёмная плашка */
body #side-panel.nf-panel .toggle-btn.on { background: var(--nf-card, var(--nf-panel-bg)); color: var(--nf-ink); border: 1.5px solid var(--nf-ink); box-shadow: none; }
/* формы: подпись над сеткой, текст не вылезает */
body #side-panel.nf-panel .shape-cards { width: 100%; }
body #side-panel.nf-panel .shape-cards .nfp-card { min-width: 0; padding: 8px 4px; }
body #side-panel.nf-panel .shape-cards .nfp-card > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
@media (max-width: 700px) { body #side-panel.nf-panel .swatches.swatches-full { grid-template-columns: repeat(12, minmax(0,1fr)); } }

/* ── Подсказки тегов: один скролл, тема, открытие вверх ── */
body .tag-autocomplete { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; background: var(--nf-panel-bg, #fff); color: var(--nf-ink, #1d1d1f); font-family: var(--nf-font-ui); border: 1px solid var(--nf-line, rgba(0,0,0,.08)); box-shadow: var(--nf-float-shadow, 0 12px 40px rgba(0,0,0,.18)); -webkit-backdrop-filter: none; backdrop-filter: none; }
body .tag-autocomplete .ta-list { overflow: visible; flex: none; }
body .tag-autocomplete .ta-section-title { color: var(--nf-muted, #86868b); font-family: var(--nf-label-font, inherit); }
body .tag-autocomplete .ta-sep { background: var(--nf-line, rgba(0,0,0,.08)); }
body #side-panel.nf-panel .toggle-btn svg.ic { width: 18px; height: 18px; flex: none; }
body #side-panel.nf-panel .palettes-save-btn { background: var(--nf-ctl-on-bg, #16181d); color: var(--nf-ctl-on-fg, #fff); border: 0; border-radius: var(--nf-ctl-r); font-family: var(--nf-font-ui); }
body #side-panel.nf-panel .palettes-save-btn:hover { filter: brightness(1.1); }
body #side-panel.nf-panel .shape-cards .nfp-card { padding: 8px 2px; }
body #side-panel.nf-panel .shape-cards .nfp-card > span { font-size: 10.5px; letter-spacing: -.02em; }

/* ── Статус сегментами ── */
body #side-panel.nf-panel .node-readiness-grid { display: flex; gap: 3px; margin: 2px 0 0; padding: 3px; border-radius: calc(var(--nf-ctl-r) + 2px); background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .node-readiness-btn { flex: 1; min-width: 0; min-height: 30px; padding: 0; border: 0; border-radius: calc(var(--nf-ctl-r) - 2px); background: transparent; display: flex; align-items: center; justify-content: center; box-shadow: none; cursor: pointer; }
body #side-panel.nf-panel .node-readiness-btn > span { width: 100%; height: 10px; margin: 0 3px; border-radius: 99px; background: color-mix(in srgb, var(--nf-ink) 12%, transparent); box-shadow: none; transition: background var(--nf-dur), transform var(--nf-dur) var(--nf-ease); }
body #side-panel.nf-panel .node-readiness-btn.filled > span { background: var(--readiness-color); }
body #side-panel.nf-panel .node-readiness-btn:hover > span { transform: scaleY(1.25); }
body #side-panel.nf-panel .node-readiness-btn.active { background: var(--nf-card, var(--nf-panel-bg)); box-shadow: 0 0 0 1.5px var(--readiness-color); border: 0; }
body #side-panel.nf-panel .node-readiness-btn small { display: none; }
body #side-panel.nf-panel .node-readiness-caption { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13.5px; font-weight: 600; }
body #side-panel.nf-panel .node-readiness-caption i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
/* нажатые Ж / К / З */
.md-toolbar .md-btn[aria-pressed="true"] { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); }
/* слой украшений из библиотеки */
.node .node-pattern-custom, .style-thumb .node-pattern-custom { border-radius: inherit; }

/* ═══ Оформление нод (библиотека дизайнера) ═══ */
.node { }
.node .node-illus-layer, .style-thumb .node-illus-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; background: center / cover no-repeat; background-position: right bottom; background-size: cover; background-repeat: no-repeat; }
.node .node-deco, .style-thumb .node-deco { position: absolute; z-index: 2; pointer-events: none; }
.node .node-deco-top, .style-thumb .node-deco-top { left: 50%; transform: translateX(-50%); }
.node .node-deco-top.is-repeat, .style-thumb .node-deco-top.is-repeat { left: 14px; right: 14px; width: auto !important; transform: none; }
.node .node-deco-clip, .style-thumb .node-deco-clip { position: absolute; inset: 0; z-index: 2; overflow: hidden; border-radius: inherit; pointer-events: none; }
.node .node-deco-clip > .node-deco, .style-thumb .node-deco-clip > .node-deco { z-index: 0; }
.node.has-deco { overflow: visible; }
.style-thumb { position: relative; overflow: hidden; }
.zoom-out .node .node-pattern-layer, .zoom-out .node .node-illus-layer { display: none; }

/* блок «Оформление» */
body #side-panel.nf-panel .decor-tabs { display: flex; gap: 2px; padding: 3px; border-radius: calc(var(--nf-ctl-r) + 2px); background: var(--nf-ctl-bg); margin-bottom: 8px; }
body #side-panel.nf-panel .decor-tabs button { flex: 1; min-width: 0; padding: 6px 2px; border: 0; border-radius: calc(var(--nf-ctl-r) - 2px); background: transparent; color: var(--nf-muted); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
body #side-panel.nf-panel .decor-tabs button:hover { color: var(--nf-ink); }
body #side-panel.nf-panel .decor-tabs button[aria-selected="true"] { background: var(--nf-card, var(--nf-panel-bg)); color: var(--nf-ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
body #side-panel.nf-panel .decor-search { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 8px 10px; border: 1px solid var(--nf-ctl-line, var(--nf-line)); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); font: inherit; font-size: 13px; }
body #side-panel.nf-panel .decor-search:focus { outline: 2px solid var(--nf-focus, #2f45ff); outline-offset: 1px; }
body #side-panel.nf-panel .decor-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
body #side-panel.nf-panel .decor-chip { padding: 4px 10px; border: 1px solid var(--nf-line); border-radius: 99px; background: transparent; color: var(--nf-muted); font: inherit; font-size: 12px; cursor: pointer; }
body #side-panel.nf-panel .decor-chip.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); border-color: transparent; }
body #side-panel.nf-panel .decor-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 2px 4px; }
body #side-panel.nf-panel .decor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
body #side-panel.nf-panel .decor-group { margin: 8px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nf-muted); font-family: var(--nf-label-font, inherit); }
body #side-panel.nf-panel .decor-tile { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: var(--nf-ctl-r); background: transparent; color: var(--nf-ink); font: inherit; cursor: pointer; min-width: 0; }
body #side-panel.nf-panel .decor-tile:hover { background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .decor-tile.active { border-color: var(--nf-ink); background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .decor-tile:disabled, body #side-panel.nf-panel .decor-row:disabled { opacity: .5; cursor: not-allowed; }
body #side-panel.nf-panel .decor-tile .style-thumb { width: 100%; height: 52px; display: block; border: 1px solid var(--nf-line); }
body #side-panel.nf-panel .decor-tile .cap { font-size: 11px; line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #side-panel.nf-panel .decor-tile .chk, body #side-panel.nf-panel .decor-row .chk { position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); box-sizing: border-box; }
body #side-panel.nf-panel .decor-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 4px; padding: 6px; border: 1px solid transparent; border-radius: var(--nf-ctl-r); background: transparent; color: var(--nf-ink); font: inherit; text-align: left; cursor: pointer; }
body #side-panel.nf-panel .decor-row:hover { background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .decor-row.active { border-color: var(--nf-ink); background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .decor-row .style-thumb { width: 64px; height: 44px; flex: none; border: 1px solid var(--nf-line); }
body #side-panel.nf-panel .decor-row .txt { display: flex; flex-direction: column; min-width: 0; padding-right: 22px; }
body #side-panel.nf-panel .decor-row .txt b { font-size: 13.5px; font-weight: 600; }
body #side-panel.nf-panel .decor-row .txt i { font-style: normal; font-size: 11.5px; color: var(--nf-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #side-panel.nf-panel .decor-row .chk { top: 50%; transform: translateY(-50%); }
body #side-panel.nf-panel .decor-empty { padding: 16px 4px; text-align: center; color: var(--nf-muted); font-size: 13px; }
body #side-panel.nf-panel .decor-settings { margin-top: 8px; }
body #side-panel.nf-panel .decor-settings:empty { display: none; }
body #side-panel.nf-panel .decor-hint { margin-top: 4px; font-size: 12px; color: #b45309; }
body.theme-midnight #side-panel.nf-panel .decor-hint { color: #fbbf24; }
body #side-panel.nf-panel .decor-reset { margin-top: 10px; width: 100%; padding: 8px; border: 1px dashed var(--nf-line); border-radius: var(--nf-ctl-r); background: transparent; color: var(--nf-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
body #side-panel.nf-panel .decor-reset:hover { color: var(--nf-ink); border-color: var(--nf-ink); }

/* сворачиваемые секции панели */
body #side-panel.nf-panel .sp-subsection.is-open, body #side-panel.nf-panel .sp-subsection[data-collapsible] { padding: 0; margin: 0; border-bottom: 1px solid var(--nf-line); }
body #side-panel.nf-panel .sp-subsection[data-collapsible]:last-child { border-bottom: 0; }
body #side-panel.nf-panel .sp-sec-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 11px 2px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
body #side-panel.nf-panel .sp-sec-toggle:hover { color: var(--nf-ink); }
body #side-panel.nf-panel .sp-sec-toggle:focus-visible { outline: 2px solid var(--nf-focus, #2f45ff); outline-offset: -2px; border-radius: 6px; }
body #side-panel.nf-panel .sp-sec-caret { width: 16px; height: 16px; flex: none; color: var(--nf-muted); transition: transform var(--nf-dur) var(--nf-ease); transform: rotate(-90deg); }
body #side-panel.nf-panel .sp-subsection.is-open > .sp-sec-toggle .sp-sec-caret { transform: none; }
body #side-panel.nf-panel .sp-sec-body { padding: 0 2px 12px; }
body #side-panel.nf-panel .sp-sec-body[hidden] { display: none; }

/* вкладка «Ещё»: дата */
body #side-panel.nf-panel .panel-date-row { display: flex; gap: 6px; align-items: stretch; }
body #side-panel.nf-panel .panel-date-row input[type=date] { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--nf-ctl-line, var(--nf-line)); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-ink); font: inherit; font-size: 13.5px; }
body #side-panel.nf-panel .date-clear { width: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--nf-ctl-line, var(--nf-line)); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-muted); cursor: pointer; padding: 0; }
body #side-panel.nf-panel .date-clear svg { width: 14px; height: 14px; }
body #side-panel.nf-panel .date-clear:disabled { opacity: .4; cursor: default; }
body #side-panel.nf-panel .date-human { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--nf-ink); text-transform: capitalize; }
body #side-panel.nf-panel .date-human.is-overdue { color: #C2271D; }
body.theme-midnight #side-panel.nf-panel .date-human.is-overdue { color: #FF8A80; }
body #side-panel.nf-panel .date-quick { display: flex; gap: 6px; margin-top: 8px; }
body #side-panel.nf-panel .date-chip { flex: 1; padding: 7px 4px; border: 1px solid var(--nf-line); border-radius: var(--nf-ctl-r); background: transparent; color: var(--nf-ink); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
body #side-panel.nf-panel .date-chip:hover { background: var(--nf-ctl-bg); }
body #side-panel.nf-panel .date-chip.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); border-color: transparent; }

/* вкладка «Ещё»: удаление в конце, с подтверждением */
body #side-panel.nf-panel .nfp-del { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--nf-line); }
body #side-panel.nf-panel .nfp-del [hidden] { display: none !important; }
body #side-panel.nf-panel .nfp-del-text { font-size: 13px; color: var(--nf-ink); margin-bottom: 8px; }
body #side-panel.nf-panel .nfp-del-btns { display: flex; gap: 6px; }
body #side-panel.nf-panel .nfp-del-btns .nfp-btn { flex: 1; width: auto; }
body #side-panel.nf-panel .nfp-btn.is-danger.solid { background: #C2271D; color: #fff; border-color: transparent; }
body #side-panel.nf-panel .nfp-btn.is-danger.solid:hover { background: #a81f16; }
/* таймер/диаграмма/картинка: компактнее */
body #side-panel.nf-panel .timer-preset-btn, body #side-panel.nf-panel .type-btn { border: 1px solid var(--nf-line); border-radius: var(--nf-ctl-r); background: transparent; color: var(--nf-ink); font-family: inherit; }
body #side-panel.nf-panel .type-btn.active { background: var(--nf-ctl-on-bg); color: var(--nf-ctl-on-fg); border-color: transparent; }
body #side-panel.nf-panel .decor-tabs button { padding: 6px 1px; font-size: 11.5px; letter-spacing: -.01em; }
body #side-panel.nf-panel .date-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--nf-ctl-line, var(--nf-line)); border-radius: var(--nf-ctl-r); background: var(--nf-ctl-bg); color: var(--nf-muted); font-size: 13.5px; cursor: pointer; }
body #side-panel.nf-panel .date-field.has-value { color: var(--nf-ink); font-weight: 600; }
body #side-panel.nf-panel .date-field.is-overdue { color: #C2271D; }
body.theme-midnight #side-panel.nf-panel .date-field.is-overdue { color: #FF8A80; }
body #side-panel.nf-panel .date-field svg { width: 16px; height: 16px; flex: none; }
body #side-panel.nf-panel .date-field .date-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #side-panel.nf-panel .date-field input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
body #side-panel.nf-panel .date-human { margin-top: 6px; font-weight: 500; font-size: 12.5px; color: var(--nf-muted); }

/* Статус на ноде: цвет точки и мягкая подложка соответствуют уровню готовности */
body .node .n-chip.st-todo, body .node .n-chip.st-doing, body .node .n-chip.st-done { background: color-mix(in srgb, var(--st-color, #888) 15%, transparent); font-weight: 600; }
body .node .n-chip.st-todo::before, body .node .n-chip.st-doing::before, body .node .n-chip.st-done::before { width: 9px; height: 9px; background: var(--st-color, #888); box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-color, #888) 28%, transparent); opacity: 1; }
body.theme-midnight .node .n-chip.st-todo, body.theme-midnight .node .n-chip.st-doing, body.theme-midnight .node .n-chip.st-done { background: color-mix(in srgb, var(--st-color, #888) 22%, transparent); }

/* ═══ Окно выбора шаблона: категории, режим, прокрутка ═══ */
#tpl-modal .tpl-box { max-width: 860px; }
#tpl-modal .tpl-grid { max-height: 38vh; overflow: auto; padding: 2px; }
#tpl-modal .tpl-card .tdesc { font-size: 12px; line-height: 1.35; }
.tpl-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.tpl-cat { border: 1px solid var(--nf-line, #d9d9de); background: transparent; color: inherit; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.tpl-cat:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.tpl-cat.active { background: var(--nf-accent, #0071e3); border-color: transparent; color: #fff; }
.tpl-mode { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, currentColor 7%, transparent); margin: 0 0 12px; }
.tpl-mode[hidden] { display: none; }
.tpl-mode button { border: 0; background: transparent; color: inherit; padding: 7px 14px; border-radius: 9px; font: inherit; font-size: 13px; cursor: pointer; }
.tpl-mode button.active { background: var(--nf-card, #fff); box-shadow: 0 1px 4px rgba(0,0,0,.18); font-weight: 600; }

/* ═══ Подсказки в пустых нодах-заготовках ═══ */
.node .md-view.is-hint { color: var(--nf-muted, #8a8a90); font-style: italic; opacity: .85; }

/* ═══ «Карта жизни»: подгонка пакета дизайнера под разметку редактора ═══ */
body .node.lm-center { width: 276px; height: 276px; padding: 0 !important; display: grid !important; align-content: center; justify-items: center; overflow: visible !important; background: transparent !important; box-shadow: none !important; border: 0 !important; outline: none; text-align: center; }
body .node.lm-center::after { content: '' !important; position: absolute; inset: 30px; border-radius: 50%; background: #16181D; box-shadow: 0 0 0 2px #16181D; z-index: 0; }
body.theme-midnight .node.lm-center::after { background: #6EE7FF; box-shadow: 0 0 0 1px #6EE7FF, 0 0 32px rgba(110,231,255,.35); }
body .node.lm-center > .node-title { position: relative !important; z-index: 1; text-align: center; background: transparent; border: 0; color: #fff; font: var(--nf-n0-weight, 700) 23px/1.1 var(--nf-n0-font, inherit) !important; padding: 0; height: auto !important; width: 160px !important; margin: 0 auto !important; }
body .node.lm-center > .md-view { position: relative !important; z-index: 1; width: 160px !important; margin: 6px auto 0 !important; text-align: center; font-size: 12.5px; line-height: 1.35; opacity: .8; color: #fff; max-height: none !important; overflow: visible !important; height: auto !important; }
body.theme-midnight .node.lm-center > .node-title, body.theme-midnight .node.lm-center > .md-view { color: #04202A; }
body .node.lm-center > .lm-wheel { z-index: 1; }
body .node.lm-center > .lm-sum { bottom: 52px; left: 50%; transform: translateX(-50%); margin: 0; width: 150px; text-align: center; line-height: 1.25; white-space: normal; z-index: 1; color: #fff; }
body.theme-midnight .node.lm-center > .lm-sum { color: #04202A; }
.node.lm-sphere .lm-head { display: block; position: relative; min-width: 0; }
.node.lm-sphere .lm-title { font-weight: 700; font-size: 15px; line-height: 1.2; color: inherit; word-break: break-word; }
.node.lm-sphere .node-title { position: absolute !important; left: 0; top: 0; width: 100%; height: 100%; background: transparent; border: 0; padding: 0; color: transparent; caret-color: var(--sp); font-weight: 700; font-size: 15px; }
.node.lm-sphere .node-title:focus { color: inherit; background: var(--nf-card, #fff); z-index: 3; }
.node.lm-sphere .md-view { padding: 0; margin-top: 3px; font-size: 12.5px; opacity: .72; color: inherit; }
.node.lm-sphere .lm-status { border: 0; cursor: pointer; color: inherit; font-family: inherit; }
.node.lm-sphere .lm-open { padding: 0; }
.node.lm-sphere .resize-handle { display: none; }
.node.lm-child .node-title { padding-left: 20px; background: transparent; border: 0; font-size: 11px; font-family: var(--nf-font-mono, monospace); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--sp); height: auto; }
.node.lm-child .lm-cico { left: 12px; top: 13px; width: 14px; height: 14px; color: var(--sp); pointer-events: none; }
.node.lm-child .md-view { font-size: 13px; }
body .node.lm-sphere > .lm-open, body .node.lm-center > .lm-sum, body .node.lm-child > .lm-cico, body .node.lm-center > .lm-wheel { position: absolute !important; }
body .node.lm-sphere > .lm-head, body .node.lm-sphere > .lm-foot, body .node.lm-sphere > .lm-ico { position: relative !important; }

.node.lm-sphere.is-collapsed { outline: none; }

/* ═══ Главный экран: теги, закрепление, фильтр, перетаскивание ═══ */
.home-filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 0 6px; scrollbar-width: thin; }
.home-filter-bar[hidden] { display: none; }
.home-filter-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--nf-line, #e3dbd0); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.home-filter-chip span { font-size: 11px; opacity: .6; }
.home-filter-chip:hover { border-color: color-mix(in srgb, var(--nf-accent, #ca684c) 55%, var(--nf-line, #e3dbd0)); }
.home-filter-chip.active { background: var(--nf-ink, #302b27); border-color: var(--nf-ink, #302b27); color: var(--nf-card, #fff); }
.home-filter-chip.tagged:not(.active) { background: hsl(var(--h) 70% 94%); color: hsl(var(--h) 45% 28%); border-color: hsl(var(--h) 50% 84%); }
.home-tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; line-height: 1.5; background: hsl(var(--h, 30) 70% 92%); color: hsl(var(--h, 30) 45% 28%); }
.home-tag.more { --h: 220; background: color-mix(in srgb, currentColor 10%, transparent); color: var(--nf-muted, #888); }
.home-tag::before { content: '#'; opacity: .55; }
.home-tag.more::before { content: ''; }
body.dark .home-tag, body.theme-midnight .home-tag { background: hsl(var(--h, 30) 35% 24%); color: hsl(var(--h, 30) 70% 82%); }
body.dark .home-filter-chip.tagged:not(.active), body.theme-midnight .home-filter-chip.tagged:not(.active) { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 70% 82%); border-color: hsl(var(--h) 30% 32%); }
.project-card .card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.project-card .pin-badge { position: absolute; top: 10px; left: 12px; font-size: 13px; opacity: .85; }
#home .project-card.is-pinned { border-color: color-mix(in srgb, var(--nf-accent, #ca684c) 45%, var(--nf-line, #e3dbd0)); }
.project-card .pin-btn { filter: grayscale(1); opacity: .65; }
.project-card .pin-btn.on { filter: none; opacity: 1; }
@media (hover: none) { .project-card .actions { opacity: 1; } }
.home-group-label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--nf-muted, #8a8a90); margin: 8px 0 -4px; }
.home-group-label:first-of-type { margin-top: 0; }
.project-card { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.project-card.is-dragging { opacity: .3; transform: scale(.98); }
.drag-ghost { position: fixed !important; z-index: 10000; pointer-events: none; opacity: .92; transform: rotate(1.5deg) scale(1.03); box-shadow: 0 22px 44px rgba(0,0,0,.28) !important; margin: 0 !important; }
body.home-dragging, body.home-dragging * { cursor: grabbing !important; }
.project-card.drop-before { box-shadow: inset 5px 0 0 var(--nf-accent, #ca684c), 0 8px 22px rgba(68,49,34,.08) !important; }
.project-card.drop-after { box-shadow: inset -5px 0 0 var(--nf-accent, #ca684c), 0 8px 22px rgba(68,49,34,.08) !important; }
#map-tags-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(20,16,12,.45); display: grid; place-items: center; padding: 16px; }
#map-tags-modal .map-tags-box { width: min(440px, 100%); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
#map-tags-modal h3 { margin: 0 0 4px; font-size: 18px; }
#map-tags-modal .mt-name { color: var(--nf-muted, #888); font-size: 13px; margin-bottom: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#map-tags-modal .mt-chips, #map-tags-modal .mt-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 26px; }
#map-tags-modal .mt-empty { color: var(--nf-muted, #888); font-size: 13px; }
#map-tags-modal .home-tag.removable button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
#map-tags-modal .home-tag.suggest { cursor: pointer; border: 1px dashed hsl(var(--h) 40% 60%); }
#map-tags-modal .mt-input { width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--nf-line, #ddd); background: transparent; color: inherit; font: inherit; margin-bottom: 14px; }
#map-tags-modal .mt-sugg-title { font-size: 12px; color: var(--nf-muted, #888); margin-bottom: 6px; }
#map-tags-modal .mt-actions { display: flex; justify-content: flex-end; }
#map-tags-modal .mt-done { border: 0; border-radius: 12px; padding: 10px 20px; font: inherit; font-weight: 600; background: var(--nf-accent, #ca684c); color: #fff; cursor: pointer; }

/* ═══ Корзина карт ═══ */
#home .home-trash-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 12px; border: 1px solid var(--nf-line, #ddd); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
#home .home-trash-btn[hidden] { display: none; }
#home .home-trash-btn:hover { background: rgba(0,0,0,.05); }
#home .home-trash-btn .ht-count { font-weight: 600; opacity: .7; }
#trash-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(20,16,12,.45); display: grid; place-items: center; padding: 16px; }
#trash-modal .trash-box { width: min(520px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
#trash-modal h3 { margin: 0 0 4px; font-size: 18px; }
#trash-modal .tr-hint { margin: 0 0 14px; color: var(--nf-muted, #888); font-size: 13px; }
#trash-modal .tr-list { overflow: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
#trash-modal .tr-none { color: var(--nf-muted, #888); font-size: 14px; padding: 18px 0; text-align: center; }
#trash-modal .tr-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--nf-line, #ddd); border-radius: 12px; }
#trash-modal .tr-info { flex: 1; min-width: 0; }
#trash-modal .tr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#trash-modal .tr-left { font-size: 12px; color: var(--nf-muted, #888); margin-top: 2px; }
#trash-modal .tr-restore, #trash-modal .tr-kill, #trash-modal .tr-empty, #trash-modal .tr-close { border: 1px solid var(--nf-line, #ddd); background: transparent; color: inherit; border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; }
#trash-modal .tr-restore { border-color: var(--nf-accent, #ca684c); color: var(--nf-accent, #ca684c); font-weight: 600; }
#trash-modal .tr-kill { padding: 8px 10px; }
#trash-modal .tr-actions { display: flex; justify-content: space-between; gap: 8px; }
#trash-modal .tr-close { border: 0; background: var(--nf-accent, #ca684c); color: #fff; font-weight: 600; padding: 10px 20px; margin-left: auto; }
#trash-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 20000; max-width: min(520px, calc(100vw - 32px)); display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 12px; background: rgba(29,29,31,.94); color: #fff; font-size: 13.5px; box-shadow: 0 8px 26px rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#trash-toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
#trash-toast .tt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#trash-toast .tt-undo { border: 0; background: transparent; color: #ffb59f; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ═══ Окно «лимит достигнут» ═══ */
#limit-modal { position: fixed; inset: 0; z-index: 9500; background: rgba(20,16,12,.45); display: grid; place-items: center; padding: 16px; }
#limit-modal .limit-box { width: min(420px, 100%); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
#limit-modal h3 { margin: 0 0 8px; font-size: 18px; }
#limit-modal p { margin: 0 0 18px; color: var(--nf-muted, #6b625b); font-size: 14px; line-height: 1.5; }
#limit-modal .lm-actions { display: flex; justify-content: flex-end; }
#limit-modal .lm-close { border: 0; border-radius: 12px; padding: 10px 20px; font: inherit; font-weight: 600; background: var(--nf-accent, #ca684c); color: #fff; cursor: pointer; }

/* ═══ «Мои карты» v2: превью, готовность, цвета тегов ═══ */
.home-tag.tc-violet, .home-filter-chip.tc-violet { --tc: #5B3FD0; }
.home-tag.tc-blue, .home-filter-chip.tc-blue { --tc: #2F45FF; }
.home-tag.tc-sky, .home-filter-chip.tc-sky { --tc: #1C6AB8; }
.home-tag.tc-teal, .home-filter-chip.tc-teal { --tc: #0E7385; }
.home-tag.tc-green, .home-filter-chip.tc-green { --tc: #26703F; }
.home-tag.tc-olive, .home-filter-chip.tc-olive { --tc: #5F6B12; }
.home-tag.tc-gold, .home-filter-chip.tc-gold { --tc: #7A6000; }
.home-tag.tc-orange, .home-filter-chip.tc-orange { --tc: #A34A08; }
.home-tag.tc-red, .home-filter-chip.tc-red { --tc: #B03F28; }
.home-tag.tc-pink, .home-filter-chip.tc-pink { --tc: #B02A70; }
.home-tag.tc-slate, .home-filter-chip.tc-slate { --tc: #4B5468; }
body.dark .home-tag, body.dark .home-filter-chip, body.theme-midnight .home-tag, body.theme-midnight .home-filter-chip { }
body.dark .home-tag.tc-violet, body.dark .home-filter-chip.tc-violet, body.theme-midnight .home-tag.tc-violet, body.theme-midnight .home-filter-chip.tc-violet { --tc: #B5A2FF; }
body.dark .home-tag.tc-blue, body.dark .home-filter-chip.tc-blue, body.theme-midnight .home-tag.tc-blue, body.theme-midnight .home-filter-chip.tc-blue { --tc: #8C9BFF; }
body.dark .home-tag.tc-sky, body.dark .home-filter-chip.tc-sky, body.theme-midnight .home-tag.tc-sky, body.theme-midnight .home-filter-chip.tc-sky { --tc: #7DBEFF; }
body.dark .home-tag.tc-teal, body.dark .home-filter-chip.tc-teal, body.theme-midnight .home-tag.tc-teal, body.theme-midnight .home-filter-chip.tc-teal { --tc: #5FD3E3; }
body.dark .home-tag.tc-green, body.dark .home-filter-chip.tc-green, body.theme-midnight .home-tag.tc-green, body.theme-midnight .home-filter-chip.tc-green { --tc: #6EE29E; }
body.dark .home-tag.tc-olive, body.dark .home-filter-chip.tc-olive, body.theme-midnight .home-tag.tc-olive, body.theme-midnight .home-filter-chip.tc-olive { --tc: #C9D86A; }
body.dark .home-tag.tc-gold, body.dark .home-filter-chip.tc-gold, body.theme-midnight .home-tag.tc-gold, body.theme-midnight .home-filter-chip.tc-gold { --tc: #EBC54A; }
body.dark .home-tag.tc-orange, body.dark .home-filter-chip.tc-orange, body.theme-midnight .home-tag.tc-orange, body.theme-midnight .home-filter-chip.tc-orange { --tc: #FFA35C; }
body.dark .home-tag.tc-red, body.dark .home-filter-chip.tc-red, body.theme-midnight .home-tag.tc-red, body.theme-midnight .home-filter-chip.tc-red { --tc: #FF9A82; }
body.dark .home-tag.tc-pink, body.dark .home-filter-chip.tc-pink, body.theme-midnight .home-tag.tc-pink, body.theme-midnight .home-filter-chip.tc-pink { --tc: #FF8BC4; }
body.dark .home-tag.tc-slate, body.dark .home-filter-chip.tc-slate, body.theme-midnight .home-tag.tc-slate, body.theme-midnight .home-filter-chip.tc-slate { --tc: #B4BDD3; }
#home .home-tag { background: color-mix(in srgb, var(--tc, #4B5468) 16%, var(--nf-card, #fff)); color: var(--nf-ink, #302b27); }
#home .home-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tc, #4B5468); opacity: 1; }
#home .home-tag.more { background: color-mix(in srgb, currentColor 10%, transparent); color: var(--nf-muted, #888); }
#home .home-tag.more::before { display: none; }
#map-tags-modal .home-tag { background: color-mix(in srgb, var(--tc, #4B5468) 16%, var(--nf-card, #fff)); color: var(--nf-ink, #302b27); }
#map-tags-modal .home-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tc, #4B5468); opacity: 1; }
.home-filter-chip.tagged:not(.active) { background: color-mix(in srgb, var(--tc, #4B5468) 12%, var(--nf-card, #fff)); color: var(--nf-ink, #302b27); border-color: color-mix(in srgb, var(--tc, #4B5468) 35%, var(--nf-line, #e3dbd0)); }
.home-filter-chip.tagged:not(.active)::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tc, #4B5468); }
body.dark .home-filter-chip.tagged:not(.active), body.theme-midnight .home-filter-chip.tagged:not(.active) { background: color-mix(in srgb, var(--tc, #4B5468) 18%, var(--nf-card, #222)); color: var(--nf-ink, #eee); }
#home .project-card .card-preview { margin: -23px -23px 14px -23px; height: 132px; background: color-mix(in srgb, var(--nf-accent, #ca684c) 7%, var(--nf-card, #fff)); background-image: radial-gradient(color-mix(in srgb, var(--nf-ink, #302b27) 14%, transparent) 1px, transparent 1.2px); background-size: 14px 14px; border-bottom: 1px solid var(--nf-line, #e3dbd0); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#home .project-card .card-preview svg { width: 100%; height: 100%; display: block; }
#home .project-card .actions { z-index: 2; }
#home .project-card .pin-badge { z-index: 2; background: var(--nf-card, #fff); border-radius: 8px; padding: 2px 5px; top: 9px; }
#home .project-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
#home .project-card .m-ago { min-width: 0; }
#home .project-card .m-prog { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
#home .project-card .m-prog b { font-weight: 600; color: var(--nf-ink, #302b27); }
#home .project-card .m-prog i { display: block; width: 46px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--nf-ink, #302b27) 12%, transparent); overflow: hidden; }
#home .project-card .m-prog u { display: block; height: 100%; background: #26a05a; border-radius: 3px; }
#home .project-card .m-count { white-space: nowrap; }

/* ── «Мои карты»: сортировка, вид, выбор нескольких, список ── */
.home-ctrl { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.home-ctrl[hidden] { display: none; }
.home-ctrl-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--nf-line, #e3dbd0); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.home-ctrl-btn:hover { border-color: color-mix(in srgb, var(--nf-accent, #ca684c) 55%, var(--nf-line, #e3dbd0)); }
.home-ctrl-btn.active { background: var(--nf-ink, #302b27); color: var(--nf-card, #fff); border-color: var(--nf-ink, #302b27); }
.home-view-toggle { display: inline-flex; border: 1px solid var(--nf-line, #e3dbd0); border-radius: 12px; overflow: hidden; background: var(--nf-card, #fff); }
.home-view-toggle button { width: 40px; height: 36px; border: 0; background: transparent; color: var(--nf-muted, #888); font-size: 16px; cursor: pointer; }
.home-view-toggle button[aria-pressed="true"] { background: var(--nf-ink, #302b27); color: var(--nf-card, #fff); }
.home-pop { position: fixed; z-index: 9100; min-width: 220px; max-width: 320px; padding: 6px; border-radius: 14px; background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border: 1px solid var(--nf-line, #e3dbd0); box-shadow: 0 18px 44px rgba(0,0,0,.22); }
.home-pop button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.home-pop button:hover { background: color-mix(in srgb, var(--nf-ink, #302b27) 7%, transparent); }
.home-pop button i { font-style: normal; color: var(--nf-accent, #ca684c); visibility: hidden; }
.home-pop button[aria-checked="true"] i { visibility: visible; }
.home-pop button.danger { color: #c2271d; }
.home-pop p { margin: 6px 12px 8px; padding-top: 10px; border-top: 1px solid var(--nf-line, #e3dbd0); font-size: 12px; line-height: 1.4; color: var(--nf-muted, #888); }
.sel-box { display: none; }
body.home-selecting .project-card .sel-box { display: block; position: absolute; top: 10px; left: 10px; z-index: 3; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--nf-line, #cfc6ba); background: var(--nf-card, #fff); }
body.home-selecting .project-card.is-selected .sel-box { background: var(--nf-accent, #ca684c); border-color: var(--nf-accent, #ca684c); }
body.home-selecting .project-card.is-selected .sel-box::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
body.home-selecting .project-card .pin-badge { left: 42px; }
body.home-selecting .project-card .actions { display: none; }
.project-card.is-selected { box-shadow: 0 0 0 3px var(--nf-accent, #ca684c) !important; }
body.home-selecting .project-card, body.home-selecting .home-row { cursor: pointer; }
#home-selbar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9050; display: flex; align-items: center; gap: 4px; padding: 8px; border-radius: 16px; background: #16181D; color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.3); max-width: calc(100vw - 24px); overflow-x: auto; }
#home-selbar[hidden] { display: none; }
body.dark #home-selbar, body.theme-midnight #home-selbar { background: #E8EEFC; color: #0D1220; }
#home-selbar .sb-n { padding: 0 10px 0 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
#home-selbar .sb-btn { border: 0; background: none; color: inherit; font: inherit; font-size: 13.5px; font-weight: 600; height: 38px; padding: 0 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
#home-selbar .sb-btn:hover:not(:disabled) { background: rgba(127,127,127,.22); }
#home-selbar .sb-btn:disabled { opacity: .4; cursor: default; }
#home-selbar .sb-btn.danger { color: #FF8A80; }
body.dark #home-selbar .sb-btn.danger, body.theme-midnight #home-selbar .sb-btn.danger { color: #C2271D; }
#home-selbar .sb-btn.icon { width: 38px; padding: 0; justify-content: center; }
#home-selbar .sb-sep { width: 1px; height: 24px; background: rgba(127,127,127,.4); margin: 0 4px; }
@media (max-width: 700px) { #home-selbar .sb-btn span { display: none; } #home-selbar .sb-btn[data-a="all"] { font-size: 12px; } }
/* список */
#projects.list-mode { display: block; }
.home-list { display: flex; flex-direction: column; border-radius: 16px; background: var(--nf-card, #fff); border: 1px solid var(--nf-line, #e3dbd0); overflow: hidden; margin-bottom: 18px; }
.home-row { display: grid; grid-template-columns: 24px 24px 64px minmax(0, 1fr) 150px 120px 70px 44px 36px; align-items: center; gap: 12px; min-height: 64px; padding: 6px 12px; border-top: 1px solid var(--nf-line, #e3dbd0); font-size: 13.5px; color: var(--nf-ink, #302b27); position: relative; }
.home-row.head { min-height: 38px; border-top: 0; font: 600 11px var(--nf-font-mono, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--nf-muted, #888); background: color-mix(in srgb, var(--nf-ink, #302b27) 4%, var(--nf-card, #fff)); cursor: default; }
.home-row:not(.head) { cursor: pointer; }
.home-row:not(.head):hover { background: color-mix(in srgb, var(--nf-ink, #302b27) 4%, transparent); }
.home-row.is-selected { background: color-mix(in srgb, var(--nf-accent, #ca684c) 12%, var(--nf-card, #fff)); }
.home-row .hr-grip { color: var(--nf-muted, #888); cursor: grab; text-align: center; font-size: 16px; }
.home-row .hr-check { display: grid; place-items: center; cursor: pointer; }
.home-row .hr-check input { width: 18px; height: 18px; accent-color: var(--nf-accent, #ca684c); cursor: pointer; }
.home-row .hr-pv { width: 64px; height: 40px; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--nf-ink, #302b27) 5%, var(--nf-card, #fff)); box-shadow: inset 0 0 0 1px var(--nf-line, #e3dbd0); }
.home-row .hr-pv svg { width: 100%; height: 100%; display: block; }
.home-row .hr-name { min-width: 0; }
.home-row .hr-name b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-row .hr-name .card-tags { margin: 4px 0 0; flex-wrap: nowrap; overflow: hidden; }
.home-row .hr-prog { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.home-row .hr-prog b { font-weight: 600; min-width: 34px; }
.home-row .hr-prog i { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--nf-ink, #302b27) 10%, transparent); overflow: hidden; }
.home-row .hr-prog u { display: block; height: 100%; background: #26703F; }
.home-row .muted, .home-row .hr-ago, .home-row .hr-nested { color: var(--nf-muted, #888); }
.home-row .hr-pin, .home-row .hr-more { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-size: 15px; filter: grayscale(1); opacity: .5; }
.home-row .hr-pin[aria-pressed="true"] { filter: none; opacity: 1; background: color-mix(in srgb, var(--nf-accent, #ca684c) 22%, transparent); }
.home-row .hr-more { filter: none; font-size: 20px; color: var(--nf-muted, #888); opacity: 1; }
.home-row .hr-pin:hover, .home-row .hr-more:hover { opacity: 1; background: color-mix(in srgb, var(--nf-ink, #302b27) 8%, transparent); }
.home-row.is-dragging { opacity: .3; }
.home-row.drop-before { box-shadow: inset 0 4px 0 var(--nf-accent, #ca684c); }
.home-row.drop-after { box-shadow: inset 0 -4px 0 var(--nf-accent, #ca684c); }
.home-row.drag-ghost { position: fixed; z-index: 9999; pointer-events: none; background: var(--nf-card, #fff); box-shadow: 0 14px 34px rgba(0,0,0,.25); border-radius: 12px; opacity: .95; }
@media (max-width: 760px) {
  .home-row { grid-template-columns: 22px 56px minmax(0, 1fr) 36px 34px; gap: 8px; }
  .home-row .hr-grip, .home-row .hr-prog, .home-row .hr-ago, .home-row .hr-nested { display: none; }
  .home-row.head { display: none; }
  .home-row .hr-pv { width: 56px; height: 36px; }
}

/* ── Корзина как страница, подтверждения ── */
body.home-trash-view .home-section-heading, body.home-trash-view #home-filter-bar, body.home-trash-view #home-ctrl, body.home-trash-view .home-trash-btn { display: none !important; }
body.home-trash-view #home-create-map { display: none; }
#home .home-nav-item { cursor: pointer; }
#home .home-nav-item .home-nav-count { margin-left: auto; font-size: 12px; font-weight: 600; opacity: .6; }
.trash-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; color: var(--nf-muted, #888); font-size: 14px; }
.trash-clear { border: 0; background: none; color: #c2271d; font: inherit; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.trash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.trash-card { cursor: default !important; }
.trash-card .card-preview { opacity: .7; filter: saturate(.7); }
.trash-card .meta { align-items: flex-start; gap: 12px; }
.trash-card .m-left { color: #A34A08; font-size: 12px; text-align: right; }
.trash-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; }
.trash-btns .tr-restore { border: 1px solid var(--nf-line, #ddd); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 12px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.trash-btns .tr-restore:hover { border-color: var(--nf-accent, #ca684c); }
.trash-btns .tr-kill { border: 0; background: none; color: #c2271d; font: inherit; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.trash-empty { text-align: center; padding: 60px 16px; color: var(--nf-muted, #888); }
.trash-empty .te-ic { font-size: 44px; opacity: .6; margin-bottom: 10px; }
.trash-empty h3 { margin: 0 0 6px; color: var(--nf-ink, #302b27); font-size: 20px; }
.trash-empty p { margin: 0 0 18px; }
.trash-empty .te-back { border: 0; border-radius: 12px; padding: 11px 20px; font: inherit; font-weight: 600; background: var(--nf-accent, #ca684c); color: #fff; cursor: pointer; }
#home-confirm { position: fixed; inset: 0; z-index: 9200; background: rgba(20,16,12,.45); display: grid; place-items: center; padding: 16px; }
#home-confirm .hc-box { width: min(480px, 100%); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 18px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
#home-confirm h3 { margin: 0 0 10px; font-size: 19px; }
#home-confirm p { margin: 0 0 14px; line-height: 1.5; color: var(--nf-muted, #6b6560); }
#home-confirm .hc-list { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--nf-ink, #302b27) 6%, var(--nf-card, #fff)); font-size: 14px; display: grid; gap: 6px; max-height: 180px; overflow: auto; }
#home-confirm .hc-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
#home-confirm .hc-actions button { border-radius: 12px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--nf-line, #ddd); background: var(--nf-card, #fff); color: inherit; }
#home-confirm .hc-ok { background: var(--nf-accent, #ca684c) !important; border-color: transparent !important; color: #fff !important; }
#home-confirm .hc-ok.danger { background: #c2271d !important; }
body.home-trash-view #projects { display: block; }
body.home-trash-view #home .home-welcome .home-eyebrow, body.home-trash-view #home .home-welcome .sub, body.home-trash-view #home #home-create-map { display: none !important; }
body.home-trash-view .home-group-label { margin: 10px 0 14px; }

/* ── Настройки ── */
body.home-settings-view #home .home-welcome { margin-bottom: 18px; }
.st-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 18px; padding: 2px 0 6px; }
.st-tabs button { flex: 0 0 auto; border: 1px solid var(--nf-line, #e3dbd0); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.st-tabs button:hover { border-color: var(--nf-accent, #ca684c); }
.st-page { max-width: 820px; }
.st-sec { margin: 0 0 30px; scroll-margin-top: 16px; }
.st-sec h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.st-sub { margin: 0 0 12px; color: var(--nf-muted, #888); font-size: 14px; }
.st-card { border: 1px solid var(--nf-line, #e3dbd0); background: var(--nf-card, #fff); border-radius: 18px; overflow: hidden; margin-top: 10px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-top: 1px solid var(--nf-line, #e3dbd0); }
.st-card > .st-row:first-child { border-top: 0; }
.st-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.st-t b { display: block; font-size: 14.5px; }
.st-t span, .st-hint { display: block; margin-top: 3px; font-size: 13px; color: var(--nf-muted, #888); line-height: 1.45; }
.st-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.st-theme { border: 2px solid var(--nf-line, #e3dbd0); border-radius: 14px; background: var(--nf-card, #fff); padding: 8px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--nf-ink, #302b27); text-align: left; }
.st-theme i { display: block; height: 44px; border-radius: 9px; background: var(--tb); margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.st-theme.on { border-color: var(--nf-accent, #ca684c); }
.st-theme.on span::after { content: ' ✓'; color: var(--nf-accent, #ca684c); }
.st-select { min-width: 190px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--nf-line, #ddd); background: var(--nf-card, #fff); color: inherit; font: inherit; }
.st-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--nf-ink, #302b27) 22%, transparent); cursor: pointer; transition: background .15s; }
.st-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.st-switch[aria-checked="true"] { background: #26703F; }
.st-switch[aria-checked="true"]::after { transform: translateX(20px); }
.st-switch:disabled { opacity: .5; cursor: default; }
.st-btn { flex: 0 0 auto; border: 1px solid var(--nf-line, #ddd); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 12px; padding: 10px 16px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.st-btn:hover:not(:disabled) { border-color: var(--nf-accent, #ca684c); }
.st-btn:disabled { opacity: .45; cursor: default; }
.st-used { font-size: 14.5px; }
.st-bar { display: flex; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--nf-ink, #302b27) 10%, transparent); overflow: hidden; }
.st-bar i, .st-legend i { display: inline-block; }
.st-bar i.a { background: #2F45FF; } .st-bar i.b { background: #9a9a9a; }
.st-legend { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--nf-muted, #888); }
.st-legend i { width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.st-legend i.a { background: #2F45FF; } .st-legend i.b { background: #9a9a9a; }
.st-legend b { color: var(--nf-ink, #302b27); margin-left: 4px; }
.st-drop { border: 2px dashed var(--nf-line, #cfc6ba); border-radius: 14px; padding: 26px 16px; text-align: center; cursor: pointer; color: var(--nf-ink, #302b27); }
.st-drop u { color: var(--nf-accent, #ca684c); font-weight: 600; text-decoration: none; }
.st-drop small { display: block; margin-top: 6px; color: var(--nf-muted, #888); }
.st-drop.over, .st-drop:focus-visible { border-color: var(--nf-accent, #ca684c); background: color-mix(in srgb, var(--nf-accent, #ca684c) 8%, transparent); outline: none; }
.st-kgroup { padding: 12px 20px 4px; font: 600 11px var(--nf-font-mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--nf-muted, #888); }
.st-krow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 20px; border-top: 1px solid var(--nf-line, #e3dbd0); font-size: 14px; }
.st-keys { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.st-keys kbd { min-width: 24px; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--nf-ink, #302b27) 8%, var(--nf-card, #fff)); box-shadow: 0 1px 0 var(--nf-line, #d8d0c4); font: 600 12px var(--nf-font-mono, monospace); text-align: center; }
@media (max-width: 700px) { .st-row { flex-wrap: wrap; padding: 14px 16px; } .st-krow { padding: 9px 16px; } }

/* ── Телефон: «Мои карты / Корзина / Настройки» — компактные кнопки в верхней полосе ── */
@media (max-width: 700px) {
  body #home .home-sidebar { width: 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; flex-direction: row; gap: 8px; }
  body #home .home-brand { order: 0; flex: 1 1 calc(100% - 120px); margin: 0; }
  body #home .home-profile-card { order: 1; flex: 0 0 auto; }
  body #home .home-nav-item { display: flex; order: 2; flex: 1 1 0; min-width: 84px; justify-content: center; gap: 6px; padding: 8px 6px; font-size: 13px; border-radius: 12px; }
  body #home .home-nav-item > span:first-child { font-size: 15px; }
  body #home .home-nav-item > span:not(:first-child) { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body #home .home-nav-item .home-nav-count { display: none; }
  body #home .home-resource-cards { order: 3; flex: 0 0 100%; }
}

/* ── Обучение на главной ── */
#nf-ob-dim { position: fixed; z-index: 9000; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(16,18,24,.55); transition: left .2s, top .2s, width .2s, height .2s; display: none; }
#nf-ob { position: fixed; z-index: 9001; width: min(360px, calc(100vw - 24px)); box-sizing: border-box; padding: 18px; border-radius: 16px; background: var(--nf-card, #fff); color: var(--nf-ink, #16181d); box-shadow: 0 18px 50px rgba(0,0,0,.28); border: 1px solid var(--nf-line, rgba(0,0,0,.12)); }
#nf-ob h3 { margin: 8px 0 6px; font-size: 17px; }
#nf-ob p { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--nf-muted, #5e626c); }
#nf-ob .ob-dots { display: flex; gap: 6px; }
#nf-ob .ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--nf-line, rgba(0,0,0,.2)); }
#nf-ob .ob-dots i.on { background: var(--nf-accent, #2f45ff); width: 20px; border-radius: 4px; }
#nf-ob .ob-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#nf-ob .ob-skip { border: 0; background: none; color: var(--nf-muted, #5e626c); font: inherit; font-size: 14px; cursor: pointer; padding: 10px 4px; }
#nf-ob .ob-next { margin-left: auto; min-height: 42px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--nf-accent, #2f45ff); color: var(--nf-accent-ink, #fff); font: inherit; font-weight: 650; cursor: pointer; }
#nf-ob .ob-next:focus-visible, #nf-ob .ob-skip:focus-visible { outline: 2px solid var(--nf-accent, #2f45ff); outline-offset: 2px; }
/* ── Подсказка «Установить приложение» ── */
#nf-install { position: fixed; z-index: 8000; left: 20px; bottom: 20px; width: min(380px, calc(100vw - 40px)); box-sizing: border-box; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; background: var(--nf-card, #fff); color: var(--nf-ink, #16181d); border: 1px solid var(--nf-line, rgba(0,0,0,.12)); box-shadow: 0 14px 40px rgba(0,0,0,.22); }
#nf-install.ios { background: #16181d; color: #fff; border-color: transparent; }
#nf-install .ni-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#nf-install .ni-t b { font-size: 14px; }
#nf-install .ni-t span { font-size: 12.5px; opacity: .75; line-height: 1.4; }
#nf-install .ni-a { display: flex; gap: 8px; flex: none; }
#nf-install button { min-height: 38px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; border: 1px solid var(--nf-line, rgba(0,0,0,.15)); background: transparent; color: inherit; }
#nf-install .ni-go { background: var(--nf-accent, #2f45ff); color: var(--nf-accent-ink, #fff); border-color: transparent; }
@media (max-width: 700px) { #nf-install { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; } #nf-install .ni-a { width: 100%; justify-content: flex-end; } }

/* ── Cookie ── */
#nf-cookie { position: fixed; z-index: 8500; left: 20px; right: 20px; bottom: 20px; margin: 0 auto; max-width: 860px; box-sizing: border-box; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: var(--nf-card, #fff); color: var(--nf-ink, #16181d); border: 1px solid var(--nf-line, rgba(0,0,0,.12)); box-shadow: 0 14px 40px rgba(0,0,0,.22); }
#nf-cookie .ck-t { display: flex; flex-direction: column; gap: 4px; flex: 1 1 320px; min-width: 0; }
#nf-cookie .ck-t span { font-size: 13px; line-height: 1.45; opacity: .78; }
#nf-cookie .ck-t a { color: var(--nf-accent, #2f45ff); }
#nf-cookie .ck-a { display: flex; gap: 8px; flex-wrap: wrap; }
#nf-cookie button, #nf-cookie-set .ck-save { min-height: 40px; padding: 0 16px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; border: 1px solid var(--nf-line, rgba(0,0,0,.18)); background: transparent; color: inherit; }
#nf-cookie .ck-all, #nf-cookie-set .ck-save { background: var(--nf-accent, #2f45ff); color: var(--nf-accent-ink, #fff); border-color: transparent; }
#nf-cookie-set { position: fixed; inset: 0; z-index: 9100; display: grid; place-items: center; padding: 16px; background: rgba(16,18,24,.5); }
#nf-cookie-set .ck-box { width: min(440px, 100%); box-sizing: border-box; padding: 22px; border-radius: 18px; background: var(--nf-card, #fff); color: var(--nf-ink, #16181d); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
#nf-cookie-set h3 { margin: 0 0 14px; font-size: 18px; }
#nf-cookie-set .ck-opt { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--nf-line, rgba(0,0,0,.12)); }
#nf-cookie-set .ck-opt div { display: flex; flex-direction: column; gap: 3px; }
#nf-cookie-set .ck-opt span { font-size: 12.5px; opacity: .72; line-height: 1.4; }
#nf-cookie-set .ck-on { font-size: 12px; font-weight: 650; white-space: nowrap; opacity: .7; }
#nf-cookie-set .ck-sw { flex: none; width: 46px; height: 28px; border-radius: 999px; border: 0; padding: 0; position: relative; cursor: pointer; background: var(--nf-line, #ccc); }
#nf-cookie-set .ck-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
#nf-cookie-set .ck-sw[aria-checked="true"] { background: var(--nf-accent, #2f45ff); }
#nf-cookie-set .ck-sw[aria-checked="true"]::after { transform: translateX(18px); }
#nf-cookie-set .ck-act { margin-top: 14px; display: flex; justify-content: flex-end; }
@media (max-width: 700px) { #nf-cookie { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); } #nf-cookie .ck-a { width: 100%; } #nf-cookie .ck-a button { flex: 1 1 auto; } }

/* ── История версий / сравнение ── */
.nf-ovl { position: fixed; inset: 0; z-index: 9100; display: grid; place-items: center; padding: 16px; background: rgba(16,18,24,.5); }
.nf-ovl .ov-box { width: min(480px, 100%); max-height: min(88vh, 720px); overflow: auto; box-sizing: border-box; padding: 22px; border-radius: 18px; background: var(--nf-card, #fff); color: var(--nf-ink, #16181d); box-shadow: 0 24px 60px rgba(0,0,0,.35); outline: none; }
.nf-ovl .ov-box.wide { width: min(620px, 100%); }
.nf-ovl h3 { margin: 0 0 2px; font-size: 18px; }
.nf-ovl .ov-sub { font-size: 13px; opacity: .65; margin-bottom: 14px; overflow-wrap: anywhere; }
.nf-ovl .ov-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--nf-line, rgba(0,0,0,.12)); }
.nf-ovl .ov-item.cur { border-top: 0; }
.nf-ovl .oi-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
.nf-ovl .oi-t span { font-size: 12px; opacity: .65; }
.nf-ovl .oi-badge { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--nf-surface-2, #f4f1ea); white-space: nowrap; }
.nf-ovl button { min-height: 38px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; border: 1px solid var(--nf-line, rgba(0,0,0,.18)); background: transparent; color: inherit; }
.nf-ovl .oi-go.arm, .nf-ovl .c-copy { background: var(--nf-accent, #2f45ff); color: var(--nf-accent-ink, #fff); border-color: transparent; }
.nf-ovl .ov-empty { padding: 14px 0; font-size: 13px; opacity: .7; border-top: 1px solid var(--nf-line, rgba(0,0,0,.12)); }
.nf-ovl .ov-foot { margin-top: 12px; font-size: 12px; opacity: .6; }
.nf-ovl .ov-act { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.nf-ovl .cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nf-ovl .cmp-col { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--nf-line, rgba(0,0,0,.14)); background: var(--nf-surface-2, #f4f1ea); }
.nf-ovl .cmp-col em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.nf-ovl .cmp-col .cnt { font-size: 13px; opacity: .7; }
.nf-ovl .cmp-diff { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nf-ovl .df { font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--nf-card, #fff); }
.nf-ovl .df.added { color: #1f7a3d; } .nf-ovl .df.removed { color: #b3402a; }
@media (max-width: 560px) { .nf-ovl .cmp-cols { grid-template-columns: 1fr; } .nf-ovl .cmp-act button { flex: 1 1 100%; } }
#nf-conflict { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: #fff1d6; color: #5c3b00; border: 1px solid #f0d49a; }
body.theme-midnight #nf-conflict { background: #4a3a17; color: #ffe2a8; border-color: #6b5420; }
#nf-conflict .nc-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
#nf-conflict .nc-t span { font-size: 12.5px; opacity: .8; }
#nf-conflict .nc-go { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: #5c3b00; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
body.home-trash-view #nf-conflict { display: none; }
@media (max-width: 700px) { #nf-conflict { flex-wrap: wrap; } #nf-conflict .nc-go { width: 100%; } }

/* ── Вход: забыли пароль / код из письма ── */
#auth-modal .auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
#auth-modal .auth-links button, #auth-modal .alt-resend { border: 0; background: none; padding: 6px 0; font: inherit; font-size: 13px; color: var(--nf-accent, #2f45ff); cursor: pointer; text-decoration: underline; }
#auth-modal .alt-resend { display: block; margin: 10px auto 0; }
#auth-modal .alt-resend:disabled { color: inherit; opacity: .55; text-decoration: none; cursor: default; }
#auth-modal .auth-code { text-align: center; font: 600 24px/1 var(--nf-font-mono, ui-monospace, monospace); letter-spacing: .3em; }
#auth-modal #auth-alt-form .alt-lead { margin-bottom: 8px; }
#auth-modal form[hidden] { display: none !important; }

/* кнопка «−» свернуть ветку: видна при наведении/выделении, на сенсорных — всегда */
.node .n-fold.n-fold-open { min-width: 22px; width: 22px; height: 22px; padding: 0; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.node:hover > .n-fold-open, .node.selected > .n-fold-open, .node > .n-fold-open:focus-visible { opacity: 1; pointer-events: auto; }
@media (hover: none) { .node > .n-fold-open { opacity: .85; pointer-events: auto; } }
.node.fold-up .n-fold.n-fold-open { top: -13px; bottom: auto; right: 50%; transform: translateX(50%); }

/* обучение: кнопка «Показать все возможности» */
.tutorial-more { display: block; margin: 0 0 10px; padding: 0; border: 0; background: none; color: var(--nf-accent, #4b6bfb); font-weight: 600; font-size: 13px; line-height: 1.3; font-family: inherit; cursor: pointer; text-align: left; }
.tutorial-more:hover { text-decoration: underline; }
.tutorial-more[hidden] { display: none; }

/* ── Гостевой режим ── */
#nf-guest, #nf-devlimit { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: var(--nf-surface-2, #f4f1ea); color: var(--nf-ink, #1d1d1f); border: 1px solid var(--nf-line, rgba(0,0,0,.14)); }
#nf-guest .ng-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
#nf-guest .ng-t span { font-size: 12.5px; opacity: .75; }
#nf-guest .ng-go { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--nf-accent, #2f45ff); color: var(--nf-accent-ink, #fff); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; }
body.home-trash-view #nf-guest { display: none; }
@media (max-width: 700px) { #nf-guest { flex-wrap: wrap; } #nf-guest .ng-go { width: 100%; } }
#auth-modal .auth-guest-link { display: block; width: 100%; margin: 6px 0 0; padding: 8px 0; border: 0; background: none; font: inherit; font-size: 13px; color: inherit; opacity: .75; cursor: pointer; text-decoration: underline; }
#nf-guest-merge .gm-list { margin: 4px 0 6px; }
#nf-guest-merge .gm-row { padding: 8px 0; border-top: 1px solid var(--nf-line, rgba(0,0,0,.12)); font-size: 14px; overflow-wrap: anywhere; }
#nf-guest-merge .gm-more { opacity: .6; }

#nf-devlimit .ng-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
#nf-devlimit .ng-t span { font-size: 12.5px; opacity: .75; }
#nf-devlimit .ng-go { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--nf-accent, #2f45ff); color: var(--nf-accent-ink, #fff); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
body.home-trash-view #nf-devlimit { display: none; }
@media (max-width: 700px) { #nf-devlimit { flex-wrap: wrap; } #nf-devlimit .ng-go { width: 100%; } }

.trash-select { border: 1px solid var(--nf-line, #ddd); background: var(--nf-card, #fff); color: var(--nf-ink, #302b27); border-radius: 10px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; margin-left: auto; }
.trash-select.active { border-color: var(--nf-accent, #ca684c); }
.trash-card .sel-box { display: none; }
body.home-selecting .trash-card .sel-box { display: block; position: absolute; top: 10px; left: 10px; z-index: 3; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--nf-line, #c9c1b8); background: var(--nf-card, #fff); }
body.home-selecting .trash-card.is-selected .sel-box { background: var(--nf-accent, #ca684c); border-color: var(--nf-accent, #ca684c); }
body.home-selecting .trash-card.is-selected .sel-box::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
body.home-selecting .trash-card { cursor: pointer !important; position: relative; }
body.home-selecting .trash-card .trash-btns { display: none; }

/* Логотип: единый знак приложения (как в фавиконе) без цветной плитки, поворота и обрезки */
.landing-brand-mark, #home .home-brand .landing-brand-mark { background: none !important; transform: none !important; border-radius: 9px; overflow: hidden; box-shadow: none; }
.landing-brand-mark img { transform: none !important; object-fit: contain; border-radius: 0; }

/* ===== окно входа: панель бренда, вкладки, глазок, надёжность пароля (v74) ===== */
body #auth-modal .nfa-brand { display: none; }
.nfa-tabs { display: flex; gap: 6px; margin: 0 0 16px; }
.nfa-tabs button { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--nf-line, #0003); background: transparent; color: var(--nf-muted, #6b6b73); font: 600 13.5px var(--nf-font-ui); cursor: pointer; }
.nfa-tabs button[aria-selected="true"] { background: var(--nf-ink, #16181d); color: var(--nf-paper, #fff); border-color: transparent; }
.nfa-pw { position: relative; display: block; }
.nfa-pw input { padding-right: 46px !important; }
.nfa-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--nf-muted, #6b6b73); font-size: 17px; cursor: pointer; line-height: 1; }
.nfa-eye:hover { background: var(--nf-surface-2, #0001); }
.nfa-hint { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--nf-muted, #6b6b73); }
.nfa-hint[hidden] { display: none; }
.nfa-hint .bar { display: flex; gap: 3px; flex: none; }
.nfa-hint .bar i { width: 18px; height: 5px; border-radius: 3px; background: var(--nf-line, #0003); }
.nfa-hint.l1 .bar i:nth-child(1) { background: #e0a030; }
.nfa-hint.l2 .bar i { background: #3aa66f; }
@media (min-width: 900px) {
  body #auth-modal .auth-box { width: min(860px, 100%); padding: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); overflow: hidden; align-content: start; }
  body #auth-modal .auth-box > :not(.nfa-brand) { grid-column: 2; margin-left: 36px; margin-right: 36px; width: auto; }
  body #auth-modal .auth-box > :first-child:not(.nfa-brand), body #auth-modal .auth-box > .nfa-brand + * { margin-top: 36px; }
  body #auth-modal .auth-box > :last-child { margin-bottom: 30px; }
  body #auth-modal .auth-box > .nfa-brand { grid-column: 1; grid-row: 1 / span 40; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 30px 28px; background: var(--nf-ink, #16181d); color: var(--nf-paper, #f6f1e7); }
  .nfa-logo { display: flex; align-items: center; gap: 9px; font: 700 20px/1 var(--nf-font-head); letter-spacing: -.03em; }
  .nfa-logo img { width: 30px; height: 30px; border-radius: 9px; }
  .nfa-map { width: 100%; height: auto; }
  .nfa-title { font: 700 24px/1.15 var(--nf-font-head); letter-spacing: -.02em; }
  .nfa-brand ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; opacity: .88; }
  .nfa-brand li::before { content: "✓ "; color: var(--nf-accent-2, #f4c542); }
}
#auth-modal .auth-links[hidden] { display: none; }
@media (min-width: 900px) {
  body #auth-modal .auth-box > label.auth-consent { margin-left: 36px; margin-right: 36px; }
}

/* Кольцо готовности («температура») на центральном узле шаблона */
body .node > .nf-temp { position: absolute !important; right: -14px; top: -14px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; z-index: 3; pointer-events: auto;
  background: conic-gradient(var(--tc) calc(var(--p) * 1%), rgba(120,120,128,.22) 0); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
body .node > .nf-temp i { position: absolute; inset: 5px; border-radius: 50%; background: var(--nf-card, #fff); }
body .node > .nf-temp b { position: relative; font: 700 11px/1 var(--nf-font-head, system-ui); color: var(--nf-ink, #1d1d1f); }

/* Окна (Новая карта, импорт, пароль…) следуют выбранной теме, а не светлой по умолчанию */
body .modal-box { background: var(--nf-card, #fff); color: var(--nf-ink, #1d1d1f); border: 1px solid var(--nf-line, transparent); }
body .modal-box h2, body .modal-box h3, body .modal-box label { color: var(--nf-ink, inherit); }
body .modal-box .sub { color: var(--nf-muted, #86868b); }
body .modal-box input[type="text"], body .modal-box input[type="password"], body .modal-box input:not([type]), body .modal-box select, body .modal-box textarea { background: color-mix(in srgb, var(--nf-ink, #000) 5%, var(--nf-card, #fff)); color: var(--nf-ink, inherit); border-color: var(--nf-line, #d9d9de); }
body .tpl-card { background: color-mix(in srgb, var(--nf-ink, #000) 6%, var(--nf-card, #fff)); color: var(--nf-ink, inherit); }
body .tpl-card:hover { background: color-mix(in srgb, var(--nf-ink, #000) 11%, var(--nf-card, #fff)); border-color: var(--nf-accent, #0071e3); }
body .tpl-card.active { border-color: var(--nf-accent, #0071e3); background: color-mix(in srgb, var(--nf-accent, #0071e3) 16%, var(--nf-card, #fff)); }
body .tpl-card .tname { color: var(--nf-ink, inherit); }
body .tpl-card .tdesc { color: var(--nf-muted, #86868b); }
body .tpl-cat { color: var(--nf-ink, inherit); border-color: var(--nf-line, #d9d9de); }
body .tpl-cat.active { background: var(--nf-accent, #0071e3); border-color: var(--nf-accent, #0071e3); color: #fff; }
body .modal-actions button:not(.create):not(.danger) { background: color-mix(in srgb, var(--nf-ink, #000) 7%, var(--nf-card, #fff)); color: var(--nf-ink, inherit); }
body.theme-midnight .tpl-cat.active, body.theme-midnight .tpl-mode button.active { color: #06202a; }

/* Блоки связей: панель выбора и переключатель вида */
.nfb-ov { position: fixed; inset: 0; z-index: 5200; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.nfb-box { width: min(760px, 100%); max-height: 92vh; overflow: auto; padding: 24px; border-radius: 20px; background: var(--nf-card, #fff); color: var(--nf-ink, #1d1d1f); border: 1px solid var(--nf-line, transparent); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.nfb-box h2 { margin: 0 0 4px; font: 700 22px/1.2 var(--nf-font-head, inherit); }
.nfb-sub { margin: 0 0 16px; color: var(--nf-muted, #86868b); font-size: 14px; }
.nfb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .nfb-grid { grid-template-columns: 1fr; } }
.nfb-tile { position: relative; display: grid; gap: 6px; text-align: left; padding: 10px 10px 12px; border-radius: 14px; border: 2px solid var(--nf-line, #d9d9de); background: color-mix(in srgb, var(--nf-ink, #000) 4%, var(--nf-card, #fff)); color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.nfb-tile:hover { border-color: color-mix(in srgb, var(--nf-accent, #0071e3) 60%, transparent); }
.nfb-tile.on { border-color: var(--nf-accent, #0071e3); box-shadow: 0 0 0 1px var(--nf-accent, #0071e3) inset; }
.nfb-pv { display: block; height: 96px; border-radius: 10px; background: var(--nf-paper, #f4eee5); padding: 6px; color: var(--nf-accent, #0071e3); }
.nfb-pv svg { width: 100%; height: 100%; display: block; }
.nfb-tile b { font-size: 15px; }
.nfb-tile small { color: var(--nf-muted, #86868b); font-size: 12.5px; line-height: 1.35; }
.nfb-plan { position: absolute; right: 12px; top: 12px; font: 600 11px/1 var(--nf-font-ui, inherit); font-style: normal; padding: 4px 8px; border-radius: 99px; background: color-mix(in srgb, #2fa24a 22%, var(--nf-card, #fff)); color: var(--nf-ink, #1d1d1f); }
.nfb-plan.pro { background: var(--nf-ink, #1d1d1f); color: var(--nf-card, #fff); }
.nfb-ring { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 14px; cursor: pointer; }
.nfb-act { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.nfb-act button { border: 0; border-radius: 12px; padding: 10px 18px; font: 600 14px var(--nf-font-ui, inherit); cursor: pointer; background: color-mix(in srgb, var(--nf-ink, #000) 8%, var(--nf-card, #fff)); color: var(--nf-ink, #1d1d1f); }
.nfb-act .create { background: var(--nf-accent, #0071e3); color: #fff; }
body.theme-midnight .nfb-act .create { color: #06202a; }
body .node > .nf-bsw { display: none; position: absolute !important; left: 50%; top: calc(100% + 10px); transform: translateX(-50%); z-index: 6; gap: 2px; padding: 3px; border-radius: 999px; background: var(--nf-card, #fff); border: 1.5px solid var(--nf-ink, #1d1d1f); box-shadow: 0 6px 18px rgba(0,0,0,.18); white-space: nowrap; cursor: default; }
body .node.selected > .nf-bsw { display: flex; }
body .node > .nf-bsw button { border: 0; background: transparent; color: var(--nf-ink, #1d1d1f); font: 600 12px var(--nf-font-ui, inherit); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
body .node > .nf-bsw button[aria-pressed="true"] { background: var(--nf-ink, #1d1d1f); color: var(--nf-card, #fff); }

body .node > .nf-bsw { max-width: min(92vw, 640px); overflow-x: auto; scrollbar-width: none; }
body .node > .nf-bsw::-webkit-scrollbar { display: none; }
.nfb-ov { z-index: 100000; }
@media (min-width: 900px) { .nfb-box { width: min(980px, 100%); } .nfb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nfb-act { position: sticky; bottom: -24px; padding: 12px 0 4px; margin-bottom: -4px; background: linear-gradient(to top, var(--nf-card, #fff) 70%, transparent); }

body .node > .nf-seg { position: absolute !important; z-index: 2; pointer-events: none; display: block; }
body .node > .nf-seg svg { display: block; overflow: visible; }
body .node > .nf-seg svg * { pointer-events: stroke; }

.nfm-box { width: min(560px, 100%); }
.nfm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 8px 0; }
@media (max-width: 560px) { .nfm-list { grid-template-columns: 1fr; } }
.nfm-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.nfm-row:hover { background: color-mix(in srgb, var(--nf-ink, #000) 6%, transparent); }
.nfm-row b { font-weight: 500; }
.nfm-count { margin: 6px 0 0; font-size: 13px; color: var(--nf-muted, #6b6b73); }
.nfb-act .reset { margin-right: auto; }

/* Фолди на пустом экране */
#home .home-empty-state > img.home-foldi { width: 120px; height: auto; display: block; margin-bottom: -4px; }
#hint .hint-foldi { height: 30px; width: auto; vertical-align: middle; margin: -6px 8px -6px -4px; display: inline-block; }

/* Комната обучения */
.nfl-ov { position: fixed; inset: 0; z-index: 100001; background: rgba(20,20,26,.5); display: grid; place-items: center; padding: 16px; }
.nfl-box { width: min(640px, 100%); max-height: min(90vh, 760px); overflow: auto; border-radius: 22px; background: var(--nf-card, #fffdf8); color: var(--nf-ink, #16181d); border: 2px solid var(--nf-ink, #16181d); box-shadow: 6px 6px 0 var(--nf-ink, #16181d); }
.nfl-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px 8px; position: relative; }
.nfl-head h2 { margin: 0; font: 700 22px var(--nf-font-head, serif); letter-spacing: -.01em; }
.nfl-head p { margin: 2px 0 0; color: var(--nf-muted, #6a6d76); font-size: 13px; }
.nfl-x { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 18px; cursor: pointer; color: inherit; }
.nfl-body { padding: 4px 20px 20px; display: grid; gap: 16px; }
.nfl-track h3 { margin: 10px 0 2px; font: 700 16px var(--nf-font-head, serif); }
.nfl-track > p { margin: 0 0 8px; color: var(--nf-muted, #6a6d76); font-size: 13px; }
.nfl-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--nf-line, #d9d2c4); border-radius: 12px; margin-bottom: 8px; }
.nfl-card.off { opacity: .55; }
.nfl-card img { width: 40px; height: 48px; object-fit: contain; }
.nfl-tx { min-width: 0; display: grid; }
.nfl-tx small { color: var(--nf-muted, #6a6d76); }
.nfl-go, .nfl-b { font: 600 13px var(--nf-font-body, system-ui); padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--nf-ink, #16181d); background: transparent; color: inherit; cursor: pointer; }
.nfl-go:not(:disabled), .nfl-b.pri { background: var(--nf-accent, #2f45ff); color: #fff; border-color: var(--nf-ink, #16181d); }
.nfl-go:disabled, .nfl-b:disabled { opacity: .5; cursor: default; }
#nfl-spot { position: fixed; z-index: 100002; display: none; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 3px var(--nf-accent, #2f45ff), 0 0 0 9999px rgba(20,20,26,.35); transition: all .2s; }
#nfl-run { position: fixed; z-index: 100003; width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--nf-card, #fffdf8); color: var(--nf-ink, #16181d); border: 2px solid var(--nf-ink, #16181d); box-shadow: 4px 4px 0 var(--nf-ink, #16181d); }
#nfl-run > img { width: 56px; height: 66px; object-fit: contain; }
.nfl-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.nfl-ct { font: 600 11px/1.3 var(--nf-font-mono, monospace); color: var(--nf-muted, #6a6d76); text-transform: uppercase; letter-spacing: .04em; }
.nfl-quit { border: 0; background: none; color: var(--nf-muted, #6a6d76); cursor: pointer; font-size: 12px; }
.nfl-bar { height: 4px; border-radius: 4px; background: var(--nf-line, #d9d2c4); margin: 6px 0 8px; overflow: hidden; }
.nfl-bar i { display: block; height: 100%; background: var(--nf-accent, #2f45ff); transition: width .25s; }
.nfl-p { margin: 0; font-size: 14px; line-height: 1.45; }
.nfl-note { color: #b8472f; font-size: 13px; }
.nfl-auto { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--nf-accent, #2f45ff); }
.nfl-auto.hit { color: #1f9d55; font-weight: 700; }
.nfl-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
#nfl-run.nfl-gate .nfl-row { justify-content: flex-start; }
@media (max-width: 520px) { .nfl-card { grid-template-columns: 40px 1fr; } .nfl-go { grid-column: 1 / -1; } }

.node-readiness-reset { margin-top: 8px; font: 600 12px var(--nf-font-ui, system-ui); padding: 6px 12px; border-radius: 10px; border: 1.5px solid var(--nf-line, #0003); background: transparent; color: inherit; cursor: pointer; }
.node-readiness-reset:hover { background: var(--nf-surface-3, #eef0ff); }
.node-ring-row { display: flex; gap: 8px; flex-wrap: wrap; }
.node-ring-row button { font: 600 12px var(--nf-font-ui, system-ui); padding: 7px 12px; border-radius: 10px; border: 1.5px solid var(--nf-line, #0003); background: transparent; color: inherit; cursor: pointer; }
.node-ring-row button[aria-pressed=true] { background: var(--nf-accent, #2f45ff); color: #fff; border-color: var(--nf-ink, #16181d); }

/* Круг и овал: кольцо готовности/сегменты рисуются снаружи — не обрезаем (контент скроллится внутри .md-view/.node-body) */
body .node.shape-circle, body .node.shape-ellipse, body .node.shape-oval { overflow: visible !important; }
body .node.shape-circle > .nf-temp, body .node.shape-ellipse > .nf-temp, body .node.shape-oval > .nf-temp { right: calc(14.6% - 24px); top: calc(14.6% - 24px); }

/* Фолди в пустых состояниях */
#nf-empty-map { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 320px; pointer-events: none; z-index: 1; color: var(--nf-ink, #1d1d1f); }
#nf-empty-map[hidden] { display: none; }
#nf-empty-map img { width: 110px; height: auto; }
#nf-empty-map strong { font: 700 18px/1.2 var(--nf-font-head, system-ui); }
#nf-empty-map span { font-size: 14px; opacity: .7; line-height: 1.4; }
.trash-empty .te-ic { opacity: 1; font-size: 0; }
.trash-empty .te-ic img { width: 96px; height: auto; }
#nf-ob .ob-foldi { position: absolute; right: 14px; top: -34px; width: 56px; height: auto; pointer-events: none; }

/* Кольцо по областям — в стиле колеса Карты жизни (дуги напротив веток, скруглённые концы) */
body .node > .nf-seg svg.nf-wheel path { fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
body .node > .nf-seg svg.nf-wheel .st-0 { stroke: rgba(22,24,29,.28); stroke-width: 6; stroke-dasharray: 1 7; }
body .node > .nf-seg svg.nf-wheel .st-1 { stroke: var(--lm-st-1); } body .node > .nf-seg svg.nf-wheel .st-2 { stroke: var(--lm-st-2); }
body .node > .nf-seg svg.nf-wheel .st-3 { stroke: var(--lm-st-3); } body .node > .nf-seg svg.nf-wheel .st-4 { stroke: var(--lm-st-4); }
body .node > .nf-seg svg.nf-wheel .st-5 { stroke: var(--lm-st-5); }
/* Значок «Общее %» выносится наружу кольца, чтобы не перекрывать его */
body .node.nf-badge-out > .nf-temp { right: -60px; top: -60px; }
body .node.shape-circle.nf-badge-out > .nf-temp, body .node.shape-ellipse.nf-badge-out > .nf-temp, body .node.shape-oval.nf-badge-out > .nf-temp { right: calc(14.6% - 24px - 32px); top: calc(14.6% - 24px - 32px); }
/* Боковая панель: между карточками и профилем всегда есть воздух */
#home .home-sidebar-spacer { min-height: 18px; }

/* ИИ-помощник (фаза 1) */
.nf-ai-box { max-width: 460px; width: calc(100vw - 32px); }
.nf-ai-sub { font-size: 12px; opacity: .7; margin: 6px 0 4px; }
.nf-ai-node { font-weight: 600; margin: 4px 0; word-break: break-word; }
.nf-ai-tip { font-size: 12px; opacity: .65; margin: 12px 0 2px; }
.nf-ai-think { opacity: .75; padding: 14px 0; }
.nf-ai-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; max-height: 46vh; overflow: auto; }
.nf-ai-btn { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(120,120,128,.35); background: transparent; color: inherit; font: inherit; cursor: pointer; min-height: var(--nf-ctl-h, 36px); }
.nf-ai-btn:hover:not(:disabled) { background: rgba(120,120,128,.12); }
.nf-ai-btn:disabled { opacity: .45; cursor: not-allowed; }
.nf-ai-primary { padding: 9px 16px; border-radius: 10px; border: 0; background: #2f3cff; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.nf-ai-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid rgba(120,120,128,.28); border-radius: 10px; }
.nf-ai-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nf-ai-row small { opacity: .7; }
.nf-ai-quote { padding: 8px 10px; border-radius: 10px; background: rgba(120,120,128,.12); word-break: break-word; }
.nf-ai-new { background: rgba(47,60,255,.12); }
.nf-ai-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(120,120,128,.4); background: transparent; color: inherit; font: inherit; margin-top: 10px; }
.nf-ai-box .lm-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.nf-ai-box .nf-ai-cancel { text-align: center; }
.nf-ai-head { font-weight: 600; margin: 8px 0 4px; }
.nf-ai-ul { margin: 2px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.nf-ai-ta { resize: vertical; min-height: 140px; }

/* Публикации карт */
.nf-pub-box { max-width: 480px; }
.nf-pub-f { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nf-pub-l { font-size: 12px; opacity: .7; }
.nf-pub-f .nf-ai-input { margin-top: 0; }
.nf-pub-ta { min-height: 70px; resize: vertical; }
.nf-pub-c { display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; }
.nf-pub-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.nf-pub-link a { word-break: break-all; font-size: 13px; }
.nf-pub-err { color: #c2271d; font-size: 13px; min-height: 0; margin-top: 8px; }

/* Фолди на главной и обратная связь (v103) */
#home .nfh-card { position: relative; display: flex; align-items: center; gap: 18px; max-width: 1180px; margin: -16px auto 36px; padding: 16px 44px 16px 18px; border: 1px solid var(--nf-line, #e8dfd4); border-radius: 20px; background: color-mix(in srgb, var(--nf-accent, #2f45ff) 6%, var(--nf-card, #fffdf9)); }
#home .nfh-card[hidden] { display: none; }
#home .nfh-foldi { flex: none; width: 96px; height: auto; max-height: 114px; object-fit: contain; }
#home .nfh-body { min-width: 0; flex: 1; }
#home .nfh-eyebrow { color: var(--nf-accent, #2f45ff); font-size: 10px; font-weight: 750; letter-spacing: .14em; margin-bottom: 6px; }
#home .nfh-bubble { color: var(--nf-ink, #302b27); font-size: 16px; line-height: 1.45; letter-spacing: -.01em; margin-bottom: 12px; }
#home .nfh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#home .nfh-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid var(--nf-line, #e8dfd4); border-radius: 11px; background: var(--nf-card, #fffdf9); color: var(--nf-ink, #302b27); font: 600 12.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-decoration: none; cursor: pointer; }
#home .nfh-btn:hover { border-color: var(--nf-accent, #2f45ff); }
#home .nfh-primary { background: var(--nf-accent, #2f45ff); border-color: var(--nf-accent, #2f45ff); color: #fff; }
#home .nfh-x { position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--nf-muted, #898078); font-size: 20px; line-height: 1; cursor: pointer; }
#home .nfh-x:hover { background: rgba(120,120,128,.14); }
body.home-trash-view #nf-foldi-home { display: none; }
.nfh-box { max-width: 460px; }
.nfh-sub { font-size: 13px !important; margin-bottom: 10px !important; }
.nfh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.nfh-chip { padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(120,120,128,.4); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.nfh-chip.on { background: var(--nf-accent, #2f45ff); border-color: var(--nf-accent, #2f45ff); color: #fff; }
.nfh-ta { resize: vertical; min-height: 110px; }
.nfh-status { min-height: 18px; margin-top: 8px; font-size: 12.5px; color: var(--nf-muted, #6b625b); }
.nfh-ok { display: block; margin: 0 auto 6px; }
@media (max-width: 640px) {
  #home .nfh-card { align-items: flex-start; flex-direction: column; margin-top: -8px; padding: 14px 40px 14px 14px; gap: 10px; }
  #home .nfh-foldi { width: 72px; max-height: 86px; }
}

/* v107: подсказка о закрытой регистрации */
body #auth-modal .auth-invite { margin: 10px 0 0 !important; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--nf-accent, #ca684c) 12%, transparent); font-size: 13px !important; line-height: 1.45; }
body #auth-modal .auth-invite a { color: inherit; font-weight: 700; text-decoration: underline; }
