/* Экранная кисть и лазер — /task{N}/ и /variants/<slug>/task{N}/ */
.neuroege-screen-annotate {
  position: fixed;
  inset: 0;
  z-index: 10100;
  pointer-events: none;
}

/* Кисть / прямоугольник: холст поверх Python/HF (z-index до ~12k), панель — в шапке */
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush,
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect,
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select {
  z-index: 12200;
}

body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush .header.header--task-hf,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush .header.header--task-unified,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush .variant-exam__topbar,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect .header.header--task-hf,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect .header.header--task-unified,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect .variant-exam__topbar,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select .header.header--task-hf,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select .header.header--task-unified,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select .variant-exam__topbar {
  z-index: 12210;
}

/* Холст не перехватывает мышь: штрих ловит JS, кнопки панелей получают клик */
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush .neuroege-screen-annotate__canvas,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect .neuroege-screen-annotate__canvas,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select .neuroege-screen-annotate__canvas {
  pointer-events: none;
}

body.neuroege-screen-annotate--mode-brush,
body.neuroege-screen-annotate--mode-brush * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M1.2 30.2 8 23.4 20.2 11.2 24.6 15.6 12.4 27.8Z' fill='%23ff3b3b' stroke='%23ffffff' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M1.2 30.2 5.4 26 4.2 24.8Z' fill='%23111827'/%3E%3C/svg%3E")
      1 30,
    crosshair !important;
}

body.neuroege-screen-annotate--mode-brush-theme,
body.neuroege-screen-annotate--mode-brush-theme * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M1.2 30.2 8 23.4 20.2 11.2 24.6 15.6 12.4 27.8Z' fill='%23facc15' stroke='%23111827' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M1.2 30.2 5.4 26 4.2 24.8Z' fill='%23111827'/%3E%3C/svg%3E")
      1 30,
    crosshair !important;
}

[data-theme="light"] body.neuroege-screen-annotate--mode-brush-theme,
[data-theme="light"] body.neuroege-screen-annotate--mode-brush-theme * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M1.2 30.2 8 23.4 20.2 11.2 24.6 15.6 12.4 27.8Z' fill='%232563eb' stroke='%23ffffff' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M1.2 30.2 5.4 26 4.2 24.8Z' fill='%23111827'/%3E%3C/svg%3E")
      1 30,
    crosshair !important;
}

body.neuroege-screen-annotate--mode-rect,
body.neuroege-screen-annotate--mode-rect * {
  cursor: crosshair !important;
}

body.neuroege-screen-annotate--mode-fill,
body.neuroege-screen-annotate--mode-fill * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Crect x='5' y='7' width='16' height='12' rx='1' fill='%23ff3b3b' fill-opacity='0.35' stroke='%23ff3b3b' stroke-width='2'/%3E%3C/svg%3E")
      8 10,
    crosshair !important;
}

body.neuroege-screen-annotate--mode-bucket,
body.neuroege-screen-annotate--mode-bucket * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg transform='rotate(34 16 14)' fill='none' stroke='%23111827' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='%23fff' stroke-width='2.4' d='M11.2 10.6c.5-4.6 8.4-5 9.5-.3'/%3E%3Cpath stroke-width='1.5' d='M11.2 10.6c.5-4.6 8.4-5 9.5-.3'/%3E%3Cpath fill='%23e8eaed' stroke-width='1.4' d='M9 12h14l-2 9.6H11z'/%3E%3Cellipse cx='16' cy='12' rx='7' ry='2' fill='%23f8f9fb' stroke-width='1.4'/%3E%3C/g%3E%3Cpath fill='%23ff3b3b' stroke='%23fff' stroke-width='0.7' d='M7.2 19.2c-.2 2.1-2.4 3-2.4 5.2 0 1.4 1.2 2.3 2.4 2.2 1.4-.1 2.2-1.5 2.1-3-.2-1.8-1.5-2.6-2.1-4.4z'/%3E%3C/svg%3E")
      6 28,
    crosshair !important;
}

