/* Стили перенесены из drafts/mockup.html (визуальный референс от заказчика).
   Палитра — через переменные, тёмная тема по prefers-color-scheme. */

:root{
  --bg:#EEECE6;
  --surface:#FFFFFF;
  --surface-2:#F5F3EE;
  --ink:#1F2733;
  --ink-muted:#5D6673;
  --accent:#2F4A7A;          /* ультрамарин — единственный акцент */
  --accent-ink:#FFFFFF;
  --accent-soft:#E4EAF4;
  --highlight:#E7D6A8;       /* маркер выделения — выцветшая охра, «старая бумага» */
  --highlight-ink:#33280A;
  --line:#DEDAD0;
  --success:#2F4A7A;         /* прогресс и «сохранено» — тем же синим, без зелёного */
  --success-soft:#E4EAF4;
  --danger:#A83232;
  --veil:rgba(238,236,230,.68);  /* вуаль поверх фоновой фрески, цвет --bg */
  --radius-s:6px;
  --radius-m:10px;
  --radius-l:18px;
  --font-serif:'Lora',Georgia,'Times New Roman',serif;
  --font-sans:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#151A22; --surface:#1D232D; --surface-2:#232A35;
    --ink:#E6E8EC; --ink-muted:#9AA3B1;
    --accent:#8FAEE0; --accent-ink:#0F1B30; --accent-soft:#26334A;
    --highlight:#B89E5A; --highlight-ink:#1E1704;
    --line:#333B48; --success:#8FAEE0; --success-soft:#26334A;
    --danger:#E58A8A;
    --veil:rgba(21,26,34,.78);
  }
}

*{box-sizing:border-box;}
html{color-scheme:light dark;}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-sans);
  font-size:14px;
  padding-left:16px; padding-right:16px;
}
/* Фон — «Афинская школа» Рафаэля под вуалью цвета фона. Отдельный
   фиксированный слой, а не background-attachment:fixed: тот на мобильных
   браузерах не работает. Кадр закреплён чуть выше центра, чтобы в любом
   окне оставались арка и центральная группа. */
body::before{
  content:""; position:fixed; inset:0; z-index:-1;
  background:
    linear-gradient(var(--veil), var(--veil)),
    url("bg-school-of-athens.3c9f22796a98.webp") center 38% / cover no-repeat var(--bg);
}
.page{ max-width:1180px; margin:0 auto; padding-block:24px 48px; }

/* ---------- шапка ---------- */
.topbar{
  display:flex; align-items:center; justify-content:flex-end;
  margin-bottom:18px; font-size:13px; color:var(--ink-muted);
}
/* Подложка под именем и ссылками — иначе они тонут в фреске на фоне. */
.topbar-pill{
  display:inline-flex; align-items:center; gap:5px; flex-wrap:wrap; justify-content:flex-end;
  padding:6px 14px; border-radius:999px;
  background:color-mix(in srgb, var(--surface) 85%, transparent);
  border:1px solid var(--line);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
}
.topbar form{ display:inline; }
/* ФИО — ссылка на анкету (она же «личный кабинет»); без подчёркивания,
   чтобы читалось как имя, подчёркивание — при наведении. */
.topbar-user{ color:var(--ink); font-weight:600; text-decoration:none; }
.topbar-user:hover{ text-decoration:underline; }
.link-btn{
  background:none; border:none; padding:0; font:inherit; color:var(--ink-muted);
  cursor:pointer; text-decoration:underline;
}

/* ---------- общие элементы ---------- */
.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-l); overflow:hidden;
  box-shadow:0 12px 32px rgba(30,36,48,.10);  /* отрыв от фрески на фоне */
}
.btn{
  font-family:var(--font-sans); font-weight:600; font-size:14px; line-height:20px;
  padding:11px 20px; border-radius:var(--radius-s); border:1px solid transparent;
  cursor:pointer;
  /* Часть кнопок — ссылки (<a class="btn">): гасим подчёркивание и выравниваем
     их по тем же габаритам, что и <button>. */
  text-decoration:none; display:inline-block; text-align:center;
}
.btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.btn-primary{ background:var(--accent); color:var(--accent-ink); }
.btn-primary:disabled{ opacity:.4; cursor:not-allowed; }
.btn-ghost{ background:transparent; color:var(--ink); border-color:var(--line); }
.btn-ghost:hover{ background:var(--surface-2); }

/* Прогресс по квоте (templates/annotator/_progress.html): кружки при
   квоте до PROGRESS_DOTS_MAX, полоса — при большей. */
