/* ==========================================================================
   MyPlan — локальное рабочее пространство: карта, задачи, календарь, заметки.
   Внешних шрифтов и CDN нет: всё работает офлайн.
   ========================================================================== */

:root {
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --bg: #f3f6fc;
  --bg-elevated: #f8faff;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f9;
  --surface-4: #e7ecf6;
  --text: #101828;
  --text-soft: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --border: #e3e8f1;
  --border-strong: #cfd6e4;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --brand-2: #0ea5e9;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --success: #047857;
  --success-soft: #ecfdf5;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 4px 14px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 14px 34px rgba(16, 24, 40, 0.11);
  --shadow-lg: 0 30px 70px rgba(15, 23, 42, 0.2);
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --topbar-h: 68px;
  --sidebar-w: 322px;
}

html[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-elevated: #0d1424;
  --surface: #111a2c;
  --surface-2: #142035;
  --surface-3: #1a2942;
  --surface-4: #223350;
  --text: #e8eef9;
  --text-soft: #cbd5e1;
  --muted: #93a4bd;
  --muted-2: #7386a1;
  --border: #22314d;
  --border-strong: #30415f;
  --brand: #818cf8;
  --brand-strong: #a5b4fc;
  --brand-soft: #1c2547;
  --brand-2: #38bdf8;
  --accent: #2dd4bf;
  --accent-soft: #102f2e;
  --danger: #f87171;
  --danger-soft: #351a20;
  --warning: #fbbf24;
  --warning-soft: #332610;
  --success: #34d399;
  --success-soft: #102c25;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 38px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 34px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
code, kbd, pre { font-family: var(--font-mono); }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
.icon { display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted-2) 40%, transparent);
  border: 3px solid transparent;
  border-radius: 9px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); background-clip: padding-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }
