/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Fonts ────────────────────────────────────────────────
   Golos Text — основной текст (кириллица родная, не латинская докрутка),
   спокойный на маленьких размерах и в тёмной теме.
   J Audio Cassette — заголовки, бренд «Sphere», подписи блоков и крупные
   названия на холсте. Свои файлы (public/fonts), кириллица полная.

   У шрифта одно тонкое начертание — оно стало весом 300. Веса 400–700
   собраны из него утолщением контуров так, что штрих совпадает с Unbounded
   того же веса (прежний шрифт заголовков): подписи блоков (600) и бренд
   (700) остаются такими же плотными. Без своих файлов браузер нарисовал бы
   на 600–700 поддельный жирный — размазанный, чужой рисунку шрифта.
   Все веса сжаты на 10% по ширине, а середина строки в файлах совпадает с
   серединой прописных — текст стоит ровно по центру кнопок и блоков. ── */
@font-face {
  font-family: 'J Audio Cassette';
  src: url('/fonts/cassette-300.woff2') format('woff2'),
       url('/fonts/cassette-300.woff') format('woff');
  font-weight: 100 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'J Audio Cassette';
  src: url('/fonts/cassette-400.woff2') format('woff2'),
       url('/fonts/cassette-400.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'J Audio Cassette';
  src: url('/fonts/cassette-500.woff2') format('woff2'),
       url('/fonts/cassette-500.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'J Audio Cassette';
  src: url('/fonts/cassette-500.woff2') format('woff2'),
       url('/fonts/cassette-500.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'J Audio Cassette';
  src: url('/fonts/cassette-500.woff2') format('woff2'),
       url('/fonts/cassette-500.woff') format('woff');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-body: 'Golos Text', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: 'J Audio Cassette', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Форма: единая система скруглений ─────────────────────────────
   По образцу Apple Liquid Glass (WWDC25 «Get to know the new design
   system»). Форм всего три, и выбирается она по РОЛИ элемента, а не на глаз:

   1. Капсула — радиус равен половине высоты. Все элементы управления:
      кнопки, поля ввода в одну строку, чипы, сегменты, переключатели,
      тултипы в одну строку, иконки-кнопки (квадратная капсула = круг).

   2. Фиксированный радиус — у самостоятельных поверхностей. Только ступени
      шкалы ниже, никаких «9px здесь, 11px там»: раньше в интерфейсе жило
      27 разных радиусов, и одинаковые по роли кнопки скруглялись на 7, 8, 9
      и 12 px.

   3. Концентрический — у вложенного в поверхность: радиус родителя минус
      отступ до края. Тогда кривая внутреннего элемента идёт параллельно
      внешней, как у кнопки в углу окна macOS, — а не спорит с ней.

   Круги (аватар, точка статуса, радиокнопка) остаются 50%: это не
   скругление, а сама форма. */
:root {
  --r-capsule: 999px;

  /* Ступени фиксированного радиуса */
  --r-xs: 6px;      /* метки в тексте: код, выделение, клавиша, событие в сетке */
  --r-sm: 12px;     /* мелкие плитки: день в календаре, картинка в заметке */
  --r-md: 18px;     /* карточки в потоке, пузыри чата, многострочные поля */
  --r-lg: 24px;     /* поповеры, меню, выпадающие списки */
  --r-xl: 30px;     /* панели и окна поверх холста */
  --r-2xl: 36px;    /* модальные окна */

  /* Концентричность: отступ поверхности до её содержимого и радиус того,
     что стоит внутри. Пункт меню, карточка задачи, строка настроек — все
     берут радиус отсюда, а не свой. */
  --pad-popover: 8px;
  --r-in-popover: calc(var(--r-lg) - var(--pad-popover));   /* 16px */
  --pad-panel: 16px;
  --r-in-panel: calc(var(--r-xl) - var(--pad-panel));       /* 14px */
  --pad-modal: 16px;
  --r-in-modal: calc(var(--r-2xl) - var(--pad-modal));      /* 20px */

  /* Материал стекла: размытие одно на весь интерфейс. Насыщенность
     поднимаем — размытие усредняет цвета и выхолащивает их, без этого
     стекло над цветными блоками выглядит серой плёнкой. */
  --glass-blur: blur(22px) saturate(170%);
}

/* ── Light theme (default) ───────────────────────────────── */
:root {
  --bg-app: #eef0f5;
  --bg-canvas: #e4e6ee;
  --surface-1: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #e9ebf1;
  --border: rgba(15, 15, 20, 0.10);
  --border-strong: rgba(15, 15, 20, 0.18);
  --text-primary: #16171c;
  --text-secondary: rgba(22, 23, 28, 0.58);
  --accent: #3b6ef6;
  --accent-contrast: #ffffff;
  --danger: #ef4444;
  --danger-strong: #dc2626;

  --shadow-soft: 0 2px 10px rgba(15, 15, 20, 0.06);
  --shadow-node: 0 4px 16px rgba(15, 15, 20, 0.10);
  --glow-accent: none;
  --scrim: rgba(10, 10, 14, 0.28);

  /* ── Стекло (Liquid Glass) ─────────────────────────────────
     Только для слоя управления поверх холста: панели, меню, тулбар. На
     контент (блоки, карточки внутри панели) стекло не кладём — Apple прямо
     запрещает «стекло на стекле»: вложенное стекло теряет иерархию.
     fill — подложка поверхности: достаточно плотная, чтобы текст читался над
     любым участком доски, и достаточно прозрачная, чтобы доска угадывалась.
     rim — светлый блик по верхней кромке, edge — тонкая граница по контуру:
     вместе они дают толщину стекла без тяжёлой обводки. */
  --glass-fill: color-mix(in srgb, var(--surface-1) 80%, transparent);
  --glass-rim: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(15, 15, 20, 0.08);
  --glass-shadow: 0 1px 2px rgba(15, 15, 20, 0.05), 0 12px 32px -8px rgba(15, 15, 20, 0.18);

  /* Подсказка — инверсия темы (см. .tooltip-glass). Через текст и фон
     приложения, поэтому в тёмной теме переворачивается сама. */
  --tip-bg: var(--text-primary);
  --tip-text: var(--bg-app);

  --status-none: #c7c9d4;
  --status-burning: #ef4444;
  --status-in-progress: #eab308;
  --status-done: #22c55e;

  /* ── Панели: фон + «приподнятые» элементы на них ──────────
     Обычный режим — плоские поверхности как раньше. Режим «Градиент
     интерфейса» (см. [data-panel-gradient] ниже) переопределяет только эти
     токены, поэтому ни один компонент про настройку не знает. ── */
  --panel-bg: var(--glass-fill);
  /* Сплошной вариант подложки — для окна, которое и так лежит на затемнении
     и размывать под собой ему нечего (окно календаря). */
  --panel-solid: var(--surface-1);
  /* Всё, что лежит НА стеклянной панели, — не стекло, а тонированная
     подложка: полупрозрачный оттенок текста. Так кнопка одинаково читается
     и на белой панели, и на стекле над пёстрой доской, и в тёмной теме
     (там --text-primary светлый — формула та же). */
  --panel-elev: color-mix(in srgb, var(--text-primary) 6%, transparent);        /* кнопка/активная вкладка НА панели */
  --panel-elev-hover: color-mix(in srgb, var(--text-primary) 10%, transparent);
  --panel-inset: color-mix(in srgb, var(--text-primary) 5%, transparent);       /* утопленная дорожка под вкладками */
  --panel-hover: color-mix(in srgb, var(--text-primary) 5%, transparent);       /* мягкая подсветка строки под курсором */
  --panel-knob: var(--surface-1);        /* шайба переключателя / активная пилюля */

  /* Опорные цвета сине-зелёного градиента. Задаются в каждой теме отдельно:
     подмешивание в белый (#fff) и в почти-чёрный (#17191f) ведёт себя
     принципиально по-разному, одни и те же проценты дают либо выцветшую
     пастель, либо грязь. */
  --grad-a: color-mix(in srgb, #10b981 34%, #ffffff); /* изумруд */
  --grad-b: color-mix(in srgb, #22c9d4 30%, #ffffff); /* бирюза  */
  --grad-c: color-mix(in srgb, #3b6ef6 26%, #ffffff); /* синий   */
  /* Кнопка на цветной панели: полупрозрачное «стекло» вместо серой заливки.
     В светлой теме подложка белая (осветляет), в тёмной — тоже белая, но
     совсем слабая, иначе кнопка выбьется ярким пятном. */
  --panel-elev-grad: color-mix(in srgb, #22c9d4 52%, #ffffff);
  --panel-elev-grad-hover: color-mix(in srgb, #22c9d4 66%, #ffffff);
  --panel-inset-grad: color-mix(in srgb, #0e7490 17%, transparent);
  --panel-hover-grad: color-mix(in srgb, #22c9d4 30%, transparent);
  --panel-knob-grad: color-mix(in srgb, #22c9d4 15%, #ffffff);

  color-scheme: light;
}

/* ── Dark theme — follows OS unless a manual override is set ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Нейтральный графит без оттенка — как белый в светлой теме. Прежние
       поверхности (#17191f и соседи) уходили в сине-фиолетовый, и без
       градиента интерфейс выглядел подкрашенным. */
    --bg-app: #0c0c0c;
    --bg-canvas: #111111;
    --surface-1: #1a1a1a;
    --surface-2: #222222;
    --surface-3: #2b2b2b;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text-primary: #f2f2f2;
    --text-secondary: rgba(242, 242, 242, 0.58);
    --accent: #5b8bff;
    --accent-contrast: #ffffff;
    --danger: #f87171;
    --danger-strong: #ef4444;

    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-node: 0 4px 18px rgba(0, 0, 0, 0.4);
    --glow-accent: 0 0 24px rgba(91, 139, 255, 0.35);
    --scrim: rgba(0, 0, 0, 0.55);

    /* В тёмной теме блик кромки едва заметен — яркий читался бы как белая
       обводка, — а глубину держит тень. */
    --glass-rim: rgba(255, 255, 255, 0.10);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -8px rgba(0, 0, 0, 0.6);

    --status-none: #3a3a3c;
    --status-burning: #f87171;
    --status-in-progress: #fbbf24;
    --status-done: #34d399;

    --panel-knob: var(--surface-3);
    /* Подмешиваем в тёмную поверхность, а не в белую — проценты выше, чем в
       светлой теме, иначе цвет тонет в почти-чёрном фоне. */
    --grad-a: color-mix(in srgb, #10b981 30%, #17191f);
    --grad-b: color-mix(in srgb, #22c9d4 26%, #17191f);
    --grad-c: color-mix(in srgb, #5b8bff 30%, #17191f);
    --panel-elev-grad: color-mix(in srgb, #22c9d4 44%, #17191f);
    --panel-elev-grad-hover: color-mix(in srgb, #22c9d4 56%, #17191f);
    --panel-inset-grad: rgba(0, 0, 0, 0.30);
    --panel-hover-grad: color-mix(in srgb, #22c9d4 17%, transparent);
    --panel-knob-grad: color-mix(in srgb, #22c9d4 46%, #17191f);

    color-scheme: dark;
  }
}

/* ── Manual override: forced dark ─────────────────────────── */
:root[data-theme="dark"] {
  /* Нейтральный графит — см. пояснение в блоке тёмной темы выше. */
  --bg-app: #0c0c0c;
  --bg-canvas: #111111;
  --surface-1: #1a1a1a;
  --surface-2: #222222;
  --surface-3: #2b2b2b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f2f2f2;
  --text-secondary: rgba(242, 242, 242, 0.58);
  --accent: #5b8bff;
  --accent-contrast: #ffffff;
  --danger: #f87171;
  --danger-strong: #ef4444;

  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-node: 0 4px 18px rgba(0, 0, 0, 0.4);
  --glow-accent: 0 0 24px rgba(91, 139, 255, 0.35);
  --scrim: rgba(0, 0, 0, 0.55);

  --glass-rim: rgba(255, 255, 255, 0.10);
  --glass-edge: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -8px rgba(0, 0, 0, 0.6);

  --status-none: #3a3a3c;
  --status-burning: #f87171;
  --status-in-progress: #fbbf24;
  --status-done: #34d399;

  --panel-knob: var(--surface-3);
  --grad-a: color-mix(in srgb, #10b981 30%, #17191f);
  --grad-b: color-mix(in srgb, #22c9d4 26%, #17191f);
  --grad-c: color-mix(in srgb, #5b8bff 30%, #17191f);
  --panel-elev-grad: color-mix(in srgb, #22c9d4 44%, #17191f);
  --panel-elev-grad-hover: color-mix(in srgb, #22c9d4 56%, #17191f);
  --panel-inset-grad: rgba(0, 0, 0, 0.30);
  --panel-hover-grad: color-mix(in srgb, #22c9d4 17%, transparent);
  --panel-knob-grad: color-mix(in srgb, #22c9d4 46%, #17191f);

  color-scheme: dark;
}

/* ── Manual override: forced light (re-asserts light even if OS is dark) ── */
:root[data-theme="light"] {
  --bg-app: #eef0f5;
  --bg-canvas: #e4e6ee;
  --surface-1: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #e9ebf1;
  --border: rgba(15, 15, 20, 0.10);
  --border-strong: rgba(15, 15, 20, 0.18);
  --text-primary: #16171c;
  --text-secondary: rgba(22, 23, 28, 0.58);
  --accent: #3b6ef6;
  --accent-contrast: #ffffff;
  --danger: #ef4444;
  --danger-strong: #dc2626;

  --shadow-soft: 0 2px 10px rgba(15, 15, 20, 0.06);
  --shadow-node: 0 4px 16px rgba(15, 15, 20, 0.10);
  --glow-accent: none;
  --scrim: rgba(10, 10, 14, 0.28);

  --status-none: #c7c9d4;
  --status-burning: #ef4444;
  --status-in-progress: #eab308;
  --status-done: #22c55e;

  --panel-knob: var(--surface-1);
  --grad-a: color-mix(in srgb, #10b981 34%, #ffffff);
  --grad-b: color-mix(in srgb, #22c9d4 30%, #ffffff);
  --grad-c: color-mix(in srgb, #3b6ef6 26%, #ffffff);
  --panel-elev-grad: color-mix(in srgb, #22c9d4 52%, #ffffff);
  --panel-elev-grad-hover: color-mix(in srgb, #22c9d4 66%, #ffffff);
  --panel-inset-grad: color-mix(in srgb, #0e7490 17%, transparent);
  --panel-hover-grad: color-mix(in srgb, #22c9d4 30%, transparent);
  --panel-knob-grad: color-mix(in srgb, #22c9d4 15%, #ffffff);

  color-scheme: light;
}


/* ⚠ ПОРЯДОК ВАЖЕН: этот блок обязан идти ПОСЛЕ всех темовых блоков.
   У :root[data-panel-gradient] и :root[data-theme="light"|"dark"]
   одинаковая специфичность — при равной специфичности побеждает то
   правило, что ниже в файле. Когда блок стоял выше, темовые блоки
   возвращали --panel-elev/--panel-knob к --surface-1, и кнопки на
   градиентной панели оставались белыми (--panel-bg при этом работал
   только потому, что его темовые блоки не переопределяют).
   Новый темовый блок добавлять ТОЛЬКО выше этого правила.

   Сам градиент: зелёный → бирюза → синий по диагонали, как на мокапе;
   конкретные цвета берутся из grad-токенов активной темы. */
:root[data-panel-gradient="true"] {
  --panel-bg: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 52%, var(--grad-c) 100%);
  --panel-solid: var(--panel-bg);
  --panel-elev: var(--panel-elev-grad);
  --panel-elev-hover: var(--panel-elev-grad-hover);
  --panel-inset: var(--panel-inset-grad);
  --panel-hover: var(--panel-hover-grad);
  --panel-knob: var(--panel-knob-grad);
}


html, body, #root {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Дополнительный замок прокрутки для телефонов. overflow: hidden на body в
   мобильном Safari срабатывает не всегда: страница всё равно оттягивается и
   уезжает вместе с содержимым. position: fixed убирает саму возможность
   прокрутить документ — приложение живёт в одном экране, прокручиваются
   только панели внутри. */
@media (max-width: 768px) {
  body {
    position: fixed;
    inset: 0;
    width: 100%;
  }
}

h1, h2, h3 {
  font-family: var(--font-heading);
}

/* Мобильные браузеры рисуют постоянно видимый скроллбар-трек у любого
   overflow:auto/scroll внутри всплывающих панелей (меню, календарь, задачи,
   ИИ-чат — все они помечены [data-ui-overlay]) — при попытке проскроллить
   контент справа появляется лишняя серая полоса. Сам скролл при этом
   работает как обычно, просто без видимого трека. Только мобилка — десктоп
   не трогаем, там штатные оверлей-скроллбары и так выглядят нормально.
   !important — гарантированно перекрывает более специфичные локальные
   стили скроллбара конкретных панелей (например .descendantList в
   NodeContextMenu), а не полагается на порядок каскада между файлами. */
@media (max-width: 768px) {
  [data-ui-overlay] *::-webkit-scrollbar {
    display: none !important;
  }
  [data-ui-overlay] * {
    scrollbar-width: none;
  }
}

/* ── Поверхности: стекло ─────────────────────────────────────
   .glass — панель или окно поверх холста (радиус --r-xl), .glass-sm —
   поповер, меню, всплывающая строка (--r-lg). Модуль компонента задаёт
   только геометрию (где стоит, размер, свой радиус по роли), а материал —
   подложка, кромка, тень, размытие — один на всех, отсюда.

   ⚠ backdrop-filter делает элемент контейнером для position: fixed
   потомков: такой потомок начинает считать координаты от угла поверхности,
   а не экрана. Поэтому всплывающее внутри стекла выносится в портал; а
   поверхность, внутри которой есть fixed-попапы без портала (окно
   календаря), размытие отключает у себя — см. .modal в CalendarModal. */
.glass,
.glass-sm {
  background: var(--panel-bg);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 0 var(--glass-rim), var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.glass { border-radius: var(--r-xl); }
.glass-sm { border-radius: var(--r-lg); }

/* «Уменьшить прозрачность» в системе — стекло становится сплошным: для
   людей, которым полупрозрачность мешает читать, это не украшение, а шум. */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-fill: var(--surface-1); }
  .glass, .glass-sm { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ── Кнопки ────────────────────────────────────────────────────
   Капсула. Заливка — тонированная подложка (--panel-elev), а не ещё одно
   стекло: кнопки живут на стеклянных панелях, а стекло на стекле теряет
   иерархию. Тени у кнопки нет — объём держит панель под ней. */
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 9px 18px;
  background: var(--panel-elev);
  border: 1px solid transparent;
  border-radius: var(--r-capsule);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
  outline: none;
  user-select: none;
}

.btn-glass:hover {
  background: var(--panel-elev-hover);
}

.btn-glass:active {
  transform: scale(0.97);
}

.btn-glass:focus-visible,
.icon-btn:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-glass:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Круглая кнопка-иконка: закрыть, листать, действие в строке. Квадратная
   капсула — это круг, поэтому отдельного «кругового» радиуса нет. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--r-capsule);
  background: var(--panel-elev);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.icon-btn:hover { background: var(--panel-elev-hover); color: var(--text-primary); }

/* Вложенная поверхность внутри стеклянной панели — поле сообщения
   ассистента, его карточки и подсказки. Своя подложка чуть темнее/светлее
   панели, тонкая кромка и блик по верху, как у стекла, но без размытия:
   стекло на стекло не кладём. Форму (радиус, отступы) задаёт сам элемент. */
.surface-inset {
  background: var(--panel-inset);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 0 var(--glass-rim);
}
.icon-btn:active { transform: scale(0.94); }

/* ── Поля ввода ────────────────────────────────────────────────
   Однострочное поле — капсула, как кнопка рядом с ним: поле и кнопка
   «Создать» в одной строке теперь одной формы. Многострочное (textarea)
   капсулой быть не может — на высоте 120 px углы превращаются в полукруги,
   — поэтому у него фиксированный --r-md. */
.input-glass {
  width: 100%;
  min-height: 42px;
  padding: 10px 18px;
  background: var(--panel-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-capsule);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea.input-glass { border-radius: var(--r-md); }

.input-glass::placeholder {
  color: var(--text-secondary);
}

.input-glass:focus {
  border-color: var(--accent);
  background: var(--surface-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ── Подсказка ─────────────────────────────────────────────────
   Сплошная, в инверсии темы (тёмная на светлой, светлая на тёмной). В одну
   строку — капсула; с переносами модуль ставит --r-sm, иначе углы съедают
   буквы. Стрелка — того же цвета, что сама подсказка, поэтому читается её
   продолжением. Направление — data-arrow="up" | "down". */
.tooltip-glass {
  padding: 6px 12px;
  border-radius: var(--r-capsule);
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--glass-shadow);
}
.tooltip-glass[data-arrow]::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  pointer-events: none;
}
.tooltip-glass[data-arrow="down"]::after { top: 100%; border-top-color: var(--tip-bg); }
.tooltip-glass[data-arrow="up"]::after { bottom: 100%; border-bottom-color: var(--tip-bg); }

/* Автозаполнение браузера рисует свой светлый фон и игнорирует тему сайта
   целиком (color-scheme на него не действует) — единственный обход:
   протолкнуть цвет поверхности через inset box-shadow побольше самого поля. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  box-shadow: 0 0 0 1000px var(--surface-2) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-capsule); }

/* ── Mobile: prevent auto-zoom on input focus ──────────────── */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
}

/* iOS Safari принудительно зумит всю страницу при фокусе на поле, у которого
   шрифт меньше 16px — после ввода холст остаётся в неправильном масштабе, и
   вернуть его можно только вручную. Правило общее для всех полей приложения:
   иначе пришлось бы помнить про это в каждом новом компоненте.
   Отдельные размеры внутри компонентов остаются как есть на десктопе. */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    font-size: 16px;
  }
}
/* everysphere — landing styles */

:root {
  --bg: oklch(0.985 0.004 80);
  --bg-soft: oklch(0.97 0.006 80);
  --ink: oklch(0.18 0.015 270);
  --ink-soft: oklch(0.45 0.015 270);
  --ink-faint: oklch(0.65 0.012 270);
  --line: oklch(0.9 0.01 270);

  /* pastel rainbow — matched chroma ~0.09, lightness ~0.85 */
  --c-peach:   oklch(0.88 0.09 45);
  --c-rose:    oklch(0.86 0.09 10);
  --c-lilac:   oklch(0.85 0.09 310);
  --c-sky:     oklch(0.87 0.08 230);
  --c-mint:    oklch(0.9 0.08 165);
  --c-lemon:   oklch(0.93 0.09 95);

  --glass-white: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.9);
  --glass-shadow: 0 30px 60px -20px rgba(40, 40, 80, 0.18),
                  0 12px 24px -12px rgba(40, 40, 80, 0.12),
                  inset 0 1px 0 rgba(255,255,255,0.9),
                  inset 0 -6px 14px rgba(255,255,255,0.45);
}

* { box-sizing: border-box; }
html, body, #root {
  overflow: visible !important;
  height: auto !important;
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.custom-cursor { display: none; }

.display { font-family: var(--font-heading); letter-spacing: -0.03em; font-weight: 500; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* --- Grain / noise overlay --- */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  opacity: 0.35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --- Global rainbow aura (very soft) --- */
.aura {
  position: fixed; inset: -20vmax; z-index: -2; pointer-events: none; display: none;
}

/* ====== Liquid glass card primitives ======
   Названо landing-glass (не просто .glass) — .glass это ещё и общий
   утилитарный класс всего приложения (styles/glass.css, непрозрачные тёмные
   панели); этот файл раньше грузился глобально (LandingPage/LegalLayout
   импортируют его как побочный эффект, а Vite не выгружает style-теги при
   уходе с роута) и светлые полупрозрачные блики здесь перебивали тёмную тему
   везде — календарь, диалоги и т.д. показывали белую "виньетку". */
.landing-glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.35));
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 28px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
.landing-glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0) 40%);
  pointer-events: none;
}
.landing-glass::after {
  content: ''; position: absolute; left: 10%; right: 10%; bottom: 4%;
  height: 30%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.5), transparent 70%);
  filter: blur(8px); pointer-events: none;
}

.glass-frosted {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 32px;
  box-shadow: 0 20px 50px -20px rgba(40,40,80,0.15);
}

.glass-glossy {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.7) 100%);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1.5px solid rgba(255,255,255,0.95);
  border-radius: 24px;
  box-shadow:
    0 20px 50px -15px rgba(40,40,80,0.2),
    inset 0 2px 2px rgba(255,255,255,0.95),
    inset 0 -10px 20px rgba(255,255,255,0.35),
    inset 3px 0 8px rgba(255,255,255,0.4),
    inset -3px 0 8px rgba(255,255,255,0.4);
}

/* ====== Containers ====== */
section { position: relative; padding: 140px 40px; z-index: 1; }
.wrap { max-width: 1280px; margin: 0 auto; width: 100%; }

/* ====== Mobile adaptations ====== */
@media (max-width: 860px) {
  section { padding: 80px 18px; }
  h1.hero-word { font-size: clamp(44px, 13vw, 88px); }
  .section-title { font-size: clamp(30px, 9vw, 52px); line-height: 1.05; }
  .lede { font-size: 16px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.14em; }
  .nav {
    top: 10px; padding: 6px 6px 6px 14px; gap: 10px; font-size: 12px;
    max-width: calc(100vw - 20px);
  }
  .nav a:not(.cta-pill):not(.brand) { display: none; }
  .nav .cta-pill { padding: 7px 13px; font-size: 12px; white-space: nowrap; }
  .feature { padding: 22px; border-radius: 22px; }
  .feature h3 { font-size: 20px; margin: 14px 0 8px; }
  .feature p { font-size: 14px; }
  .btn {
    padding: 13px 20px; font-size: 13.5px;
    white-space: nowrap; line-height: 1;
  }
  .tweaks-panel {
    right: 10px; bottom: 10px; width: calc(100vw - 20px); max-width: 320px;
    max-height: 68vh; overflow-y: auto; padding: 16px;
  }
  /* grids → single column */
  section [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  section [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  /* CTA / glass card padding */
  section .landing-glass { padding: 44px 22px !important; border-radius: 22px; }
  section .glass-glossy { padding: 14px !important; min-height: auto !important; }
  section .glass-glossy > div[style*="height: 280"] { height: 220px !important; }
  footer {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    font-size: 12px !important;
  }
  footer > div:last-child {
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
    font-size: 12px !important;
  }
  footer > div:last-child a {
    font-size: 12px !important;
  }
  /* hero specific */
  section > div[style*="minHeight"],
  section > div[style*="min-height: 100vh"] {
    padding-top: 70px !important;
  }
  /* hide "Открыть доску" label in nav, keep arrow / shorter */
  .nav .cta-pill .nav-cta-label { display: none; }
  .nav .cta-pill::before {
    content: 'Открыть';
  }
}

@media (max-width: 480px) {
  section { padding: 60px 14px; }
  .section-title { font-size: clamp(26px, 9vw, 42px); }
  h1.hero-word { font-size: clamp(36px, 12vw, 64px) !important; }
  .btn { padding: 12px 16px; font-size: 12.5px; gap: 6px; }
  .nav { font-size: 11px; padding: 5px 5px 5px 12px; gap: 8px; }
  /* hero buttons: full-width stacked */
  section > div[style*="minHeight"] .btn,
  section > div[style*="min-height: 100vh"] .btn {
    flex: 1 1 auto;
  }
  /* hero CTA row wraps */
  section > div[style*="minHeight"] > div[style*="display: flex"][style*="gap: 14"],
  section > div[style*="min-height: 100vh"] > div[style*="display: flex"][style*="gap: 14"] {
    width: 100%;
    padding: 0 10px;
    justify-content: center;
    flex-wrap: nowrap;
  }
  /* shrink hero paragraph */
  section > div[style*="minHeight"] p,
  section > div[style*="min-height: 100vh"] p {
    font-size: 16px !important;
    padding: 0 8px;
  }
  section > div[style*="minHeight"] p br,
  section > div[style*="min-height: 100vh"] p br {
    display: none;
  }
}

/* ====== Nav ====== */
.nav {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 100;
  padding: 10px 14px 10px 22px;
  display: flex; align-items: center; gap: 18px;
  border-radius: 100px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 10px 30px -10px rgba(40,40,80,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
  font-size: 13px;
}
.nav .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.01em; }
.nav .brand .dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c-peach), var(--c-lilac), var(--c-sky), var(--c-mint), var(--c-lemon), var(--c-peach));
  filter: blur(0.3px);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.8), 0 0 10px rgba(200,200,255,0.4);
}
.nav .brand .brand-logo {
  width: 22px; height: 22px; object-fit: contain; display: block;
}
.nav a { color: var(--ink-soft); text-decoration: none; transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav .cta-pill {
  background: var(--ink); color: white; padding: 8px 16px; border-radius: 100px;
  font-weight: 500; transition: transform .2s;
}
.nav .cta-pill:hover { color: white; background: oklch(0.28 0.02 270); }

/* ====== Type ====== */
h1.hero-word {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(80px, 14vw, 220px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 0;
  text-align: center;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
}

.lede { font-size: 20px; line-height: 1.5; color: var(--ink-soft); max-width: 640px; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 18px 28px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--ink); color: white;
  box-shadow: 0 8px 20px -8px rgba(40,40,80,0.4);
}
.btn-primary:hover { box-shadow: 0 12px 26px -10px rgba(40,40,80,0.5); }
.btn-ghost {
  background: rgba(255,255,255,0.7); color: var(--ink);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.06);
}
.btn-ghost:hover { background: rgba(255,255,255,0.9); }

/* ====== Tweaks Panel ====== */
.tweaks-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 500;
  padding: 20px; border-radius: 20px; width: 280px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(30px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 20px 50px -15px rgba(40,40,80,0.25);
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.tweaks-panel .opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  transition: background .2s; font-size: 14px;
}
.tweaks-panel .opt:hover { background: rgba(0,0,0,0.03); }
.tweaks-panel .opt.active { background: var(--ink); color: white; }
.tweaks-panel .opt .n { font-family: 'JetBrains Mono', monospace; font-size: 11px; opacity: 0.5; }

/* ====== Utility ====== */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.center { justify-content: center; align-items: center; }

/* ====== Liquid rainbow text (for WWDC hero) ====== */
.rainbow-text {
  background: linear-gradient(
    100deg,
    oklch(0.75 0.15 25) 0%,
    oklch(0.8 0.12 60) 15%,
    oklch(0.85 0.13 110) 30%,
    oklch(0.75 0.13 160) 45%,
    oklch(0.7 0.14 220) 60%,
    oklch(0.7 0.16 280) 78%,
    oklch(0.72 0.15 340) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: saturate(0.85);
}

/* ====== Liquid glass nodes — sphere + task ====== */
/* color tokens mapped to hex for --node-color variable */
.n-peach { --node-color: #ffd6a5; }
.n-rose  { --node-color: #ffc3d4; }
.n-lilac { --node-color: #d4c5ff; }
.n-sky   { --node-color: #a8d8ea; }
.n-mint  { --node-color: #b8e6c5; }
.n-lemon { --node-color: #ffeaa8; }
.n-ink   { --node-color: #c8c8d4; }

/* Sphere node — larger */
.sphere {
  min-width: 140px;
  min-height: 64px;
  padding: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 2px 2px 6px rgba(255, 255, 255, 0.95),
    inset -1px -1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: stretch;
  position: relative;
  overflow: visible;
  isolation: isolate;
  color: rgba(0,0,0,0.75);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}
.sphere::before {
  content: ""; position: absolute; inset: -1px;
  border-radius: 23.5px;
  background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 30%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.04) 80%, rgba(0,0,0,0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1.5px;
  pointer-events: none;
  z-index: 1;
}
.sphere::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 22px;
  background: var(--node-color, #a8d8ea);
  opacity: 0.45;
  box-shadow:
    inset 2px 2px 8px rgba(255,255,255,0.9),
    inset -1px -1px 6px rgba(0,0,0,0.15);
  pointer-events: none;
  z-index: 0;
}
.sphere.selected {
  box-shadow:
    0 0 0 2.5px rgba(59,130,246,0.55),
    0 10px 28px rgba(0,0,0,0.13),
    inset 2px 2px 8px rgba(255,255,255,0.45),
    inset -1px -1px 5px rgba(0,0,0,0.08);
}
.sphere-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 14px 22px; flex: 1;
  position: relative; z-index: 3;
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.sphere.sm .sphere-inner { padding: 10px 16px; font-size: 13px; font-weight: 600; }
.sphere.lg .sphere-inner { padding: 20px 30px; font-size: 18px; }

/* Task node — smaller pill */
.task {
  min-width: 100px;
  min-height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.1),
    inset 2px 2px 6px rgba(255,255,255,0.35),
    inset -1px -1px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  display: inline-flex;
  align-items: stretch;
  position: relative;
  overflow: visible;
  isolation: isolate;
  color: rgba(0,0,0,0.72);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}
.task::before {
  content: ""; position: absolute; inset: -0.5px;
  border-radius: 15.5px;
  background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 30%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.04) 80%, rgba(0,0,0,0.08) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1.5px;
  pointer-events: none;
  z-index: 1;
}
.task::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 14px;
  background: var(--node-color, #e0e0e8);
  opacity: 0.45;
  box-shadow:
    inset 2px 2px 8px rgba(255,255,255,0.9),
    inset -1px -1px 6px rgba(0,0,0,0.15);
  pointer-events: none;
  z-index: 0;
}
.task.selected {
  box-shadow:
    0 0 0 2.5px rgba(59,130,246,0.55),
    0 6px 22px rgba(0,0,0,0.13),
    inset 2px 2px 8px rgba(255,255,255,0.45),
    inset -1px -1px 5px rgba(0,0,0,0.08);
}
.task-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  padding: 10px 16px; flex: 1;
  position: relative; z-index: 3;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
}
.task.sm .task-inner { padding: 7px 12px; font-size: 12px; }

/* ====== Animation helpers ====== */
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1) } 50% { transform: translate(20px,-15px) scale(1.05) } }
@keyframes spinSlow { to { transform: rotate(360deg) } }
@keyframes pulse { 0%,100% { opacity: 0.7 } 50% { opacity: 1 } }
.float { animation: float 6s ease-in-out infinite; }
.drift { animation: drift 14s ease-in-out infinite; }

/* ====== Feature cards ====== */
.feature {
  padding: 36px;
  border-radius: 28px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 20px 40px -20px rgba(40,40,80,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
  transition: transform .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.feature:hover { box-shadow: 0 28px 48px -18px rgba(40,40,80,0.22); }
.feature .num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.1em; }
.feature h3 { font-family: var(--font-heading); font-weight: 400; font-size: 28px; letter-spacing: -0.02em; margin: 18px 0 12px; line-height: 1.1; }
.feature p { color: var(--ink-soft); line-height: 1.5; margin: 0; font-size: 15px; }

/* blob */
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

/* grid bg */
.dotgrid {
  background-image: radial-gradient(circle, oklch(0.85 0.005 270) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* --- Dark mode text boost (for vivid/night/duotone bgs) --- */
body.dark-mode {
  color: #f4f1ff;
}
body.dark-mode .eyebrow { color: rgba(255,255,255,0.55); }
body.dark-mode .lede { color: rgba(255,255,255,0.75); }
body.dark-mode .section-title,
body.dark-mode h1.hero-word { color: #fafafa; }
body.dark-mode .feature {
  background: rgba(20,15,30,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}
body.dark-mode .feature h3 { color: #fafafa; }
body.dark-mode .feature p { color: rgba(255,255,255,0.7); }
body.dark-mode .feature .num { color: rgba(255,255,255,0.45); }
body.dark-mode .nav {
  background: rgba(20,15,30,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fafafa;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}
body.dark-mode .nav a { color: rgba(255,255,255,0.7); }
body.dark-mode .nav a:hover { color: #fff; }
body.dark-mode .nav .cta-pill { background: #fff; color: #0e0b14; }
body.dark-mode .btn-primary { background: #fff; color: #0e0b14; }
body.dark-mode .btn-ghost { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
body.dark-mode .glass,
body.dark-mode .glass-frosted,
body.dark-mode .glass-glossy {
  background: rgba(30,22,48,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fafafa;
}
body.dark-mode .tweaks-panel {
  background: rgba(20,15,30,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fafafa;
}
body.dark-mode .tweaks-panel h4 { color: rgba(255,255,255,0.7); }
body.dark-mode .tweaks-panel .opt:hover { background: rgba(255,255,255,0.08); }
body.dark-mode .tweaks-panel .opt.active { background: #fff; color: #0e0b14; }
body.dark-mode .sphere { color: rgba(255,255,255,0.9); }
body.dark-mode .task { color: rgba(255,255,255,0.85); }
body.dark-mode .dotgrid {
  background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
}
body.dark-mode .rainbow-text {
  filter: saturate(1.3) brightness(1.3);
}

.scroll-reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s, transform .9s; }
.scroll-reveal.in { opacity: 1; transform: none; }
/* ── Shared node shell ──────────────────────────────────────
   Solid fill, fixed 1:1 (or pill) box. Shape is a modifier class
   applied on top (.shapeCircle / .shapePill), per-node setting. ── */
._node_133wz_4 {
  padding: 0;
  background: var(--node-color, #80cbc4);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: var(--shadow-node);
  cursor: pointer;
  /* Размер и скругление тянутся плавно: S→XL и круг→пилюля переключаются в
     меню блока, и мгновенная подмена выглядела как подмена блока. Положение
     на время перехода ведёт .node-resizing (см. Canvas.module.css). */
  transition: box-shadow 0.16s, transform 0.1s,
    width 340ms cubic-bezier(0.22, 1, 0.36, 1),
    height 340ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 340ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  /* Без этого долгое неподвижное касание у края ноды (жест "тянуть линию",
     см. useEdgeHoverHandle) на iOS/Android браузер по своей инициативе
     показывает нативное выделение текста/колл-аут — прерывает наш touch
     раньше TOUCH_HOLD_MS. Жест целиком обрабатывается в JS, браузеру тут
     делать нечего. */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

._shapeCircle_133wz_3 { border-radius: 50%; }
._shapePill_133wz_3 { border-radius: var(--r-capsule); }

._node_133wz_4:hover {
  box-shadow: var(--shadow-node), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

._node_133wz_4._selected_133wz_40 {
  box-shadow: var(--shadow-node), 0 0 0 3px var(--accent), var(--glow-accent);
}

/* ── Подсветка дедлайнов ──────────────────────────────────────
   Не сплошная перекраска и не обводка: подсветка «наползает» на блок от
   краёв радиальным градиентом, в центре остаётся его собственный цвет —
   видно и что блок горит, и чей он. Цвет тревоги приходит инлайном из
   Node.jsx (--deadline-color): #ff0040 / #ff9500, оттенки намеренно вне
   палитры блоков, чтобы не путались с красным/жёлтым, выбранным вручную.
   Пульсируют оба, но по-разному: просрочка чаще и с большим размахом,
   «сегодня» — медленнее и мягче. Разный ритм читается боковым зрением, так
   что состояния различимы, даже когда цвет виден плохо. */
._node_133wz_4._overdue_133wz_53,
._node_133wz_4._dueToday_133wz_54,
._node_133wz_4._dueTomorrow_133wz_55 {
  background:
    radial-gradient(
      ellipse at center,
      var(--node-color) 0%,
      var(--node-color) 20%,
      color-mix(in srgb, var(--deadline-color) 70%, var(--node-color)) 46%,
      var(--deadline-color) 72%,
      var(--deadline-color) 100%
    );
}

._node_133wz_4._overdue_133wz_53 {
  --deadline-color: #ff0040;
  animation: _deadlinePulse_133wz_1 2.2s ease-in-out infinite;
}
._node_133wz_4._dueToday_133wz_54 {
  --deadline-color: #ff9500;
  animation: _deadlinePulseToday_133wz_1 3.2s ease-in-out infinite;
}
/* «Завтра» — бирюзовый и самый спокойный из трёх: ореол мягче, ритм ещё
   медленнее. Это напоминание, а не тревога. */
._node_133wz_4._dueTomorrow_133wz_55 {
  --deadline-color: #00c8d7;
  animation: _deadlinePulseTomorrow_133wz_1 4.4s ease-in-out infinite;
}

/* Выделенный блок сохраняет акцентное кольцо, ореол уходит наружу */
._node_133wz_4._selected_133wz_40._overdue_133wz_53,
._node_133wz_4._selected_133wz_40._dueToday_133wz_54,
._node_133wz_4._selected_133wz_40._dueTomorrow_133wz_55 {
  animation: none;
  box-shadow:
    var(--shadow-node),
    0 0 0 3px var(--accent),
    0 0 24px 7px color-mix(in srgb, var(--deadline-color) 60%, transparent);
}

@keyframes _deadlinePulse_133wz_1 {
  0%, 100% { box-shadow: var(--shadow-node), 0 0 12px 2px rgba(255, 0, 64, 0.45); }
  50%      { box-shadow: var(--shadow-node), 0 0 20px 5px rgba(255, 0, 64, 0.7); }
}

@keyframes _deadlinePulseToday_133wz_1 {
  0%, 100% { box-shadow: var(--shadow-node), 0 0 12px 2px rgba(255, 149, 0, 0.4); }
  50%      { box-shadow: var(--shadow-node), 0 0 18px 4px rgba(255, 149, 0, 0.62); }
}

@keyframes _deadlinePulseTomorrow_133wz_1 {
  0%, 100% { box-shadow: var(--shadow-node), 0 0 10px 2px rgba(0, 200, 215, 0.32); }
  50%      { box-shadow: var(--shadow-node), 0 0 16px 4px rgba(0, 200, 215, 0.5); }
}

/* Системная настройка «уменьшить движение»: ореол остаётся, мигание — нет */
@media (prefers-reduced-motion: reduce) {
  ._node_133wz_4._overdue_133wz_53,
  ._node_133wz_4._dueToday_133wz_54,
  ._node_133wz_4._dueTomorrow_133wz_55 {
    animation: none;
    box-shadow:
      var(--shadow-node),
      0 0 22px 6px color-mix(in srgb, var(--deadline-color) 60%, transparent);
  }
}

._nodeInner_133wz_120 {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  padding: 12% 14%;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
}

._nodeLabel_133wz_135 {
  color: var(--node-text, #16171c);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Свёрнутая ветка: стопка ──────────────────────────────────
   За блоком проступают два слоя его же цвета — как стопка карточек. Сразу
   видно, что блок «толстый»: внутри спрятана ветка, а не просто счётчик в
   углу. Слои рисуются псевдоэлементами (лишних узлов в DOM не появляется)
   и проявляются той же анимацией, что и сворачивание. */
._node_133wz_4._collapsedStack_133wz_155::before,
._node_133wz_4._collapsedStack_133wz_155::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--node-color, #80cbc4);
  border: 1px solid rgba(0, 0, 0, 0.12);
  z-index: -1;
  animation: _stackIn_133wz_1 0.34s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
._node_133wz_4._collapsedStack_133wz_155::before {
  transform: translate(5%, 6%) scale(0.94);
  opacity: 0.55;
  animation-delay: 0.02s;
}
._node_133wz_4._collapsedStack_133wz_155::after {
  transform: translate(9.5%, 11.5%) scale(0.87);
  opacity: 0.3;
  animation-delay: 0.06s;
}

@keyframes _stackIn_133wz_1 {
  from { transform: translate(0, 0) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  ._node_133wz_4._collapsedStack_133wz_155::before,
  ._node_133wz_4._collapsedStack_133wz_155::after { animation: none; }
}

/* ── Badges — circles on card edge ── */
._voicePill_133wz_187,
._notePill_133wz_188,
._taskPill_133wz_189,
._collapsePill_133wz_190 {
  position: absolute;
  top: var(--badge-inset, -14px);
  width: var(--badge-size, 34px);
  height: var(--badge-size, 34px);
  border-radius: 50%;
  background: var(--pill-color, #c8dcdc);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
/* Три бейджа по углам скругления: голос слева сверху, заметка справа сверху,
   задачи справа снизу — чтобы не наезжали друг на друга, когда у блока есть
   всё сразу. */
._voicePill_133wz_187 { left: var(--badge-inset, -14px); }
._notePill_133wz_188 { right: var(--badge-inset, -14px); }
._taskPill_133wz_189 {
  top: auto;
  bottom: var(--badge-inset, -14px);
  right: var(--badge-inset, -14px);
}

/* Иконка бейджа: форму задаёт сам файл иконки (маска по его альфе), а цвет
   приходит инлайном из Node.jsx — свой под каждый цвет блока. Картинки
   нарисованы белым, и на светлой подложке их просто не было видно. */
._pillIcon_133wz_218 {
  display: block;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* Свободный четвёртый угол — под сворачивание ветки. Это единственная
   кликабельная штука из четырёх, поэтому она крупнее остальных бейджей,
   с акцентным кольцом и подложкой блока: её видно как кнопку, а не как
   ещё один значок. */
._collapsePill_133wz_190 {
  top: auto;
  width: var(--collapse-size, 40px);
  height: var(--collapse-size, 40px);
  bottom: var(--collapse-inset, -18px);
  left: var(--collapse-inset, -18px);
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 2px solid color-mix(in srgb, var(--accent-ring, var(--accent)) 60%, var(--surface-1));
  box-shadow: var(--shadow-soft), 0 0 0 4px color-mix(in srgb, var(--surface-1) 65%, transparent);
  /* Выше точки соединения (z-index 20): она ходит за курсором по краю блока
     и, оказавшись сверху, съедала клик по кнопке. */
  z-index: 22;
  /* Раскрытая ветка: кнопка проявляется при наведении на блок. */
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.16s ease, border-color 0.16s ease;
  pointer-events: none;
}

._node_133wz_4:hover ._collapsePill_133wz_190,
._collapsePillOn_133wz_253 {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

/* Свёрнутая ветка: кнопка залита акцентным цветом самой ветки — это уже не
   «действие», а метка «здесь спрятано N блоков». */
._collapsePillOn_133wz_253 {
  background: color-mix(in srgb, var(--accent-ring, var(--accent)) 88%, var(--surface-1));
  border-color: color-mix(in srgb, var(--accent-ring, var(--accent)) 100%, transparent);
  color: #fff;
}

._collapsePill_133wz_190:hover {
  background: color-mix(in srgb, var(--accent-ring, var(--accent)) 16%, var(--surface-1));
  border-color: var(--accent-ring, var(--accent));
}
._collapsePillOn_133wz_253:hover {
  background: color-mix(in srgb, var(--accent-ring, var(--accent)) 100%, transparent);
}
._collapsePill_133wz_190:active {
  transform: scale(0.9);
}

._collapseCount_133wz_278 {
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* На тач-устройствах наведения нет вовсе — кнопка там видна всегда, иначе
   свернуть ветку с телефона было бы нечем. */
@media (hover: none) {
  ._collapsePill_133wz_190 {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
  }
}

@media (prefers-reduced-motion: reduce) {
  ._collapsePill_133wz_190 {
    transition: none;
  }
}

/* ── Inline rename input ─────────────────────────── */
._inlineRenameInput_133wz_302 {
  background: transparent;
  border: none;
  outline: none;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  color: inherit;
  text-align: center;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* ── Pending node floating UI ────────────────────── */
._pendingUI_133wz_317 {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  gap: 6px;
  pointer-events: all;
  z-index: 100;
}

._pendingAbove_133wz_327 {
  bottom: calc(100% + 8px);
}

._pendingBelow_133wz_331 {
  top: calc(100% + 8px);
}

._pendingBtn_133wz_335 {
  flex: 1;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-capsule);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: center;
  color: var(--text-primary);
  font-family: inherit;
}

._pendingBtnActive_133wz_350 {
  background: var(--surface-3);
  font-weight: 600;
}

._pendingBtnConfirm_133wz_355 {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}