.dots{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.dot{ width:8px; height:8px; border-radius:50%; background:var(--line); }
.dot.done{ background:var(--success); }
.dot.now{ background:var(--ink); width:10px; height:10px; }
.progress-bar{
  position:relative; flex:1; min-width:120px; max-width:280px; height:6px;
  border-radius:999px; background:var(--line); overflow:hidden;
}
.progress-bar-done{
  position:absolute; left:0; top:0; height:100%; border-radius:999px;
  background:var(--success);
}

.messages{ list-style:none; padding:0; margin:0 0 16px; }
.messages li{
  padding:10px 14px; border-radius:var(--radius-s); font-size:13.5px; font-weight:500;
  background:var(--accent-soft); color:var(--accent);
}
.messages li.error{ color:var(--danger); }

/* ================= стартовая ================= */
.start-card{ padding:clamp(24px,4vw,44px); }
.start-grid{ display:grid; grid-template-columns: 1fr 1.3fr; gap:36px; }
.profile-box{
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--radius-m); padding:20px;
}
.profile-box .name{ font-family:var(--font-serif); font-size:19px; font-weight:600; }
.profile-box .meta{ font-size:13px; color:var(--ink-muted); margin-top:4px; line-height:1.5; }
.progress-line{ display:flex; align-items:center; gap:10px; margin-top:16px; }
.progress-count{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; font-size:14px; }
.start-title{ font-family:var(--font-serif); font-size:28px; font-weight:600; text-wrap:balance; margin:0 0 10px; }
.start-lede{ color:var(--ink-muted); font-size:15px; line-height:1.6; margin:0 0 20px; }
.instr{ list-style:none; padding:0; margin:0 0 26px; display:grid; gap:10px; }
.instr li{ display:flex; gap:10px; font-size:14px; line-height:1.55; }
.instr .n{
  font-family:var(--font-mono); font-size:11.5px; color:var(--accent);
  background:var(--accent-soft); border-radius:50%; width:20px; height:20px;
  display:flex; align-items:center; justify-content:center; flex:none; margin-top:1px;
}
@media (max-width:760px){ .start-grid{ grid-template-columns:1fr; } }

/* ================= финал / логин ================= */
.center-card{ padding:clamp(28px,5vw,56px); text-align:center; max-width:560px; margin:0 auto; }
.center-card h1{ font-family:var(--font-serif); font-size:26px; margin:0 0 12px; }
.center-card p{ color:var(--ink-muted); line-height:1.6; }

.login-card{ padding:clamp(24px,4vw,40px); max-width:420px; margin:48px auto 0; }
.login-card h1{ font-family:var(--font-serif); font-size:22px; margin:0 0 18px; }
.field{ display:grid; gap:6px; margin-bottom:14px; }
.field label{ font-size:12.5px; font-weight:600; color:var(--ink-muted); }
.field input{
  font:inherit; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-s);
  background:var(--surface); color:var(--ink);
}
.form-error{ color:var(--danger); font-size:13px; margin-bottom:12px; }

/* ================= анкета ================= */
.profile-card{ max-width:520px; }
.profile-card .start-lede{ font-size:14px; margin-bottom:22px; }
.field.has-error input{ border-color:var(--danger); }
.field-error{ color:var(--danger); font-size:12.5px; }
.topbar-pill a{ color:inherit; }


/* ================= разметка ================= */
/* Десктоп: карточка занимает всё окно, прокручиваются только две колонки
   внутри неё — страница целиком не листается, «Далее» всегда на экране.
   Мобильный (≤760px): обычный поток без вложенных скроллов, кнопки в
   конце, плавающая кнопка «к тексту / к критериям». */
.annotate-page{ height:100dvh; overflow:hidden; }
.annotate-page .page{
  height:100%; display:flex; flex-direction:column;
  padding-block:16px;
}
.annotate-page .topbar,
.annotate-page .messages{ flex:none; }
.annotate-form{ flex:1; min-height:0; display:flex; }
.annotate-card{ flex:1; min-height:0; display:flex; flex-direction:column; }

/* Шапка карточки: прогресс слева, статус сохранения и подсказка о
   незаполненных — справа. Имя и навигация — в строке над карточкой (base). */