body.neuroege-screen-annotate--mode-circle,
body.neuroege-screen-annotate--mode-circle * {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='8' fill='%23facc15' fill-opacity='0.4' stroke='%23eab308' stroke-width='2'/%3E%3C/svg%3E")
      14 14,
    crosshair !important;
}

body.neuroege-screen-annotate--mode-select,
body.neuroege-screen-annotate--mode-select * {
  cursor: crosshair !important;
}

body.neuroege-screen-annotate--mode-laser,
body.neuroege-screen-annotate--mode-laser * {
  cursor: none !important;
}

body.neuroege-screen-annotate--mode-navigate,
body.neuroege-screen-annotate--mode-navigate * {
  cursor: default !important;
}

body[class*="neuroege-screen-annotate--mode-"] .neuroege-screen-annotate__toolbar,
body[class*="neuroege-screen-annotate--mode-"] .neuroege-screen-annotate__toolbar *,
body[class*="neuroege-screen-annotate--mode-"] .neuroege-screen-annotate__chrome,
body[class*="neuroege-screen-annotate--mode-"] .neuroege-screen-annotate__chrome * {
  cursor: pointer !important;
}

.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush
  .neuroege-screen-annotate__toolbar--floating,
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect
  .neuroege-screen-annotate__toolbar--floating,
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select
  .neuroege-screen-annotate__toolbar--floating,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-brush
  .neuroege-screen-annotate__toolbar--floating,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-rect
  .neuroege-screen-annotate__toolbar--floating,
body.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-select
  .neuroege-screen-annotate__toolbar--floating {
  z-index: 12220;
}

/* Панель в шапке: activator поверх страницы */
body.neuroege-screen-annotate--open .header.header--task-hf,
body.neuroege-screen-annotate--open .header.header--task-unified,
body.neuroege-screen-annotate--open .variant-exam__topbar {
  position: relative;
  z-index: 10105;
}

body.neuroege-screen-annotate--open .header.header--task-unified {
  /* fixed-хеадер остаётся fixed; только поднимаем слой над холстом */
  position: fixed;
  z-index: 10115;
}

/* Toolbar вынесен в #neuroege-screen-annotate — всегда выше холста кисти */
.neuroege-screen-annotate__toolbar--floating {
  position: fixed;
  z-index: 10120;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.96);
}

.neuroege-screen-annotate__toolbar--floating.neuroege-screen-annotate__toolbar--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.neuroege-screen-annotate__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.neuroege-screen-annotate--mode-brush .neuroege-screen-annotate__canvas,
.neuroege-screen-annotate--mode-brush-theme .neuroege-screen-annotate__canvas {
  z-index: 2;
  pointer-events: none;
}

.neuroege-screen-annotate--mode-rect .neuroege-screen-annotate__canvas,
.neuroege-screen-annotate--mode-select .neuroege-screen-annotate__canvas {
  z-index: 2;
  pointer-events: none;
  cursor: crosshair;
}

.neuroege-screen-annotate__tool--rect.neuroege-screen-annotate__tool--active {
  border-color: rgba(5, 184, 125, 0.55);
  background: rgba(5, 184, 125, 0.22);
  color: #ecfdf5;
}

html[data-palette="pink"] .neuroege-screen-annotate__tool--rect.neuroege-screen-annotate__tool--active {
  border-color: rgba(244, 114, 182, 0.55);
  background: rgba(244, 114, 182, 0.22);
  color: #fdf2f8;
}

[data-theme="light"] .neuroege-screen-annotate__tool--rect.neuroege-screen-annotate__tool--active {
  color: #047857;
}

html[data-palette="pink"][data-theme="light"]
  .neuroege-screen-annotate__tool--rect.neuroege-screen-annotate__tool--active {
  color: #be185d;
  background: rgba(251, 207, 232, 0.85);
  border-color: rgba(236, 72, 153, 0.45);
}

