/* «Определения» (14.09.2026): подчёркнутые термины, кнопка «📖 Термины» справа внизу, список терминов
   страницы, квадратик с ползунком в полосе .sqm-strip. Скрипт - static/js/glossary.js */
a.gl-term {
  color: inherit; text-decoration: underline dotted; text-decoration-color: #8b5cf6;
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: help;
  border-radius: 3px; transition: background .15s;
}
a.gl-term:hover, a.gl-term:focus-visible { background: #f3e8ff; text-decoration-style: solid; }

.gl-fab {
  position: fixed; right: 14px; bottom: 76px; z-index: 900;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; border: 1px solid #7c3aed;
  background: #7c3aed; color: #fff; font: inherit; font-size: 13px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.gl-fab:hover { background: #6d28d9; }
.gl-fab[hidden] { display: none !important; }
.gl-fab__icon { font-size: 15px; }
.gl-fab__n { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 18px; padding: 2px 5px; border-radius: 999px; background: rgba(255, 255, 255, .22); text-align: center; }
.gl-fab__n[hidden] { display: none; }
/* кнопка зарубок видна - встаём над ней */
body.marks-mode .gl-fab { bottom: 122px; }

.gl-panel {
  position: fixed; right: 14px; bottom: 122px; z-index: 955;
  width: min(330px, calc(100vw - 28px)); max-height: 60vh; overflow: auto;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #fff); color: var(--text, #18181b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16); font-size: 14px;
}
.gl-panel[hidden] { display: none !important; }
body.marks-mode .gl-panel { bottom: 168px; }
.gl-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gl-panel__x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-muted, #52525b); padding: 0 4px; }
.gl-panel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gl-panel__list a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--text, #18181b); text-decoration: none; line-height: 1.3; }
.gl-panel__list a:hover { background: #f3e8ff; }
.gl-panel__empty { margin: 4px 0 8px; color: var(--text-muted, #52525b); }
.gl-panel__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb); }
.gl-panel__foot a { color: #6d28d9; font-weight: 600; text-decoration: none; font-size: 13px; }
.gl-panel__off { font: inherit; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border, #e5e7eb); background: var(--bg-subtle, #fafafa); cursor: pointer; color: var(--text-muted, #52525b); }
.gl-panel__off:hover { color: #b91c1c; border-color: #fecaca; }

@media (max-width: 600px) {
  .gl-fab__label { display: none; }
  .gl-fab { padding: 10px 11px; bottom: 70px; }
  body.marks-mode .gl-fab { bottom: 118px; }
  .gl-panel { bottom: 118px; }
  body.marks-mode .gl-panel { bottom: 166px; }
}

/* квадратик «Определения» в полосе .sqm-strip */
.gl-w { position: relative; }
.gl-w__body { margin-top: 10px; padding: 14px 16px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; background: var(--bg, #fff); }
.gl-w__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.gl-w__text { font-size: 14px; line-height: 1.45; }
.gl-w__text p { margin: 0 0 8px; color: var(--text-muted, #52525b); }
.gl-w__demo { font-size: 13.5px; color: var(--text-muted, #52525b); padding-top: 8px; border-top: 1px dashed var(--border, #e5e7eb); }
.gl-w__demo a { color: inherit; text-decoration: underline dotted; text-decoration-color: #8b5cf6; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gl-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 8px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 999px; background: var(--bg-subtle, #fafafa); flex: 0 0 auto; position: relative; }
.gl-switch__chk { position: absolute; opacity: 0; width: 0; height: 0; }
.gl-switch__track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d4d4d8; transition: background .15s; }
.gl-switch__knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.gl-switch__chk:checked ~ .gl-switch__track { background: #7c3aed; }
.gl-switch__chk:checked ~ .gl-switch__track .gl-switch__knob { left: 21px; }
.gl-switch__chk:focus-visible ~ .gl-switch__track { outline: 2px solid #2563eb; outline-offset: 2px; }
.gl-switch__label { font-size: 13.5px; font-weight: 600; }