.annotate-header{
  flex:none; padding:10px 22px; border-bottom:1px solid var(--line); background:var(--surface);
  display:flex; align-items:center; justify-content:space-between; gap:12px 20px; flex-wrap:wrap;
}
.annotate-progress{ display:flex; align-items:center; gap:12px; }
.annotate-progress .count{ font-family:var(--font-mono); font-size:13px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.header-notes{ display:flex; align-items:center; gap:14px; font-size:12.5px; }

.annotate-body{
  flex:1; min-height:0;
  display:grid; grid-template-columns:1fr 1.1fr;  /* критериям чуть шире, чтобы названия шли в одну строку */
}
.pane{ overflow-y:auto; min-height:0; padding:22px clamp(16px,3vw,30px); }
.reading-pane{ background:var(--surface); border-right:1px solid var(--line); }
/* Колонка критериев — flex-столбец: кнопки «Назад/Далее» в конце, и если
   содержимое короче колонки, прижимаются к её низу (margin-top:auto). */
.criteria-pane{ background:var(--surface-2); padding-top:0; padding-bottom:16px; display:flex; flex-direction:column; }
.criteria-pane > *{ flex:none; }

.eyebrow{
  font-size:11.5px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--ink-muted); margin-bottom:8px;
}
.question-text{
  font-family:var(--font-serif); font-size:17px; line-height:1.55; font-weight:600;
  margin:0 0 22px; text-wrap:balance; white-space:pre-line;
}
.answer-text{
  font-family:var(--font-serif); font-size:15.5px; line-height:1.75; color:var(--ink);
  white-space:pre-line; margin:0;
}

/* Критерии. Две компоновки (settings.CRITERIA_LAYOUT → класс на колонке):
   .layout-matrix  — таблица: подписи шкалы один раз в шапке, в строках
                     кружки; строка с иной шкалой (.labeled) — кнопками;
   .layout-stacked — под каждым критерием подписанные кнопки, шапки нет.
   На узком экране (ниже, в @media) обе схлопываются в stacked. */
.scale-header{
  display:grid; grid-template-columns:1fr repeat(var(--n), 58px);
  position:sticky; top:0; z-index:2; background:var(--surface-2);
  padding:9px 0 4px; margin-bottom:2px; border-bottom:1px solid var(--line);
  font-size:11.5px; font-weight:600; color:var(--ink-muted); text-align:center;
}
.criterion{
  display:grid; grid-template-columns:1fr auto; align-items:center;
  padding:4px 0; border-bottom:1px solid var(--line);
}
/* перед итоговым — одна толстая линия, а не две */
.criterion:has(+ .criterion.final){ border-bottom:none; }
.criterion-head{ display:flex; align-items:flex-start; gap:8px; padding-right:8px; }
.crit-num{ font-family:var(--font-mono); font-size:12px; color:var(--accent); margin-top:2px; }
.crit-title{ flex:1; font-size:13.5px; font-weight:600; line-height:1.4; }

/* Кнопка «?» и пояснение. Попап — position:fixed, координаты выставляет
   JS (annotate.js): так его не режет край прокручиваемой колонки. */
.info-dot{
  margin-left:auto; flex:none;
  width:18px; height:18px; border-radius:50%; border:1px solid var(--line);
  background:var(--surface); color:var(--ink-muted); font-size:11px; font-weight:700;
  cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0;
}
.info-dot:hover, .info-dot[aria-expanded="true"]{
  border-color:var(--accent); color:var(--accent);
}
.info-dot:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.info-pop{
  position:fixed; z-index:30; width:270px; max-width:calc(100vw - 16px);
  background:var(--ink); color:var(--bg); font-size:12.5px; line-height:1.5;
  padding:12px 14px; border-radius:var(--radius-s);
  box-shadow:0 4px 14px rgba(0,0,0,.22);
}
.info-pop[hidden]{ display:none; }
.info-pop b{ color:var(--highlight); }