.neuroege-screen-annotate__laser {
  position: fixed;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow:
    0 0 8px #ff3b3b,
    0 0 18px rgba(255, 59, 59, 0.75),
    0 0 32px rgba(255, 59, 59, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease;
  z-index: 10101;
}

.neuroege-screen-annotate--mode-laser .neuroege-screen-annotate__laser {
  opacity: 1;
  visibility: visible;
}

/* Навигация: рисунок на холсте остаётся, клики проходят на страницу */
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-navigate .neuroege-screen-annotate__canvas,
.neuroege-screen-annotate--open.neuroege-screen-annotate--mode-laser .neuroege-screen-annotate__canvas {
  pointer-events: none;
}

.neuroege-screen-annotate__tool--navigate.neuroege-screen-annotate__tool--active {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.22);
  color: #dbeafe;
}

[data-theme="light"] .neuroege-screen-annotate__tool--navigate.neuroege-screen-annotate__tool--active {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.95);
  border-color: rgba(59, 130, 246, 0.45);
}

main.task-solve-main {
  position: relative;
}

.neuroege-screen-annotate__chrome {
  position: fixed;
  z-index: 3;
  min-width: 2.5rem;
  min-height: 2.5rem;
  pointer-events: none;
}

/* Сегмент «Рисование» в .hf-header-util-toggle (рядом с темой) */
.neuroege-screen-annotate__chrome--header {
  position: relative;
  z-index: 120;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: stretch;
}

.neuroege-screen-annotate__chrome--header .neuroege-screen-annotate__toolbar {
  top: calc(100% + 0.35rem);
  bottom: auto;
  right: 0;
  z-index: 121;
}

/* /ege-{n}/{slug}/ и /oge-{n}/{slug}/: ✎ вплотную к «Тренажёр», панель раскрывается влево */
.neuroege-screen-annotate__chrome--inline-toolbar {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  max-width: none;
}

.neuroege-screen-annotate__chrome--inline-toolbar .neuroege-screen-annotate__toolbar {
  position: absolute;
  top: 50%;
  right: calc(100% + 0.28rem);
  bottom: auto;
  left: auto;
  flex: none;
  min-width: 0;
  padding: 0.1rem 0.12rem;
  gap: 0;
  transform: translateY(-50%) scale(0.96);
  transform-origin: right center;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 0 16px rgba(5, 184, 125, 0.18);
}

.neuroege-screen-annotate__chrome--inline-toolbar.neuroege-screen-annotate__chrome--open
  .neuroege-screen-annotate__toolbar {
  transform: translateY(-50%) scale(1);
}

