/* Минерва поверх Docmost: своя шапка вместо родной, золото, без лишних кнопок, красная строка в отзывах. 08.10.2026 */
:root { --mv-h:64px; }
@media (max-width: 899px) { :root { --mv-h:101px; } }
/* родные шапка и боковая панель Docmost — скрыты; папки открываются кнопкой слева в шапке Минервы */
header.mantine-AppShell-header, nav.mantine-AppShell-navbar { display:none !important; }
html body .mantine-AppShell-root { --app-shell-header-height:var(--mv-h) !important; --app-shell-header-offset:var(--mv-h) !important;
  --app-shell-navbar-width:0px !important; --app-shell-navbar-offset:0px !important; }
.mantine-AppShell-main { padding-inline-start:0 !important; padding-left:0 !important; padding-top:var(--mv-h) !important; }
.mv-top.mv-fixed { position:fixed; top:0; left:0; right:0; z-index:300; }
.mv-menu { z-index:320 !important; top:calc(var(--mv-h) + 4px) !important; } .mv-shade { z-index:310 !important; } .mv-drawer { z-index:315 !important; }
/* строка страницы: оставляем «хлебные крошки», оглавление и «⋯» */
[data-page-header] .mantine-SegmentedControl-root,
[data-page-header] .mantine-Button-root[data-variant="default"],
[data-page-header] [aria-label="Комментарии"],
[aria-label*="платной лицензией"],
[class*="_byline_"] { display:none !important; }
/* золото вместо синего */
:root, :root[data-mantine-color-scheme] {
  --mantine-primary-color-filled:#b8901f; --mantine-primary-color-filled-hover:#a17d18;
  --mantine-primary-color-light:rgba(184,144,31,.13); --mantine-primary-color-light-hover:rgba(184,144,31,.22); --mantine-primary-color-light-color:#8a6a0c;
  --mantine-color-blue-filled:#b8901f; --mantine-color-blue-filled-hover:#a17d18;
  --mantine-color-blue-light:rgba(184,144,31,.13); --mantine-color-blue-light-hover:rgba(184,144,31,.22); --mantine-color-blue-light-color:#8a6a0c;
  --mantine-color-blue-outline:#b8901f; --mantine-color-blue-text:#8a6a0c;
  --mantine-color-blue-0:#fbf6e6; --mantine-color-blue-1:#f5ecd2; --mantine-color-blue-2:#ecdba6; --mantine-color-blue-3:#e2c977;
  --mantine-color-blue-4:#d9b851; --mantine-color-blue-5:#d1ab38; --mantine-color-blue-6:#b8901f; --mantine-color-blue-7:#a17d18;
  --mantine-color-blue-8:#8a6a0c; --mantine-color-blue-9:#6f5508;
  --mantine-color-anchor:#8a6a0c;
}
:root[data-mantine-color-scheme="light"] { --mantine-color-body:#ffffff; }
:root[data-mantine-color-scheme="dark"] {
  --mantine-color-body:#0e0c08; --mantine-color-dark-8:#0a0906; --mantine-color-dark-7:#0e0c08; --mantine-color-dark-6:#1a1712;
  --mantine-color-dark-5:#2a2519; --mantine-color-dark-4:#3d3626; --mantine-color-dark-3:#6b624f;
  --mantine-primary-color-light-color:#e9c96a; --mantine-color-blue-light-color:#e9c96a; --mantine-color-blue-text:#e9c96a; --mantine-color-anchor:#e9c96a;
  --mantine-primary-color-filled:#d4af37; --mantine-color-blue-filled:#d4af37;
}
.ProseMirror ::selection { background:rgba(212,175,55,.3); }
/* красная строка: в «Художественной литературе» каждый абзац текста начинается с отступа (первая строка с датой — без) */
body.mv-fiction .ProseMirror > p:not(:first-child) { text-indent:1.5em; }
body.mv-fiction .ProseMirror > p { margin-top:.3em; margin-bottom:.3em; }

/* теги-чипы как в Google Таблицах: в первой строке записи (дата · теги) — это «код» (`тег` или кнопка </> у выделенного текста) */
.ProseMirror > p:first-child code { font-family:inherit; font-size:.82em; font-style:normal; font-weight:600; letter-spacing:.01em;
  border-radius:999px; padding:.22em .8em; margin:0 .15em; border:0; white-space:nowrap; vertical-align:.08em;
  background:#f6e7b6; color:#6b5104; }
.ProseMirror > p:first-child code:nth-of-type(5n+2) { background:#dcebd8; color:#2f5e2a; }
.ProseMirror > p:first-child code:nth-of-type(5n+3) { background:#dbe6f6; color:#2a4f86; }
.ProseMirror > p:first-child code:nth-of-type(5n+4) { background:#f4dcd8; color:#86352a; }
.ProseMirror > p:first-child code:nth-of-type(5n+5) { background:#e6ddf3; color:#563a86; }
[data-mantine-color-scheme="dark"] .ProseMirror > p:first-child code { background:#4a3c12; color:#f3dc8f; }
[data-mantine-color-scheme="dark"] .ProseMirror > p:first-child code:nth-of-type(5n+2) { background:#23401f; color:#b5dfab; }
[data-mantine-color-scheme="dark"] .ProseMirror > p:first-child code:nth-of-type(5n+3) { background:#1f3150; color:#aac6f0; }
[data-mantine-color-scheme="dark"] .ProseMirror > p:first-child code:nth-of-type(5n+4) { background:#4d2621; color:#f0b3a8; }
[data-mantine-color-scheme="dark"] .ProseMirror > p:first-child code:nth-of-type(5n+5) { background:#352750; color:#cdb8f0; }

/* теги — встроенные «статусы» Docmost, перерисованы под чипы Google Таблиц; «+» — пунктирный, по нему меню тегов */
.ProseMirror:not(.page-title .ProseMirror) > p:first-child .status-badge {
  text-transform:none !important; font-size:.8em !important; font-weight:600 !important; letter-spacing:.01em !important;
  border-radius:999px !important; padding:.25em .85em !important; line-height:1.35 !important; height:auto !important; cursor:pointer; vertical-align:middle !important; position:relative; top:-.08em; }
.ProseMirror:not(.page-title .ProseMirror) > p:first-child .status-badge[aria-label="+"] {
  background:transparent !important; color:var(--mantine-color-dimmed) !important; box-shadow:inset 0 0 0 1.5px currentColor; padding:.25em .7em !important; font-weight:700 !important; }
.ProseMirror:not(.page-title .ProseMirror) > p:first-child .status-badge[aria-label="+"]:hover { color:#b8901f !important; }
/* у Docmost всего 5 цветов чипа; «Философии» задаём фиолетовый по названию */
.status-badge[aria-label="Философия"] { background:#e2dafb !important; color:#4f3399 !important; }
[data-mantine-color-scheme="dark"] .status-badge[aria-label="Философия"] { background:#2f2552 !important; color:#c9b9f5 !important; }
/* список записей в папке нельзя случайно удалить */
.node-subpages button, .node-subpages [aria-label*="Удалить"], .node-subpages [aria-label*="Delete"] { display:none !important; }

/* панель над записью */
.mv-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:6px 0 14px;
  padding:10px 12px; border-radius:16px; background:var(--chip); font:14px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
.mv-bar .stars { display:inline-flex; align-items:center; gap:1px; }
.mv-bar .stars button { border:0; background:none; padding:2px 1px; cursor:pointer; font-size:20px; line-height:1; color:var(--axis); }
.mv-bar .stars button.on { color:var(--gold); }
.mv-bar .stars .val { margin-left:8px; font-size:13px; color:var(--muted); }
.mv-bar-b { border:0; background:var(--surface); color:var(--ink); border-radius:10px; padding:8px 12px; cursor:pointer; font:inherit; font-weight:600; box-shadow:0 0 0 1px var(--ring); }
.mv-bar-b:hover { color:var(--gold-ink); }
.mv-bar-h { color:var(--muted); }
/* цитаты и словарик — курсивом (жирное остаётся жирным) */
body.mv-fiction .ProseMirror > :is(h2, h3) + ul { font-style:italic; }

.mv-bar-l { display:flex; align-items:center; gap:12px; min-width:0; }
.mv-bar-cov { width:44px; height:66px; object-fit:cover; border-radius:6px; box-shadow:0 1px 4px rgba(0,0,0,.2); flex:none; }
/* на телефоне панель форматирования — внизу экрана, чтобы не налезала на системное меню «Вырезать / Копировать» */
@media (pointer: coarse) {
  div:has(> [class*="_bubbleMenu_"]) { position:fixed !important; left:8px !important; right:8px !important; top:auto !important;
    bottom:calc(env(safe-area-inset-bottom, 0px) + 10px) !important; width:auto !important; transform:none !important; }
  [class*="_bubbleMenu_"] { max-width:100%; overflow-x:auto; margin:0 auto; width:max-content; }
}

/* картинка на весь экран */
.mv-zoom { position:fixed; inset:0; z-index:2147483000; background:#000; isolation:isolate; display:flex; align-items:center; justify-content:center; touch-action:none; overscroll-behavior:contain; }
.mv-zoom img { max-width:100vw; max-height:100vh; object-fit:contain; transform-origin:center; user-select:none; -webkit-user-drag:none; will-change:transform; }
.mv-zoom-x { position:absolute; top:calc(env(safe-area-inset-top, 0px) + 12px); right:12px; width:44px; height:44px; border-radius:50%; border:0;
  background:rgba(255,255,255,.16); color:#fff; font-size:20px; cursor:pointer; }
.mv-zoom-h { position:absolute; bottom:calc(env(safe-area-inset-bottom, 0px) + 14px); left:0; right:0; text-align:center; color:rgba(255,255,255,.6); font:13px system-ui,sans-serif; pointer-events:none; }
.mv-zoom.zoomed .mv-zoom-h { display:none; }
.ProseMirror:not(.page-title .ProseMirror) img { cursor:zoom-in; }
/* поиск по записи */
.mv-find { position:fixed; z-index:305; top:calc(var(--mv-h) + 8px); left:50%; transform:translateX(-50%); width:min(560px, calc(100vw - 16px));
  display:flex; align-items:center; gap:4px; padding:6px 6px 6px 12px; border-radius:16px; background:var(--surface); box-shadow:0 0 0 1px var(--ring), 0 8px 24px rgba(0,0,0,.18);
  font:15px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
.mv-find input { flex:1; min-width:0; border:0; outline:0; background:none; color:var(--ink); font:inherit; font-size:16px; padding:6px 0; }
.mv-find-n { color:var(--muted); font-size:13px; white-space:nowrap; padding:0 4px; }
.mv-find button { border:0; background:var(--chip); color:var(--ink); width:38px; height:38px; border-radius:12px; font-size:20px; line-height:1; cursor:pointer; flex:none; }
.mv-find button:hover { color:var(--gold-ink); }
::highlight(mv-find) { background:rgba(212,175,55,.35); color:inherit; }
::highlight(mv-find-cur) { background:#e8590c; color:#fff; }