/* Кружки матрицы */
.scale{ display:flex; gap:0; flex-wrap:nowrap; }
.scale-opt{ flex:none; width:58px; display:flex; justify-content:center; position:relative; }
.scale-opt input{ position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.scale-opt span{
  width:18px; height:18px; border-radius:50%; font-size:0;
  border:1.5px solid var(--ink-muted); background:var(--surface);
  transition:border-color .12s, background .12s;
}
.scale-opt:hover span{ border-color:var(--accent); }
.scale-opt input:checked + span{
  background:var(--accent); border-color:var(--accent);
  box-shadow:inset 0 0 0 3px var(--surface);
}
.scale-opt input:focus-visible + span{ outline:2px solid var(--accent); outline-offset:2px; }

/* Подписанные кнопки — для строк с иной шкалой (.labeled) и для всей
   колонки в компоновке stacked */
.criterion.labeled,
.layout-stacked .criterion{ grid-template-columns:1fr; }
.criterion.labeled .scale,
.layout-stacked .scale{ gap:8px; flex-wrap:wrap; margin-top:8px; }
.criterion.labeled .scale-opt,
.layout-stacked .scale-opt{ flex:1; width:auto; min-width:88px; display:block; }
.criterion.labeled .scale-opt span,
.layout-stacked .scale-opt span{
  display:block; width:auto; height:auto; border-radius:var(--radius-s); font-size:13px; font-weight:500;
  line-height:18px; text-align:center; padding:9px 6px; border:1px solid var(--line); color:var(--ink-muted);
}
.criterion.labeled .scale-opt:hover span,
.layout-stacked .scale-opt:hover span{ border-color:var(--ink-muted); color:var(--ink); }
.criterion.labeled .scale-opt input:checked + span,
.layout-stacked .scale-opt input:checked + span{
  background:var(--accent-soft); border-color:var(--accent); color:var(--accent); font-weight:600;
}
/* stacked: без шапки, строки просторнее и разделены воздухом, а не линиями */
.layout-stacked{ padding-top:18px; }
.layout-stacked .scale-header{ display:none; }
.layout-stacked .criterion{ padding:0 0 4px; margin-bottom:18px; border-bottom:none; }
.layout-stacked .criterion-head{ margin-bottom:2px; }
.layout-stacked .crit-title{ font-size:14.5px; }
.layout-stacked .criterion.final{
  margin-top:0; padding:14px 16px; border:1px solid var(--line); border-radius:var(--radius-m);
  background:var(--accent-soft);
}
.layout-stacked .criterion.final .crit-title{ font-size:15.5px; }

/* Полоса о состоянии текста: уже сдан, правится, есть неподтверждённая
   правка. Стоит над критериями — рядом с тем, о чём говорит. */
.mode-note{
  margin:0 0 14px; padding:9px 12px; border-radius:var(--radius-s);
  background:var(--surface); border:1px solid var(--line);
  font-size:13px; line-height:1.4; color:var(--ink-muted);
}
.mode-note.warn{ border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }

/* Закрытый вид: оценки видно, но они не кликаются — поменять их можно
   только через «Изменить оценки». Работает для обеих компоновок, потому
   что обе строятся на одних и тех же input[type=radio]. */
/* pointer-events:none обязателен: невидимый input растянут на всю ячейку, и
   пока он ловит указатель, disabled-поле просто глотает клик — а нам нужно
   его поймать, чтобы показать кнопку «Изменить». */
.criteria-pane.locked .scale-opt input{ cursor:default; pointer-events:none; }
.criteria-pane.locked .scale-opt{ cursor:default; }
.criteria-pane.locked .scale-opt input:not(:checked) + span{ opacity:.4; }
.criteria-pane.locked .scale-opt:hover span{ border-color:var(--ink-muted); }
.criteria-pane.locked .criterion.labeled .scale-opt:hover span,
.criteria-pane.locked .layout-stacked .scale-opt:hover span,
.layout-stacked.locked .scale-opt:hover span{ border-color:var(--line); color:var(--ink-muted); }
.criteria-pane.locked .comment-box{
  background:var(--surface-2); color:var(--ink-muted); cursor:default; resize:none;
}

/* Клик по закрытой оценке или по «Комментировать фрагмент»: подсвечиваем
   кнопку, которой правка открывается. Кнопка при этом на другом краю
   экрана, а смотрит эксперт туда, куда нажал, — поэтому не ровное свечение,
   а три вспышки с заливкой акцентом: движение заметно боковым зрением.
   Длительность подобрана так, чтобы две последние вспышки пришлись уже на
   время после прокрутки. */
.btn.pulse{ animation:btn-pulse 2.2s cubic-bezier(.4,0,.2,1); }
@keyframes btn-pulse{
  0%,100%{
    background:transparent; color:var(--ink);
    border-color:var(--line); box-shadow:0 0 0 0 var(--accent-soft);
  }
  10%,40%,70%{
    background:var(--accent); color:var(--accent-ink);
    border-color:var(--accent); box-shadow:0 0 0 8px var(--accent-soft);
  }
  25%,55%,85%{
    background:transparent; color:var(--ink);
    border-color:var(--accent); box-shadow:0 0 0 0 var(--accent-soft);
  }
}

/* Незаполненные критерии после нажатия «Далее»: красная вспышка на пару
   секунд (класс снимает JS). Красный здесь намеренно — это единственное
   место, где нужен резкий сигнал. */
.criterion.attention .crit-title{ animation:attention-title 2.4s ease-out; }
.criterion.attention .scale-opt span{ animation:attention-scale 2.4s ease-out; }
@keyframes attention-title{ 0%,60%{ color:var(--danger); } 100%{ color:inherit; } }
@keyframes attention-scale{
  0%,60%{ border-color:var(--danger); box-shadow:0 0 0 2px rgba(168,50,50,.18); }
  100%{ border-color:var(--ink-muted); box-shadow:none; }
}

.criterion.final{ margin-top:2px; padding:7px 0; border-top:2px solid var(--line); }
.criterion.final .crit-title{ font-family:var(--font-serif); font-size:14.5px; }

.comment-label{ display:block; font-size:12.5px; font-weight:600; color:var(--ink-muted); margin:10px 0 5px; }
.comment-box{
  width:100%; min-height:44px; resize:none; overflow:hidden; font-family:var(--font-sans); font-size:13.5px;
  padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-s);
  background:var(--surface); color:var(--ink);
}