.danger-text { color: var(--danger) !important; }
.spacer { flex: 1; }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-soft);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #5b52ea, #4338ca);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.26);
}
.button.primary:hover:not(:disabled) { background: linear-gradient(135deg, #4f46e5, #3730a3); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.32); }
.button.secondary { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 20%, transparent); }
.button.secondary:hover { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); }
.button.ghost { background: var(--surface); border-color: var(--border); color: var(--text-soft); box-shadow: var(--shadow-xs); }
.button.ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.button.danger { background: var(--danger); color: #fff; }
.button.danger:hover { filter: brightness(0.94); }
.button.small { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.button.block { width: 100%; }
.button .spinner { width: 15px; height: 15px; border-width: 2px; }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-button:hover { background: var(--surface-3); color: var(--text); }
.icon-button.tiny { width: 28px; height: 28px; border-radius: 8px; }
.icon-button.accent-soft { background: var(--brand-soft); color: var(--brand); }
.icon-button.accent-soft:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
.icon-button.is-active { background: var(--brand); color: #fff; }
.link-button { border: 0; background: none; padding: 0; color: var(--brand); font-size: 11.5px; font-weight: 600; }
.link-button:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Каркас
   -------------------------------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
.main { flex: 1; min-height: 0; position: relative; }
.view { height: 100%; min-height: 0; }
.view-scroll {
  height: 100%; overflow-y: auto; padding: 26px 30px 56px;
}
.view-scroll > * { max-width: 1560px; margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   Верхняя панель
   -------------------------------------------------------------------------- */
.topbar {
  position: relative; z-index: 40; flex: none;
  display: flex; align-items: center; gap: 16px;
  height: var(--topbar-h); padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { display: flex; width: 34px; height: 34px; filter: drop-shadow(0 5px 10px rgba(79, 70, 229, 0.25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 17px; letter-spacing: -0.02em; }
.brand-text small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 3px; }

.map-switcher {
  position: relative; display: flex; align-items: center; gap: 2px;
  height: 40px; padding: 0 5px 0 10px; flex: none;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.map-switcher-icon { color: var(--muted); }
.map-select {
  width: 146px; height: 34px; padding: 0 24px 0 7px;
  appearance: none; border: 0; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; text-overflow: ellipsis;
}
.map-switcher::after {
  content: ""; position: absolute; right: 79px; top: 17px; width: 5px; height: 5px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}
.map-switcher .icon-button { width: 28px; height: 28px; }
.map-switcher .accent-soft { margin-left: 2px; }

.main-nav { display: flex; align-items: center; gap: 3px; margin-left: 4px; }
.nav-button {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-button:hover { color: var(--text); background: var(--surface-3); }
.nav-button.is-active { color: var(--brand); background: var(--brand-soft); }
.nav-button svg { opacity: 0.9; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.global-search {
  display: flex; align-items: center; gap: 7px; width: 238px; height: 36px;
  padding: 0 9px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--muted);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.global-search:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.global-search input::placeholder { color: var(--muted-2); }
.global-search kbd {
  padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); color: var(--muted-2); font-size: 9.5px; white-space: nowrap;
}
.global-search-icon { display: flex; }

.sync-indicator {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.sync-indicator:hover { border-color: var(--border-strong); color: var(--text); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted-2) 15%, transparent); }
.sync-indicator[data-state="online"] .sync-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16); }
.sync-indicator[data-state="conflict"] .sync-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16); }
.sync-indicator[data-state="offline"] .sync-dot { background: var(--danger); }
.sync-indicator[data-state="conflict"] { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); background: var(--warning-soft); }

.mobile-only { display: none; }

/* --------------------------------------------------------------------------
   Загрузка
   -------------------------------------------------------------------------- */
.boot-loader {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 30%, var(--brand-soft), var(--bg) 62%);
}
.boot-loader strong { font-size: 23px; letter-spacing: -0.03em; }
.boot-loader p { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.boot-mark { position: relative; width: 66px; height: 66px; margin-bottom: 6px; }
.boot-mark span { position: absolute; width: 15px; height: 15px; border-radius: 50%; animation: bootPulse 1.6s ease-in-out infinite; }
.boot-mark span:nth-child(1) { left: 2px; top: 10px; background: #6366f1; }
.boot-mark span:nth-child(2) { right: 2px; top: 10px; background: #0ea5e9; animation-delay: 0.2s; }
.boot-mark span:nth-child(3) { left: 2px; bottom: 10px; background: #f472b6; animation-delay: 0.4s; }
.boot-mark span:nth-child(4) { right: 2px; bottom: 10px; background: #34d399; animation-delay: 0.6s; }
.boot-mark i { position: absolute; left: 27px; top: 27px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 16%, transparent); }
@keyframes bootPulse { 0%, 100% { transform: scale(0.82); opacity: 0.65; } 50% { transform: scale(1.15); opacity: 1; } }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--surface); color: var(--text); z-index: 3000; }

.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-top-color: var(--brand); animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Карта
   -------------------------------------------------------------------------- */
.map-layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100%; }
.map-sidebar {
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 20px 18px; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-project { display: flex; flex-direction: column; gap: 8px; }
.eyebrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--muted); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.eyebrow .muted { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 10.5px; }
.sidebar-project h1 { font-size: 23px; line-height: 1.2; letter-spacing: -0.03em; }
.map-description { color: var(--text-soft); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.map-description.is-empty { color: var(--muted-2); font-style: italic; }
.stat-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.stat-strip > div {
  display: flex; align-items: baseline; gap: 6px; padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.stat-strip strong { font-size: 17px; letter-spacing: -0.03em; }
.stat-strip span { color: var(--muted); font-size: 10.5px; }

.sidebar-section { display: flex; flex-direction: column; gap: 10px; }
.sidebar-heading {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.create-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); color: var(--text-soft); font-size: 12px; font-weight: 600;
  text-align: left; transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.create-tile:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.create-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.create-icon.note { background: #eef2ff; color: #4f46e5; }
.create-icon.task { background: #fffbeb; color: #b45309; }
.create-icon.event { background: #f5f3ff; color: #7c3aed; }
.create-icon.plain { background: #ecfeff; color: #0891b2; }
html[data-theme="dark"] .create-icon.note { background: #1c2547; color: #a5b4fc; }
html[data-theme="dark"] .create-icon.task { background: #332610; color: #fbbf24; }
html[data-theme="dark"] .create-icon.event { background: #2b1c47; color: #c4b5fd; }
html[data-theme="dark"] .create-icon.plain { background: #0d2f3b; color: #67e8f9; }

.side-search, .toolbar-search {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted);
}
.side-search:focus-within, .toolbar-search:focus-within { border-color: var(--brand); background: var(--surface); }
.side-search input, .toolbar-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.side-search input::placeholder, .toolbar-search input::placeholder { color: var(--muted-2); }
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.compact { gap: 6px; }
.form-grid.compact .select { height: 32px; font-size: 11px; padding: 0 8px; }
.select, .input, .textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 12.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select { height: 36px; padding: 0 30px 0 10px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input { height: 36px; padding: 0 11px; }
.textarea { min-height: 86px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.select:focus, .input:focus, .textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.field-label { display: block; margin-bottom: 5px; color: var(--text-soft); font-size: 11.5px; font-weight: 600; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.form-field { display: block; }

.map-tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
.tag-cloud-item {
  max-width: 100%; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-cloud-item:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.tag-cloud-item.is-active { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.filter-count { color: var(--muted-2); font-size: 10.5px; margin-top: 1px; }
.sidebar-tip {
  display: flex; gap: 9px; padding: 11px 12px; margin-top: auto;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
  border-radius: 11px; background: var(--brand-soft); color: var(--brand);
}
.sidebar-tip-icon { flex: none; margin-top: 1px; }
.sidebar-tip p { color: var(--text-soft); font-size: 10.8px; line-height: 1.5; }
.sidebar-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sidebar-footer .button { padding: 0 8px; font-size: 11.5px; }

.map-stage { position: relative; min-width: 0; overflow: hidden; background:
  radial-gradient(circle at 18% 10%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 34%),
  radial-gradient(circle at 84% 86%, color-mix(in srgb, var(--brand-2) 7%, transparent), transparent 32%),
  var(--bg-elevated);
}
.map-canvas-wrap { position: absolute; inset: 0; }
.mindmap {
  display: block; width: 100%; height: 100%;
  cursor: grab; touch-action: none; outline: none;
  /* Запрет выделения текста при перетаскивании узлов и панорамировании.
     Именно CSS, а не preventDefault в pointerdown: отмена pointerdown
     подавляет генерацию click/dblclick, и двойной клик перестаёт работать. */
  user-select: none; -webkit-user-select: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--muted-2) 26%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
.mindmap.is-panning { cursor: grabbing; }
.mindmap.is-dragging { cursor: grabbing; }

.map-toolbar {
  position: absolute; z-index: 5; top: 15px; left: 18px; right: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.map-toolbar-left, .map-toolbar-right { display: flex; align-items: center; gap: 9px; pointer-events: auto; }
.tool-button {
  display: inline-flex; align-items: center; gap: 7px; height: 35px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text-soft);
  font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm); backdrop-filter: blur(9px);
}
.tool-button:hover { border-color: var(--border-strong); background: var(--surface); }
.tool-button.is-active { color: #fff; background: var(--brand); border-color: var(--brand); }
.connection-hint {
  padding: 7px 11px; border-radius: 9px; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 600; box-shadow: var(--shadow-sm);
}
.stage-gesture-hint {
  padding: 6px 9px; border-radius: 7px; color: var(--muted);
  font-size: 10.5px; background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.map-toolbar-right .icon-button { background: color-mix(in srgb, var(--surface) 92%, transparent); border-color: var(--border); box-shadow: var(--shadow-sm); backdrop-filter: blur(9px); }

.zoom-controls {
  position: absolute; z-index: 4; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.zoom-button { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.zoom-button:hover { background: var(--surface-3); color: var(--text); }
.zoom-divider { height: 1px; margin: 2px 5px; background: var(--border); }
.map-corner-hint { position: absolute; z-index: 3; left: 20px; bottom: 20px; color: var(--muted-2); font-size: 10.5px; pointer-events: none; }
.selection-bar {
  position: absolute; z-index: 6; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 160px);
  padding: 7px 8px 7px 14px; border: 1px solid var(--border-strong); border-radius: 13px;
  background: var(--surface); box-shadow: var(--shadow-md); animation: riseIn 0.18s ease;
}
@keyframes riseIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.selection-count { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 11.5px; font-weight: 600; }
.selection-actions { display: flex; align-items: center; gap: 2px; }
.selection-button { display: inline-flex; align-items: center; gap: 5px; height: 29px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.selection-button:hover { background: var(--surface-3); color: var(--text); }
.selection-button.danger { color: var(--danger); }
.selection-button.danger:hover { background: var(--danger-soft); }

.map-empty { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.map-empty-card {
  width: min(360px, calc(100% - 48px)); padding: 28px; text-align: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); pointer-events: auto;
}
.map-empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 12px; border-radius: 17px; background: var(--brand-soft); color: var(--brand); }
.map-empty-card h2 { font-size: 19px; letter-spacing: -0.02em; }
.map-empty-card p { margin: 6px 0 17px; color: var(--muted); font-size: 12.5px; }
.map-empty-card .button { margin: 0 auto; }

/* --------------------------------------------------------------------------
   SVG mind map
   -------------------------------------------------------------------------- */
.mm-node { cursor: grab; outline: none; }
.mm-node:active { cursor: grabbing; }
.node-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.15; transition: stroke 0.15s ease, filter 0.15s ease; }
.mm-node:hover .node-card { stroke: var(--border-strong); }
.mm-node.is-selected .node-card { stroke: var(--brand); stroke-width: 2; filter: url(#mm-shadow-selected); }
.mm-node.is-focused .node-card { stroke: var(--brand); stroke-width: 1.8; }
.mm-node.connect-source .node-card { stroke: var(--accent); stroke-width: 2.4; }
.node-title { fill: var(--text); font-family: var(--font-sans); font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.node-content { fill: var(--muted); font-family: var(--font-sans); font-size: 11.4px; }
.node-type-text { font-family: var(--font-sans); font-size: 8.4px; font-weight: 700; letter-spacing: 0.09em; opacity: 0.92; }
.node-badge-bg { fill: var(--surface-3); }
.node-badge-text { fill: var(--muted); font-family: var(--font-sans); font-size: 9.2px; font-weight: 700; }
.node-badge.done .node-badge-bg { fill: var(--success-soft); }
.node-badge.done .node-badge-text { fill: var(--success); }
.node-badge.event .node-badge-bg { fill: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.node-badge.event .node-badge-text { fill: var(--brand); }
.node-image { opacity: 0.98; }
.node-image.is-broken { opacity: 0; }
.node-tag-bg { opacity: 0.9; }
.node-tag-text { fill: #fff; font-family: var(--font-sans); font-size: 8.6px; font-weight: 700; }

.edge-path { fill: none; stroke: var(--border-strong); stroke-width: 1.55; transition: stroke 0.15s ease, stroke-width 0.15s ease; }
.edge-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.edge-group:hover .edge-path { stroke: var(--brand); stroke-width: 2; }
.edge-group:focus .edge-path { stroke: var(--brand); stroke-width: 2; }
.edge-strong .edge-path { stroke: color-mix(in srgb, var(--brand) 68%, var(--border-strong)); stroke-width: 2.3; }
.edge-dashed .edge-path { stroke-dasharray: 6 6; }
.edge-label-bg { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.edge-label-text { fill: var(--muted); font-family: var(--font-sans); font-size: 10.2px; font-weight: 600; }
.edge-group:hover .edge-label-text { fill: var(--brand); }
.mindmap.connect-mode .mm-node { cursor: crosshair; }

/* --------------------------------------------------------------------------
   Общие заголовки страниц
   -------------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h1 { margin-top: 4px; font-size: 28px; line-height: 1.15; letter-spacing: -0.035em; }
.page-subtitle { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Задачи
   -------------------------------------------------------------------------- */
.task-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.task-toolbar .toolbar-search { width: 238px; border-color: transparent; background: var(--surface-2); }
.task-toolbar .select { width: auto; min-width: 142px; border-color: transparent; background-color: var(--surface-2); }
.task-toolbar .select:last-child { margin-left: auto; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.kanban-column {
  display: flex; flex-direction: column; min-height: 220px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 74%, var(--bg));
  transition: border-color 0.15s ease, background 0.15s ease;
}
.kanban-column.is-drop-target { border-color: var(--brand); background: var(--brand-soft); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 7px 11px; }
.kanban-title { display: flex; align-items: center; gap: 7px; }
.kanban-title h3 { font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; }
.kanban-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.kanban-dot.todo { background: #6366f1; }
.kanban-dot.progress { background: #f59e0b; }
.kanban-dot.done { background: #10b981; }
.kanban-count { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 700; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.task-card {
  padding: 12px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); box-shadow: var(--shadow-xs); cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.task-card:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.task-card.is-dragging { opacity: 0.45; transform: rotate(1.5deg); }
.task-card.is-done { opacity: 0.8; }
.task-card.is-done .task-card-title { text-decoration: line-through; color: var(--muted); }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.priority-pill { padding: 2px 6px; border-radius: 5px; font-size: 9px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.priority-pill.urgent { color: #b91c1c; background: #fee2e2; }
.priority-pill.high { color: #b45309; background: #fef3c7; }
.priority-pill.medium { color: #4338ca; background: #eef2ff; }
.priority-pill.low { color: #475569; background: #f1f5f9; }
html[data-theme="dark"] .priority-pill.urgent { background: #3f1b22; color: #fca5a5; }
html[data-theme="dark"] .priority-pill.high { background: #3a2b12; color: #fcd34d; }
html[data-theme="dark"] .priority-pill.medium { background: #22284e; color: #a5b4fc; }
html[data-theme="dark"] .priority-pill.low { background: #202b3c; color: #cbd5e1; }
.due-pill { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.due-pill.overdue { color: var(--danger); }
.due-pill.today { color: var(--warning); }
.due-pill.soon { color: var(--brand); }
.task-card-title-row { display: flex; align-items: flex-start; gap: 7px; }
.task-card-title { flex: 1; font-size: 13px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.task-quick-check {
  display: grid; place-items: center; flex: none; width: 21px; height: 21px; margin-top: 0;
  border: 1.5px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: transparent;
}
.task-quick-check:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.task-quick-check.is-checked { border-color: var(--success); background: var(--success); color: #fff; }
.task-card-desc { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.checklist-progress { margin-top: 10px; }
.checklist-progress-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.progress-track { height: 4px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.mini-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.mini-tag { padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 600; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); }
.node-link-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; color: var(--muted); font-size: 9.5px; font-weight: 600; }
.node-link-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-link-icon { display: inline-flex; color: var(--brand); }
.kanban-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 110px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted-2); text-align: center; }
.kanban-empty-icon { opacity: 0.6; }
.kanban-empty p { font-size: 10.5px; }

/* --------------------------------------------------------------------------
   Календарь
   -------------------------------------------------------------------------- */
.calendar-scroll { display: flex; flex-direction: column; }
.calendar-head { align-items: center; margin-bottom: 12px; }
.calendar-head h1 { margin-top: 3px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 9px; }
.segmented button { height: 29px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.calendar-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 5px; }
.calendar-notes-toggle {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  color: var(--muted); font-size: 10.5px; font-weight: 600; cursor: pointer; user-select: none;
}
.calendar-notes-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.calendar-notes-toggle input { width: 13px; height: 13px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.calendar-notes-toggle:has(input:not(:checked)) { opacity: 0.65; }
.calendar-nav .icon-button { border: 1px solid var(--border); background: var(--surface); }
.calendar-tip { color: var(--muted-2); font-size: 10.5px; }
.calendar-body { flex: 1; min-height: 0; }
.calendar-month { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.calendar-weekdays span { padding: 8px 10px; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(108px, 1fr); }
.calendar-cell { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); transition: background 0.12s ease; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-cell:hover { background: color-mix(in srgb, var(--brand) 3%, var(--surface)); }
.calendar-cell.is-outside { background: color-mix(in srgb, var(--surface-2) 62%, var(--surface)); }
.calendar-cell.is-outside .calendar-day-number { color: var(--muted-2); }
.calendar-cell.is-today { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.calendar-day-number {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-soft);
  font-size: 11.5px; font-weight: 600;
}
.calendar-day-number:hover { background: var(--surface-3); }
.calendar-cell.is-today .calendar-day-number { color: #fff; background: var(--brand); }
.calendar-cell-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calendar-event {
  display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 3px 5px;
  border: 0; border-left: 2.5px solid var(--event-color, var(--brand));
  border-radius: 4px; background: color-mix(in srgb, var(--event-color, var(--brand)) 11%, var(--surface));
  color: var(--text-soft); text-align: left; line-height: 1.3;
}
.calendar-event:hover { background: color-mix(in srgb, var(--event-color, var(--brand)) 19%, var(--surface)); }
.calendar-event-time { flex: none; color: var(--muted); font-size: 8px; font-weight: 700; }
.calendar-event-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; font-weight: 600; }
.calendar-event-bell, .calendar-event-recur { display: inline-flex; flex: none; color: var(--muted); opacity: 0.8; }
.calendar-event.all-day .calendar-event-time { color: var(--brand); }
.calendar-cell-note {
  display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0;
  padding: 2px 5px; border: 1px dashed color-mix(in srgb, var(--brand) 42%, var(--border));
  border-radius: 4px; background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  color: var(--muted); text-align: left; font-size: 9px; font-weight: 600; line-height: 1.3;
}
.calendar-cell-note:hover { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); color: var(--text); }
.calendar-cell-note-icon { display: inline-flex; flex: none; color: var(--brand); opacity: 0.9; }
.calendar-cell-note-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-cell-note-count { flex: none; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 8px; font-weight: 700; }
.calendar-cell.is-note-day { background: color-mix(in srgb, var(--brand) 2.5%, var(--surface)); }
.calendar-cell.is-note-day .calendar-day-number { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--brand) 55%, transparent); }
.calendar-note-day-label { padding: 1px 4px; color: var(--brand); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.calendar-week-note {
  display: flex; align-items: center; gap: 4px; width: 100%; padding: 3px 6px;
  border: 1px dashed color-mix(in srgb, var(--brand) 42%, var(--border)); border-radius: 5px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface)); color: var(--muted);
  text-align: left; font-size: 9px; font-weight: 600;
}
.calendar-week-note:hover { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); color: var(--text); }
.day-notes-changed { margin-top: 22px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.day-notes-changed h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.day-notes-changed-list { display: flex; flex-direction: column; gap: 3px; }
.day-note-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 7px;
  border: 0; border-radius: 7px; background: transparent; text-align: left;
}
.day-note-row:hover { background: var(--surface); }
.day-note-time { flex: none; color: var(--muted-2); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.day-note-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
.calendar-more { padding: 1px 4px; border: 0; background: none; color: var(--muted); font-size: 9px; font-weight: 600; text-align: left; }
.calendar-more:hover { color: var(--brand); text-decoration: underline; }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.calendar-week-column { min-width: 0; border-right: 1px solid var(--border); }
.calendar-week-column:last-child { border-right: 0; }
.calendar-week-column.is-today { background: color-mix(in srgb, var(--brand) 3.5%, var(--surface)); }
.calendar-week-head {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 8px 9px;
  border: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); text-align: left;
}
.calendar-week-day { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.calendar-week-num { font-size: 17px; font-weight: 650; letter-spacing: -0.03em; }
.calendar-week-column.is-today .calendar-week-num { color: var(--brand); }
.calendar-add-day { display: grid; place-items: center; width: 20px; height: 20px; margin-left: auto; border: 0; border-radius: 5px; background: transparent; color: var(--muted-2); opacity: 0; }
.calendar-week-head:hover .calendar-add-day { opacity: 1; background: var(--surface-3); }
.calendar-week-events { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.calendar-event.week-chip { padding: 5px 6px; }
.calendar-event.week-chip .calendar-event-title { white-space: normal; font-size: 10px; }
.calendar-empty-day { padding: 6px; color: var(--muted-2); font-size: 9.5px; }
.calendar-day { max-width: 860px; margin: 0 auto; }
.day-all-day { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.day-all-day-label { flex: none; padding-top: 4px; color: var(--muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.day-all-day-events { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.day-agenda { display: flex; flex-direction: column; gap: 8px; }
.agenda-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; }
.agenda-time { padding-top: 10px; text-align: right; }
.agenda-time strong { display: block; font-size: 12px; font-weight: 650; }
.agenda-time span { display: block; color: var(--muted-2); font-size: 9.5px; }
.agenda-card {
  position: relative; display: block; width: 100%; padding: 12px 14px 12px 16px;
  border: 1px solid var(--border); border-left: 3px solid var(--event-color, var(--brand));
  border-radius: 10px; background: var(--surface); text-align: left; box-shadow: var(--shadow-xs);
}
.agenda-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.agenda-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agenda-card-head h3 { font-size: 13.5px; font-weight: 650; }
.agenda-desc { margin-top: 4px; color: var(--muted); font-size: 11px; }
.agenda-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 7px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; font-size: 9px; font-weight: 700; }
.badge.subtle { background: var(--surface-3); color: var(--muted); }

/* --------------------------------------------------------------------------
   Заметки
   -------------------------------------------------------------------------- */
.notes-layout { display: grid; grid-template-columns: 342px minmax(0, 1fr); height: 100%; }
.notes-explorer { display: flex; flex-direction: column; min-width: 0; height: 100%; border-right: 1px solid var(--border); background: var(--surface); }
.notes-explorer-head { display: flex; flex-direction: column; gap: 9px; padding: 20px 17px 13px; border-bottom: 1px solid var(--border); }
.notes-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-head-row h1 { font-size: 21px; letter-spacing: -0.03em; }
.notes-head-actions { display: flex; align-items: center; gap: 3px; }
.notes-search { height: 33px; }
.notes-filter-row { display: flex; gap: 6px; }
.notes-filter-row .select { flex: 1; min-width: 0; height: 31px; font-size: 11.5px; }
.notes-date-range {
  display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap;
  padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
}
.notes-date-field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 96px; }
.notes-date-field .field-label { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.notes-date-field .input { height: 29px; padding: 0 7px; font-size: 11.5px; }
.notes-date-range .button { height: 29px; flex: none; }
.notes-tags { display: flex; flex-wrap: wrap; gap: 4px; max-height: 50px; overflow: hidden; }
.notes-list { flex: 1; overflow-y: auto; padding: 8px; }
.note-list-item {
  display: block; width: 100%; padding: 10px 11px; margin-bottom: 3px;
  border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left;
}
.note-list-item:hover { background: var(--surface-2); }
.note-list-item.is-selected { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 17%, transparent); }
.note-list-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.note-list-icon { display: flex; color: var(--brand); opacity: 0.8; }
.note-list-date { color: var(--muted-2); font-size: 9px; }
.note-list-title { color: var(--text); font-size: 12.5px; font-weight: 650; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-list-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.note-preview { min-width: 0; height: 100%; overflow-y: auto; padding: 32px 46px 70px; background: var(--bg-elevated); }
.note-preview > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.note-preview-head { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.note-preview-kicker { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 9px; }
.note-preview-title { font-size: 33px; line-height: 1.15; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.note-preview-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag-chip { padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 600; }
.note-preview-actions { display: flex; gap: 7px; margin-top: 15px; }
.note-cover { display: block; width: 100%; max-height: 320px; margin-bottom: 20px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow-sm); }
.note-related { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); }
.note-related-title { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.related-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.related-row:hover { background: var(--surface); }
.related-title { flex: 1; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.task-dot.status-todo { background: #6366f1; }
.task-dot.status-in_progress { background: #f59e0b; }
.task-dot.status-done { background: #10b981; }
.event-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; }
.type-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.type-pill.type-note { color: #4338ca; background: #eef2ff; }
.type-pill.type-task { color: #b45309; background: #fffbeb; }
.type-pill.type-event { color: #6d28d9; background: #f5f3ff; }
.type-pill.type-plain { color: #0e7490; background: #ecfeff; }
html[data-theme="dark"] .type-pill.type-note { color: #a5b4fc; background: #1c2547; }
html[data-theme="dark"] .type-pill.type-task { color: #fcd34d; background: #332610; }
html[data-theme="dark"] .type-pill.type-event { color: #c4b5fd; background: #2b1c47; }
html[data-theme="dark"] .type-pill.type-plain { color: #67e8f9; background: #0d2f3b; }

/* --------------------------------------------------------------------------
   Markdown
   -------------------------------------------------------------------------- */
.markdown-body { color: var(--text-soft); font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--text); line-height: 1.25; letter-spacing: -0.02em; margin: 1.4em 0 0.55em; }
.markdown-body h1 { font-size: 26px; }
.markdown-body h2 { font-size: 21px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 17px; }
.markdown-body h4 { font-size: 14px; }
.markdown-body p { margin: 0 0 0.85em; }
.markdown-body strong { color: var(--text); }
.markdown-body a { font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 2px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 0.9em; padding-left: 1.35em; }
.markdown-body li { margin: 0.2em 0; }
.markdown-body li::marker { color: var(--muted-2); }
.markdown-body .task-list { list-style: none; padding-left: 0; }
.markdown-body .task-item { display: flex; align-items: flex-start; gap: 7px; }
.markdown-body .task-check { display: grid; place-items: center; flex: none; width: 14px; height: 14px; margin-top: 4px; border: 1.3px solid var(--border-strong); border-radius: 4px; color: transparent; font-size: 10px; }
.markdown-body .task-item.is-done .task-check { color: #fff; background: var(--success); border-color: var(--success); }
.markdown-body .task-label { flex: 1; }
.markdown-body blockquote { margin: 0 0 0.9em; padding: 4px 0 4px 14px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.markdown-body code { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text); font-size: 0.88em; }
.markdown-body pre { margin: 0 0 1em; padding: 13px 15px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); line-height: 1.55; }
.markdown-body pre code { padding: 0; background: none; font-size: 11.5px; }
.markdown-body table { width: 100%; margin: 0 0 1em; border-collapse: collapse; font-size: 12px; }
.markdown-body th, .markdown-body td { padding: 7px 9px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--surface-2); color: var(--text); font-weight: 650; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 10px; }
.markdown-body hr { margin: 1.4em 0; border: 0; border-top: 1px solid var(--border); }
.md-preview-empty { color: var(--muted-2); font-style: italic; }
.preview-loading { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; padding: 20px 0; }

/* --------------------------------------------------------------------------
   Синхронизация и архивы
   -------------------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr); gap: 16px; align-items: start; }
.panel { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; letter-spacing: -0.02em; }
.panel-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.panel-subtitle code { padding: 1px 4px; border-radius: 3px; background: var(--surface-3); font-size: 10px; }
.panel-badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.panel-actions { display: flex; align-items: center; gap: 7px; }
.sync-state-panel { display: flex; flex-direction: column; gap: 12px; }
.sync-status { border-radius: 11px; }
.sync-result { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.sync-result-top { display: flex; gap: 9px; align-items: flex-start; }
.sync-result-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 8px; background: var(--surface-3); color: var(--muted); }
.sync-result strong { display: block; font-size: 12px; margin-bottom: 1px; }
.sync-result p { color: var(--muted); font-size: 10.8px; line-height: 1.5; }
.sync-result-success { border-color: color-mix(in srgb, var(--success) 25%, var(--border)); background: color-mix(in srgb, var(--success-soft) 55%, var(--surface)); }
.sync-result-success .sync-result-icon { background: var(--success-soft); color: var(--success); }
.sync-result-danger { border-color: color-mix(in srgb, var(--danger) 26%, var(--border)); background: var(--danger-soft); }
.sync-result-danger .sync-result-icon { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.sync-result-warning { border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); background: var(--warning-soft); }
.sync-result-warning .sync-result-icon { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.sync-result-info .sync-result-icon { background: var(--brand-soft); color: var(--brand); }
.sync-conflict-actions { display: flex; flex-direction: column; gap: 1px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--warning) 30%, var(--border)); color: var(--warning); font-size: 10.5px; font-weight: 600; }
.sync-time { margin-top: -5px; }
.status-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-card { padding: 10px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); min-width: 0; }
.status-card h3 { margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sync-file-info { display: flex; gap: 8px; align-items: center; min-width: 0; }
.sync-file-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); }
.sync-file-info strong { display: block; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.sync-file-info p { margin-top: 1px; }
.remote-state { display: flex; gap: 8px; align-items: center; }
.remote-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-2); }
.remote-dot.online { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14); }
.remote-state strong { display: block; font-size: 10.5px; }
.remote-state p { margin-top: 1px; }
.inline-alert { display: flex; align-items: flex-start; gap: 7px; padding: 8px 9px; margin-top: 8px; border-radius: 7px; font-size: 10.5px; line-height: 1.45; }
.inline-alert.info { background: var(--brand-soft); color: var(--brand); }
.inline-alert.danger { background: var(--danger-soft); color: var(--danger); }
.inline-alert.warning { background: var(--warning-soft); color: var(--warning); }
.sync-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 3px; }
.sync-actions .button { height: 32px; padding: 0 9px; font-size: 11px; }
.sync-actions .button.secondary { margin-left: auto; }
.sync-config-panel { min-width: 0; }
.sync-form { display: flex; flex-direction: column; gap: 10px; }
.switch-row { display: flex; gap: 14px; flex-wrap: wrap; }
.switch-line { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 11px; font-weight: 600; cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; flex: none; width: 30px; height: 17px; border-radius: 999px; background: var(--surface-4); transition: background 0.15s ease; }
.switch-track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2); transition: transform 0.15s ease; }
.switch-line input:checked + .switch-track { background: var(--brand); }
.switch-line input:checked + .switch-track::after { transform: translateX(13px); }
.switch-line input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.verify-line { margin-top: -2px; }
.sync-form .form-grid.two { gap: 9px; }
.sync-form .input, .sync-form .select { height: 34px; font-size: 12px; }
.sync-form-actions { display: flex; gap: 7px; justify-content: flex-end; margin-top: 2px; }
.sync-form-actions .button { height: 34px; font-size: 11.5px; }
.skeleton-line { height: 9px; width: 55%; margin: 8px 0; border-radius: 5px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton-line.wide { width: 84%; height: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.archives-panel { margin-top: 16px; }
.archive-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; margin-bottom: 10px; border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface-2); }
.archive-toolbar .button { height: 32px; font-size: 11.5px; }
.archive-note { margin-left: auto; color: var(--muted-2); font-size: 10px; }
.archives-list { display: flex; flex-direction: column; gap: 4px; }
.archive-row { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border: 1px solid transparent; border-radius: 8px; }
.archive-row:hover { background: var(--surface-2); border-color: var(--border); }
.archive-icon { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 7px; background: var(--surface-3); color: var(--muted); }
.archive-info { flex: 1; min-width: 0; }
.archive-info strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-actions { display: flex; gap: 1px; }
.archive-actions .icon-button { color: var(--muted); }
.warning-list { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; }
.warning-list p { padding: 7px 9px; border-radius: 7px; background: var(--warning-soft); color: var(--warning); font-size: 11px; }

/* --------------------------------------------------------------------------
   Модальные окна
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.18s ease;
}
.modal-overlay.is-visible { opacity: 1; }
.modal-overlay.is-closing { opacity: 0; }
.modal {
  display: flex; flex-direction: column; width: 100%; max-width: 620px; max-height: calc(100dvh - 48px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); transform: translateY(12px) scale(0.985); opacity: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.18s ease;
}
.modal-overlay.is-visible .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-sm { max-width: 470px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1060px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-heading { min-width: 0; }
.modal-title { font-size: 18px; line-height: 1.3; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.modal-subtitle { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.modal-close { margin: -3px -5px 0 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; min-height: 0; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.modal-actions.wide { justify-content: space-between; }
.modal-actions-right { display: flex; align-items: center; gap: 8px; }
.modal-footer-left { display: flex; align-items: center; gap: 8px; }
.confirm-content { display: flex; gap: 13px; align-items: flex-start; }
.confirm-icon { display: grid; place-items: center; flex: none; width: 43px; height: 43px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-message { color: var(--text-soft); font-size: 12.5px; line-height: 1.55; }
.confirm-details { margin-top: 8px; color: var(--muted); font-size: 11px; }

/* Редактор узла */
.node-editor { min-height: 0; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 20px; align-items: start; }
.editor-main { min-width: 0; display: flex; flex-direction: column; gap: 15px; }
.editor-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor-section { display: flex; flex-direction: column; gap: 8px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.editor-section:last-child { border-bottom: 0; padding-bottom: 0; }
.editor-section.flat-section { border-bottom: 0; padding-bottom: 0; }
.editor-section-title { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.node-title-row { display: flex; gap: 10px; align-items: flex-end; }
.node-title-field { flex: 1; }
.node-title-field .input { height: 46px; font-size: 19px; font-weight: 650; letter-spacing: -0.025em; padding: 0 13px; border-radius: 11px; }
.type-row { display: flex; align-items: center; }
.content-section { gap: 5px; }
.simple-editor { display: flex; flex-direction: column; gap: 13px; }
.simple-editor > .form-field > .input, .simple-editor > .form-field > .select { max-width: 100%; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.meta-grid strong { display: block; margin-top: 1px; font-size: 11px; }

/* Markdown-редактор */
.md-editor { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.md-toolbar { display: flex; align-items: center; gap: 1px; padding: 5px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.md-tool { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 5px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.md-tool:hover { background: var(--surface-3); color: var(--text); }
.md-panes { display: grid; grid-template-columns: 1fr 1fr; min-height: 240px; }
.md-pane { display: flex; flex-direction: column; min-width: 0; }
.md-pane + .md-pane { border-left: 1px solid var(--border); }
.md-pane-head { display: flex; align-items: center; justify-content: space-between; height: 28px; padding: 0 9px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.md-pane-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.md-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.md-dot.preview { background: var(--success); }
.md-pane-hint { color: var(--muted-2); font-size: 8.5px; }
.md-textarea {
  flex: 1; width: 100%; min-height: 180px; padding: 11px 13px; border: 0; outline: 0;
  background: var(--surface); color: var(--text-soft); resize: vertical;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
}
.md-preview { flex: 1; min-height: 180px; padding: 11px 13px; overflow-y: auto; font-size: 12px; line-height: 1.65; max-height: 420px; }
.md-preview h1 { font-size: 20px; }
.md-preview h2 { font-size: 17px; }
.md-preview h3 { font-size: 14px; }
.md-preview p { margin-bottom: 8px; }
.md-preview ul, .md-preview ol { padding-left: 18px; }
.md-preview table { font-size: 10.5px; }
.md-preview pre { padding: 9px 10px; }
.md-preview code { font-size: 10.5px; }
.md-preview .task-item { font-size: 11px; }
/* Картинки в заметке: не вылезают за колонку и не ломают вёрстку. */
.md-preview img {
  display: block; max-width: 100%; height: auto; margin: 8px 0;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2);
}
.md-preview a img { cursor: zoom-in; }
/* Подсветка при перетаскивании файла на редактор. */
.md-editor.is-drag-over { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.md-editor.is-drag-over .md-textarea { background: var(--brand-soft); }

/* Изображение */
.image-editor { display: flex; flex-direction: column; gap: 7px; }
.image-editor-preview {
  display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface-2);
}
.image-editor-preview.has-image { border-style: solid; background: var(--surface-3); }
.image-editor-preview.is-drag { border-color: var(--brand); background: var(--brand-soft); }
.image-editor-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted-2); font-size: 9.5px; }
.image-editor-actions { display: flex; gap: 5px; }
.image-editor-actions .button { flex: 1; height: 29px; font-size: 10.5px; }
.image-editor .field-hint { font-size: 9.5px; }

/* Цвета */
.color-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch { width: 22px; height: 22px; padding: 0; border: 2px solid transparent; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }

/* Чек-лист */
.checklist-editor { display: flex; flex-direction: column; gap: 5px; }
.checklist-edit { display: flex; flex-direction: column; gap: 4px; }
.checklist-row { display: flex; align-items: center; gap: 6px; }
.checklist-check { width: 14px; height: 14px; flex: none; accent-color: var(--brand); }
.checklist-input { height: 29px !important; font-size: 11px !important; }
.checklist-row.is-done .checklist-input { text-decoration: line-through; color: var(--muted-2); }
.checklist-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checklist-actions .button { height: 27px; font-size: 10px; padding: 0 7px; }
.checklist-editor > .muted { padding: 2px 0; font-size: 10px; }

/* Задачи и события в редакторе */
.task-fields, .event-fields { display: flex; flex-direction: column; gap: 9px; }
.task-fields .form-grid .form-field, .event-fields .form-grid .form-field { min-width: 0; }
.task-fields .select, .task-fields .input, .event-fields .select, .event-fields .input { height: 32px; font-size: 11px; }
.checkbox-line { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.checkbox-line input { width: 14px; height: 14px; accent-color: var(--brand); }
.reminder-block { display: flex; flex-direction: column; gap: 6px; padding: 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }

/* Метка серии в карточке задачи */
.recurrence-badge {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  margin-top: 2px; padding: 3px 7px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 9px; font-weight: 700; letter-spacing: 0.02em;
}
.recurrence-badge-icon { display: inline-flex; }
.recurrence-badge-meta { color: var(--muted); font-weight: 600; }

/* Повтор задачи и напоминание */
.schedule-block { display: flex; flex-direction: column; gap: 9px; }
.schedule-body { display: flex; flex-direction: column; gap: 8px; }
.schedule-body:empty { display: none; }
.schedule-inline { display: flex; align-items: center; gap: 6px; }
.schedule-inline .input { width: 84px; flex: none; }
.schedule-unit { flex: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.schedule-block .field-hint { font-size: 9.5px; }
.schedule-block .checkbox-line { margin-bottom: 1px; }
.is-hidden { display: none !important; }
.attached-list { display: flex; flex-direction: column; gap: 2px; }
.attached-row { display: flex; align-items: center; gap: 6px; padding: 6px; border: 0; border-radius: 5px; background: transparent; text-align: left; }
.attached-row:hover { background: var(--surface-2); }
.attached-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; }
.attached-meta { flex: none; color: var(--muted-2); font-size: 8.5px; }
.linked-node { display: flex; align-items: center; gap: 5px; margin-top: 5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text-soft); font-size: 10.5px; font-weight: 600; }
.linked-node-icon { display: inline-flex; color: var(--brand); }
.edge-endpoints { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-soft); font-size: 11.5px; font-weight: 600; }
.edge-arrow { display: inline-flex; color: var(--muted); }

/* Экспорт */
.export-form { display: flex; flex-direction: column; gap: 16px; }
.export-group { display: flex; flex-direction: column; gap: 6px; }
.export-group h3 { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.radio-card { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.radio-card:hover { border-color: var(--border-strong); }
.radio-card.is-disabled { opacity: 0.5; cursor: not-allowed; }
.radio-card input { margin-top: 2px; accent-color: var(--brand); }
.radio-card strong { display: block; font-size: 11.5px; }
.radio-card span { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.inline-hint { display: flex; align-items: flex-start; gap: 5px; padding: 8px 9px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-size: 10px; line-height: 1.45; }

/* Помощь */
.help-modal { display: flex; flex-direction: column; gap: 14px; }
.help-intro { display: flex; gap: 9px; padding: 11px; border-radius: 9px; background: var(--brand-soft); }
.help-icon { display: inline-flex; color: var(--brand); flex: none; }
.help-intro p { color: var(--text-soft); font-size: 11px; line-height: 1.55; }
.shortcut-list { display: flex; flex-direction: column; gap: 3px; }
.shortcut-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--border); }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-row kbd { flex: none; min-width: 168px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text-soft); font-size: 9.5px; text-align: center; }
.shortcut-row span { color: var(--muted); font-size: 10.5px; }

/* --------------------------------------------------------------------------
   Пустые состояния, тосты
   -------------------------------------------------------------------------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 46px 22px; text-align: center; }
.empty-state.compact { padding: 25px 14px; }
.empty-icon { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 3px; border-radius: 16px; background: var(--surface-3); color: var(--muted); }
.empty-state.compact .empty-icon { width: 40px; height: 40px; border-radius: 12px; }
.empty-state h3 { font-size: 14px; letter-spacing: -0.01em; }
.empty-state.compact h3 { font-size: 12px; }
.empty-state p { max-width: 340px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.empty-state .button { margin-top: 5px; }
.toast-root { position: fixed; z-index: 3000; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; max-width: 380px; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  box-shadow: var(--shadow-md); color: var(--text-soft); pointer-events: auto;
  transform: translateX(16px); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
}
.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast-icon { display: inline-flex; flex: none; margin-top: 1px; color: var(--brand); }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-message { flex: 1; font-size: 11.5px; line-height: 1.45; }
.toast-close { flex: none; padding: 0 2px; border: 0; background: none; color: var(--muted-2); font-size: 15px; line-height: 1; }
.toast-close:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Напоминания
   -------------------------------------------------------------------------- */
.reminders-menu { position: relative; flex: none; }
.reminders-button { position: relative; }
.reminder-badge {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.reminder-badge[hidden] { display: none; }
.reminders-popover {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: 358px; max-width: calc(100vw - 24px); padding: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.reminders-popover[hidden] { display: none; }
.reminders-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 2px 3px 8px; }
.reminders-head strong { display: block; font-size: 13px; }
.reminders-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.reminders-permission {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 2px 0 8px; padding: 8px 9px; border-radius: 9px;
  background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.45;
}
.reminders-permission.is-granted { background: var(--success-soft); color: var(--success); }
.reminders-permission.is-denied { background: var(--warning-soft); color: var(--warning); }
.reminders-permission .button { flex: none; height: 27px; padding: 0 8px; font-size: 10.5px; }
.reminders-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.reminder-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 9px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
}
.reminder-item-main { flex: 1; min-width: 0; }
.reminder-item-title { display: block; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.reminder-item-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.reminder-item-actions { display: flex; flex: none; gap: 3px; }
.reminder-item-actions button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
}
.reminder-item-actions button:hover { background: var(--surface); color: var(--text); }
.reminders-empty { padding: 16px 9px; color: var(--muted); font-size: 11.5px; text-align: center; }
.reminders-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border); }
.reminders-actions .button { height: 29px; font-size: 11px; }

/* --------------------------------------------------------------------------
   Аккаунт и экран входа
   -------------------------------------------------------------------------- */
.user-menu { position: relative; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: 7px; height: 36px; max-width: 178px;
  padding: 0 8px 0 3px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--text-soft); font-size: 12px; font-weight: 600;
}
.user-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase;
}
.user-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chevron { display: flex; color: var(--muted-2); }
.user-popover {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: 232px; padding: 8px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.user-popover-head { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px 10px; border-bottom: 1px solid var(--border); }
.user-popover-head strong { font-size: 13px; }
.user-popover-head small { color: var(--muted); font-size: 11px; }
.user-popover-action {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 5px;
  padding: 9px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-soft); font-size: 12.5px; font-weight: 600; text-align: left;
}
.user-popover-action:hover { background: var(--danger-soft, #fee2e2); color: var(--danger); }

body[data-authenticated="false"] .app-shell { display: none; }
.auth-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 28px 18px; overflow-y: auto;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 34%),
    radial-gradient(circle at 88% 88%, color-mix(in srgb, #7c3aed 14%, transparent), transparent 38%),
    var(--bg);
}
.auth-theme {
  position: fixed; right: 20px; top: 20px; z-index: 2;
  border: 1px solid var(--border); background: var(--surface);
}
.auth-card {
  width: min(430px, 100%); padding: 27px 27px 23px;
  border: 1px solid var(--border); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(18px);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 21px; }
.auth-brand-logo { width: 42px; height: 42px; display: flex; filter: drop-shadow(0 6px 14px rgba(79, 70, 229, 0.28)); }
.auth-brand strong { display: block; font-size: 20px; letter-spacing: -0.03em; }
.auth-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.auth-card h1 { font-size: 24px; letter-spacing: -0.035em; line-height: 1.15; }
.auth-card > p.auth-subtitle { margin-top: 7px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 19px 0 17px; padding: 4px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.auth-tab { height: 33px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.auth-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field span { color: var(--text-soft); font-size: 11.5px; font-weight: 600; }
.auth-field input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px; }
.auth-field input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent); }
.auth-error { min-height: 17px; margin: 0; color: var(--danger); font-size: 11.5px; line-height: 1.45; }
.auth-submit { width: 100%; height: 41px; margin-top: 1px; }
.auth-note { margin-top: 16px; padding: 10px 11px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; line-height: 1.5; }
.auth-footnote { margin-top: 15px; color: var(--muted-2); font-size: 10.5px; line-height: 1.5; text-align: center; }
.auth-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Адаптивность
   -------------------------------------------------------------------------- */
@media (max-width: 1440px) {
  .nav-button { padding: 0 8px; }
  .global-search { width: 172px; }
  .global-search kbd { display: none; }
  .user-chip-name { display: none; }
  .user-chip { padding-right: 4px; }
  .stage-gesture-hint { display: none; }
  .map-select { width: 124px; }
  .map-switcher::after { right: 77px; }
}
@media (max-width: 1280px) {
  .brand-text small { display: none; }
  .brand-text strong { font-size: 16px; }
  .global-search { width: 172px; }
  .global-search kbd { display: none; }
  .user-chip-name { display: none; }
  .user-chip { padding-right: 4px; }
  .nav-button span:last-child { font-size: 11.5px; }
  .settings-grid { grid-template-columns: 1fr; }
  .map-sidebar { padding: 18px 15px; }
  .notes-layout { grid-template-columns: 310px minmax(0, 1fr); }
  .note-preview { padding: 28px 32px 60px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 14px; gap: 9px 12px; }
  .brand { order: 1; }
  .map-switcher { order: 2; }
  .topbar-actions { order: 3; margin-left: auto; }
  .main-nav { order: 4; width: 100%; overflow-x: auto; margin-left: 0; padding-top: 2px; }
  .main-nav::-webkit-scrollbar { height: 0; }
  .nav-button { flex: none; height: 31px; }
}
@media (max-width: 1020px) {
  :root { --sidebar-w: 292px; }
  .main { min-height: 0; }
  .map-layout { grid-template-columns: 1fr; position: relative; }
  .map-sidebar {
    position: absolute; inset: 0 auto 0 0; z-index: 20; width: 302px;
    transform: translateX(-102%); transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.3);
  }
  .view-map.sidebar-open .map-sidebar { transform: translateX(0); }
  .mobile-only { display: inline-flex; }
  .map-corner-hint { display: none; }
  .notes-layout { grid-template-columns: 292px minmax(0, 1fr); }
  .calendar-month-grid { grid-auto-rows: minmax(96px, 1fr); }
}
@media (max-width: 860px) {
  .view-scroll { padding: 20px 16px 46px; }
  .page-head { flex-direction: column; gap: 11px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .kanban { grid-template-columns: 1fr; gap: 10px; }
  .kanban-column { min-height: 110px; }
  .kanban-list { min-height: 40px; }
  .task-toolbar .toolbar-search { width: 100%; }
  .task-toolbar .select { flex: 1; min-width: 120px; }
  .task-toolbar .select:last-child { margin-left: 0; }
  .calendar-tip { display: none; }
  .calendar-toolbar-right { margin-left: auto; }
  .calendar-notes-toggle { font-size: 10px; padding: 3px 7px; }
  .calendar-notes-toggle span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-cell-note { font-size: 8px; padding: 1px 3px; }
  .calendar-cell-note-count { font-size: 7px; }
  .calendar-month-grid { grid-auto-rows: minmax(82px, 1fr); }
  .calendar-event.compact .calendar-event-time { display: none; }
  .calendar-event-title { font-size: 9px; }
  .calendar-week { grid-template-columns: repeat(7, minmax(78px, 1fr)); overflow-x: auto; }
  .notes-layout { display: block; overflow-y: auto; height: 100%; }
  /* Панель выше прежних 45vh: фильтр по дате добавляет два поля и кнопку.
     Список внутри прокручивается сам, поэтому превью остаётся достижимым. */
  .notes-explorer {
    height: auto; max-height: 74vh; min-height: 300px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .notes-list { max-height: none; min-height: 120px; flex: 1; }
  .note-preview { height: auto; overflow: visible; padding: 24px 20px 60px; }
  .note-preview-title { font-size: 26px; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .editor-side .editor-section:nth-child(1), .editor-side .type-section { grid-column: 1 / -1; }
  .md-panes { grid-template-columns: 1fr; }
  .md-pane + .md-pane { border-left: 0; border-top: 1px solid var(--border); }
  .md-preview { max-height: 260px; }
  .settings-grid { gap: 10px; }
  .sync-actions .button.secondary { margin-left: 0; }
  .status-split { grid-template-columns: 1fr; }
  .archive-note { margin-left: 0; width: 100%; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  /* На самых узких экранах жертвуем индикатором синхронизации, чтобы
     селектор карты и кнопка напоминаний оставались кликабельными. */
  .sync-indicator { display: none; }
}

@media (max-width: 640px) {
  /* На телефоне меню напоминаний — нижняя карточка, а не поповер у кнопки. */
  .reminders-popover {
    position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto;
    width: auto; max-width: none; max-height: min(70vh, 460px); overflow-y: auto;
  }

  /* backdrop-filter создаёт containing block для position: fixed.
     На телефоне он не нужен, иначе нижняя карточка считается от topbar. */
  .topbar { padding: 7px 10px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .brand-text { display: none; }
  .map-switcher { flex: 1; min-width: 0; }
  .map-select { flex: 1; width: auto; min-width: 0; }
  .map-switcher::after { display: none; }
  .global-search { display: none; }
  .auth-card { padding: 23px 19px 19px; }
  .auth-card h1 { font-size: 22px; }
  .user-chevron { display: none; }
  .sync-indicator span:last-child { display: none; }
  .sync-indicator { width: 30px; justify-content: center; padding: 0; }
  .nav-button { padding: 0 8px; gap: 4px; }
  .nav-button span:last-child { font-size: 10.5px; }
  .page-head h1 { font-size: 23px; }
  .view-scroll { padding: 16px 11px 50px; }
  .task-toolbar { padding: 7px; }
  .task-toolbar .select { flex: 1 1 45%; }
  .calendar-head .page-actions { gap: 5px; }
  .calendar-head .segmented { order: 2; }
  .calendar-month-grid { grid-auto-rows: minmax(70px, 1fr); }
  .calendar-weekdays span { padding: 6px 4px; font-size: 8.5px; text-align: center; }
  .calendar-cell { padding: 3px; gap: 2px; }
  .calendar-cell-events .calendar-event:nth-child(n+3) { display: none; }
  .calendar-event { padding: 2px 3px; }
  .calendar-event-title { font-size: 8px; }
  .calendar-more { font-size: 8px; }
  .agenda-row { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
  /* Панель заметок на телефоне не ограничиваем по высоте: фильтр по дате
     добавляет до трети экрана, и список иначе схлопывался бы в одну строку. */
  .notes-explorer-head { padding: 14px 12px 11px; gap: 7px; }
  /* Облако тегов дублирует выпадающий список тегов — на телефоне убираем
     его, чтобы освободить место списку заметок. */
  .notes-tags { display: none; }
  .notes-list { max-height: none; min-height: 140px; }
  .notes-filter-row .select { font-size: 11px; height: 30px; }
  .notes-date-range { gap: 5px; padding: 7px; }
  .notes-date-field { min-width: 82px; }
  .note-preview { padding: 20px 14px 60px; }
  .note-preview-title { font-size: 23px; }
  .editor-side { grid-template-columns: 1fr; }
  .modal-overlay { padding: 8px; align-items: flex-end; }
  .modal { max-height: calc(100dvh - 16px); border-radius: 16px 16px 0 0; }
  .modal-footer { border-radius: 0; }
  .modal-body { padding: 14px; }
  .modal-head { padding: 14px 15px 11px; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .sync-form-actions { flex-direction: column-reverse; }
  .sync-form-actions .button { width: 100%; }
  .selection-bar { left: 8px; right: 8px; bottom: 8px; transform: none; max-width: none; flex-wrap: wrap; }
  .selection-count { width: 100%; }
  .selection-actions { width: 100%; justify-content: flex-start; }
  @keyframes riseIn { from { opacity: 0; transform: translateY(8px); } }
  .zoom-controls { right: 10px; bottom: 10px; }
  .map-toolbar { top: 9px; left: 10px; right: 10px; }
  .sidebar-footer { grid-template-columns: 1fr; }
  .shortcut-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .shortcut-row kbd { min-width: 0; }
  .toast-root { left: 10px; right: 10px; bottom: 10px; }
  .toast { max-width: none; }
}

/* --- Журнал аудита --- */
.audit-panel { display: flex; flex-direction: column; gap: 14px; }
.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: end;
}
.audit-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.audit-date-range {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.audit-date-range[hidden] { display: none; }
.audit-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}
.audit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.audit-row-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}
.audit-row-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.audit-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.audit-row-action { font-size: 14px; }
.audit-row-entity {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.audit-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.audit-row-ip { opacity: 0.75; }
.audit-row-details { display: flex; flex-wrap: wrap; gap: 6px; }
.audit-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
}
.audit-chip-key { color: var(--muted); }
.audit-chip-value {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.audit-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}
.audit-pager[hidden] { display: none; }

/* Сообщение о блокировке входа */
.auth-lock {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.35;
}
.auth-lock[hidden] { display: none; }

@media (max-width: 900px) {
  .audit-toolbar { grid-template-columns: 1fr 1fr; }
  .audit-search-field { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .audit-toolbar { grid-template-columns: 1fr; }
  .audit-row { padding: 11px; }
  .audit-chip-value { max-width: 140px; }
  .audit-pager { flex-wrap: wrap; }
}