.neuroege-screen-annotate__chrome--inline-toolbar.neuroege-screen-annotate__chrome--open
  .neuroege-screen-annotate__activator {
  display: inline-flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .hf-task-unified__mode:has(.hf-task-unified__annotate-slot--trainer) {
  gap: 0;
  overflow: visible;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .hf-header-screen-annotate-slot.hf-task-unified__annotate-slot--trainer {
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0 0.85rem 0 0;
  overflow: visible;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .hf-task-unified__annotate-slot--trainer
  .neuroege-screen-annotate__chrome--inline-toolbar.hf-task-mode-switch {
  gap: 0.35rem;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__switch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  color: #34d399;
  filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.45));
}

body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__switch-icon svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__switch-icon {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__chrome--open
  .neuroege-screen-annotate__switch-icon {
  color: #34d399;
}

html[data-palette="pink"]
  body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__chrome--open
  .neuroege-screen-annotate__switch-icon {
  color: #f472b6;
}

html[data-palette="pink"]
  body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__switch-icon {
  color: #f472b6;
  filter: drop-shadow(0 1px 2px rgba(244, 114, 182, 0.5));
}

[data-theme="light"]
  body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__switch-icon {
  color: #059669;
  filter: none;
}

html[data-palette="pink"][data-theme="light"]
  body:not(.task-mobile-mode)
  .header--task-unified
  .neuroege-screen-annotate__switch-icon {
  color: #db2777;
  filter: none;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .hf-task-unified__annotate-slot--trainer
  .neuroege-screen-annotate__chrome--inline-toolbar
  .neuroege-screen-annotate__activator {
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  transform: none;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .hf-task-unified__annotate-slot--trainer
  .neuroege-screen-annotate__chrome--inline-toolbar
  .neuroege-screen-annotate__activator:hover,
body:not(.task-mobile-mode)
  .header--task-unified
  .hf-task-unified__annotate-slot--trainer
  .neuroege-screen-annotate__chrome--inline-toolbar.neuroege-screen-annotate__chrome--open
  .neuroege-screen-annotate__activator {
  border: none;
  background: transparent;
  box-shadow: none;
  transform: none;
}

body:not(.task-mobile-mode)
  .header--task-unified
  .hf-task-unified__annotate-slot--trainer
  .neuroege-screen-annotate__chrome--inline-toolbar
  .neuroege-screen-annotate__tool {
  width: 1.55rem;
  height: 1.55rem;
}

.hf-header-util-toggle .neuroege-screen-annotate__chrome--header .neuroege-screen-annotate__activator {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 9px 0 0 9px;
  background: transparent;
  color: #ecfdf5;
  box-shadow: none;
}

.hf-header-util-toggle .neuroege-screen-annotate__chrome--header .neuroege-screen-annotate__activator:hover {
  background: rgba(5, 184, 125, 0.1);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

[data-theme="light"] .hf-header-util-toggle .neuroege-screen-annotate__chrome--header .neuroege-screen-annotate__activator {
  color: #047857;
}

[data-theme="light"] .hf-header-util-toggle .neuroege-screen-annotate__chrome--header .neuroege-screen-annotate__activator:hover {
  background: rgba(245, 252, 249, 0.98);
}

.hf-header-util-toggle .neuroege-screen-annotate__chrome--header.neuroege-screen-annotate__chrome--open .neuroege-screen-annotate__activator {
  background: rgba(5, 184, 125, 0.22);
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: none;
}

[data-theme="light"] .hf-header-util-toggle .neuroege-screen-annotate__chrome--header.neuroege-screen-annotate__chrome--open .neuroege-screen-annotate__activator {
  background: rgba(5, 184, 125, 0.14);
}

.neuroege-screen-annotate__chrome > * {
  pointer-events: auto;
}

.neuroege-screen-annotate__activator {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid rgba(5, 184, 125, 0.65);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(48, 54, 66, 0.98) 0%, rgba(32, 38, 48, 0.98) 100%);
  color: #ecfdf5;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(5, 184, 125, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.18s ease,
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.neuroege-screen-annotate__activator-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.neuroege-screen-annotate__activator:hover {
  border-color: rgba(5, 184, 125, 0.75);
  box-shadow: 0 4px 16px rgba(5, 184, 125, 0.22);
  transform: translateY(-1px);
}

.neuroege-screen-annotate__activator:focus-visible {
  outline: 2px solid var(--green, #05b87d);
  outline-offset: 2px;
}

.neuroege-screen-annotate__chrome--open .neuroege-screen-annotate__activator {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.92);
}

/* В шапке activator остаётся видимым — панель инструментов выпадает рядом */
.neuroege-screen-annotate__chrome--header.neuroege-screen-annotate__chrome--open
  .neuroege-screen-annotate__activator {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.neuroege-screen-annotate__palette {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0 0.06rem;
}

.neuroege-screen-annotate__swatch {
  width: 0.95rem;
  height: 0.95rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--swatch, #ff3b3b);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.neuroege-screen-annotate__swatch--active {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.neuroege-screen-annotate__toolbar {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.12rem 0.16rem;
  border-radius: 999px;
  border: 2px solid rgba(5, 184, 125, 0.5);
  background: linear-gradient(
    165deg,
    rgba(18, 24, 30, 0.96) 0%,
    rgba(12, 16, 22, 0.98) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(5, 184, 125, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.94);
  transition:
    opacity 0.24s ease,
    transform 0.24s cubic-bezier(0.34, 1.25, 0.64, 1),
    visibility 0.24s ease;
}

.neuroege-screen-annotate__chrome--open .neuroege-screen-annotate__toolbar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.neuroege-screen-annotate__tool {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
}

.neuroege-screen-annotate__tool:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.neuroege-screen-annotate__tool:focus-visible {
  outline: 2px solid var(--green, #05b87d);
  outline-offset: 1px;
}

.neuroege-screen-annotate__tool--active {
  border-color: rgba(5, 184, 125, 0.55);
  background: rgba(5, 184, 125, 0.22);
  color: #ecfdf5;
}

.neuroege-screen-annotate__tool--laser.neuroege-screen-annotate__tool--active {
  border-color: rgba(255, 59, 59, 0.55);
  background: rgba(255, 59, 59, 0.2);
  color: #ffe4e6;
}

.neuroege-screen-annotate__tool--brush-theme .neuroege-screen-annotate__activator-icon {
  color: #facc15;
}

[data-theme="light"] .neuroege-screen-annotate__tool--brush-theme .neuroege-screen-annotate__activator-icon {
  color: #2563eb;
}

.neuroege-screen-annotate__tool--brush-theme.neuroege-screen-annotate__tool--active {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(250, 204, 21, 0.18);
  color: #fef9c3;
}

[data-theme="light"] .neuroege-screen-annotate__tool--brush-theme.neuroege-screen-annotate__tool--active {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.14);
  color: #dbeafe;
}

.neuroege-screen-annotate__tool svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

.neuroege-screen-annotate__tool--navigate {
  width: 1.95rem;
  height: 1.95rem;
}

.neuroege-screen-annotate__tool--navigate svg {
  width: 1.45rem;
  height: 1.45rem;
}

.neuroege-screen-annotate__sep {
  flex: 0 0 1px;
  align-self: center;
  width: 1px;
  height: 1.25rem;
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="light"] .neuroege-screen-annotate__activator {
  border-color: rgba(5, 150, 105, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  color: #047857;
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.12),
    0 0 16px rgba(5, 184, 125, 0.15);
}

[data-theme="light"] .neuroege-screen-annotate__toolbar {
  border-color: rgba(5, 150, 105, 0.28);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .neuroege-screen-annotate__tool {
  color: #334155;
}

[data-theme="light"] .neuroege-screen-annotate__tool:hover {
  background: rgba(5, 184, 125, 0.1);
}

[data-theme="light"] .neuroege-screen-annotate__tool--active {
  color: #047857;
}

[data-theme="light"] .neuroege-screen-annotate__tool--laser.neuroege-screen-annotate__tool--active {
  color: #b91c1c;
  background: rgba(254, 202, 202, 0.65);
  border-color: rgba(239, 68, 68, 0.45);
}

[data-theme="light"] .neuroege-screen-annotate__sep {
  background: rgba(0, 0, 0, 0.1);
}

/* Логотип в компактном сайдбаре (circle-logo-*) не должен уходить под полноэкранный холст */
body.neuroege-screen-annotate--open .task-sidebar,
body.neuroege-screen-annotate--open #task-sidebar,
body.neuroege-screen-annotate--open .variant-exam__sidebar {
  z-index: 12215;
}

/* /ege-{n}/{slug}/ mobile: task_mobile фиксирует шапку на z-index 880 — ниже оверлея кисти */
body.task-mobile-mode.neuroege-screen-annotate--open .header.header--task-unified {
  z-index: 12210 !important;
}