/* Счётчик символов — виден только у предела (JS). */
.char-count{ font-size:11.5px; color:var(--ink-muted); text-align:right; margin-top:4px; }
.char-count.limit{ color:var(--danger); }
.char-count[hidden]{ display:none; }
.hl-panel .char-count{ color:inherit; opacity:.75; }

/* Кнопки — в конце колонки критериев, по центру */
.annotate-footer{
  margin-top:auto; padding-top:16px;
  display:flex; justify-content:center; gap:10px;
}
/* Узкая белая полоса под колонками — завершает карточку */
.annotate-bottom{ flex:none; height:14px; border-top:1px solid var(--line); background:var(--surface); }
.annotate-footer .btn{ padding:9px 18px; }
.validation-note{ color:var(--accent); font-weight:600; }
/* Та же вспышка, что у критериев: красный → обычный синий. */
.validation-note.attention{ animation:attention-note 2.4s ease-out; }
@keyframes attention-note{ 0%,60%{ color:var(--danger); } 100%{ color:var(--accent); } }
.validation-note:empty{ display:none; }
.autosave-status{ color:var(--ink-muted); }
.autosave-status.busy{ font-style:italic; }
.autosave-status.ok{ color:var(--success); }
.autosave-status.error{ color:var(--danger); font-weight:600; }

@media (max-width:760px){
  .annotate-page{ height:auto; overflow:visible; }
  .annotate-page .page{ display:block; height:auto; padding-block:16px 0; }
  .annotate-form{ display:block; }
  .annotate-card{ display:block; }
  .annotate-body{ display:block; }
  .pane{ overflow:visible; }
  .reading-pane{ border-right:none; border-bottom:1px solid var(--line); }
  /* Матрица на телефоне не помещается: шапку прячем, каждая строка —
     название и три подписанные кнопки под ним. */
  .scale-header{ display:none; }
  .criteria-pane{ padding-top:10px; }
  .criterion{ grid-template-columns:1fr; padding:12px 0; }
  .scale{ gap:8px; flex-wrap:wrap; margin-top:8px; }
  .scale-opt{ flex:1; width:auto; min-width:64px; display:block; }
  .scale-opt span{
    display:block; width:auto; height:auto; border-radius:var(--radius-s); font-size:13px; font-weight:500;
    line-height:18px; text-align:center; padding:9px 6px; border:1px solid var(--line); color:var(--ink-muted);
  }
  .scale-opt:hover span{ border-color:var(--ink-muted); color:var(--ink); }
  .scale-opt input:checked + span{
    background:var(--accent-soft); border-color:var(--accent); color:var(--accent); font-weight:600;
  }
  /* Футер — просто в конце потока, как у обычной формы: прилипший к низу
     он отъедал у телефона четверть экрана. */
  .criteria-pane{ display:block; }
  .annotate-footer{ padding-top:20px; }
  .annotate-bottom{ height:10px; }
  .annotate-footer .btn{ flex:1; }
  .header-notes{ width:100%; justify-content:space-between; }
}

/* Плавающая кнопка «к тексту / к критериям» — только на узком экране,
   где текст и критерии в одном потоке; показывает её JS. */
.jump-btn{
  position:fixed; right:16px; bottom:16px; z-index:25;
  font-family:var(--font-sans); font-size:12.5px; font-weight:600;
  background:var(--ink); color:var(--bg); padding:9px 14px; border-radius:999px; border:none;
  cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,.22);
}
.jump-btn[hidden]{ display:none; }

/* ================= выделения и комментарии к ним ================= */
/* На каждом выделении номер-сноска; клик по выделению открывает его
   комментарий. Полный список комментариев — сворачиваемый блок под
   текстом (.hl-list), по умолчанию свёрнут. */
.answer-text mark.hl{
  background:var(--highlight); color:var(--highlight-ink);
  border-radius:2px; padding:0 1px; cursor:pointer;
}
.answer-text mark.hl:hover{ filter:brightness(.95); }
.answer-text mark.hl[data-n]::after{
  content:"(" attr(data-n) ")";
  font-family:var(--font-sans); font-size:10px; font-weight:700; color:var(--highlight-ink);
  vertical-align:super; line-height:0; margin-left:2px; letter-spacing:-.02em;
}
.answer-text mark.hl.flash{ box-shadow:0 0 0 3px var(--accent); }
.answer-text mark.hl.draft{
  background:var(--accent-soft); color:inherit; cursor:default;
  box-shadow:inset 0 -2px 0 var(--highlight);
}
.hl-list{ margin-top:22px; border-top:1px solid var(--line); padding-top:10px; }
.hl-list summary{
  cursor:pointer; font-size:12.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-muted); list-style:none; display:flex; align-items:center; gap:8px;
}
.hl-list summary::-webkit-details-marker{ display:none; }
.hl-list summary::before{ content:"▸"; font-size:11px; transition:transform .15s; }
.hl-list[open] summary::before{ transform:rotate(90deg); }
.hl-list summary:hover{ color:var(--ink); }
.hl-items{ margin-top:12px; }
.hl-item{
  display:flex; gap:10px; align-items:flex-start; font-size:13px; line-height:1.5;
  padding:8px 10px; margin:0 -10px 4px; border-radius:var(--radius-s); cursor:pointer;
}
.hl-item:hover{ background:var(--surface-2); }
.hl-item .hl-n{
  flex:none; font-family:var(--font-sans); font-size:11px; font-weight:700; color:var(--accent);
  background:var(--accent-soft); border-radius:999px; min-width:20px; height:20px;
  display:inline-flex; align-items:center; justify-content:center; padding:0 6px; margin-top:1px;
}
.hl-item .hl-quote{ font-family:var(--font-serif); color:var(--ink-muted); }
.hl-item .hl-none{ color:var(--ink-muted); font-style:italic; }
.hl-empty{ font-size:13px; color:var(--ink-muted); font-style:italic; margin-top:10px; }

.sel-btn{
  position:fixed; z-index:40; font-family:var(--font-sans); font-size:12.5px; font-weight:600;
  background:var(--ink); color:var(--bg); padding:7px 12px; border-radius:999px; border:none;
  cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,.22);
}
.hl-panel{
  position:fixed; z-index:41; width:min(360px, calc(100vw - 16px));
  background:var(--ink); color:var(--bg); padding:10px; border-radius:10px;
  box-shadow:0 4px 14px rgba(0,0,0,.22);
}
.hl-panel-label{ font-size:11.5px; opacity:.75; margin-bottom:6px; }
.hl-panel textarea{
  width:100%; font-family:var(--font-sans); font-size:12.5px; border-radius:6px; border:none;
  padding:6px 8px; resize:none; overflow:hidden; color:var(--ink); background:var(--surface);
}
.hl-panel-actions{ margin-top:8px; display:flex; gap:8px; justify-content:flex-end; }
.hl-panel-btn{
  font-size:12px; background:transparent; color:inherit; border:1px solid rgba(255,255,255,.3);
  border-radius:6px; padding:5px 10px; cursor:pointer;
}
.hl-panel-btn.primary{ background:var(--highlight); color:var(--highlight-ink); border:none; font-weight:600; }
.hl-panel-btn.danger{ margin-right:auto; border-color:transparent; opacity:.8; }

.toast{
  position:fixed; left:50%; bottom:22px; transform:translate(-50%,12px);
  background:var(--ink); color:var(--bg); font-size:13px; font-weight:500;
  padding:10px 18px; border-radius:999px; opacity:0; pointer-events:none;
  transition:opacity .2s, transform .2s; z-index:60;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }
