/* GetCourse-style theme for the LMS. Design reference: live GC captures in
   lms/docs/wiki/_capture/01-lms-core/ (lesson constructor, student lesson view,
   training lesson tree). Existing utility class names (.card .btn .muted .wrap
   .hw-* .gallery .imgcmp ...) are kept so every template inheriting
   courses/base.html picks up the skin without markup changes. */

/* ------------------------------- fonts ---------------------------------- */
/* Montserrat variable font (400-700), self-hosted; latin + cyrillic subsets. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/montserrat-var-cyrillic.6fd02dd74afd.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/montserrat-var-latin.311d352d9323.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------- tokens ---------------------------------- */
:root {
  --gc-blue: #3D7ECC;
  --gc-blue-dark: #2D6FB8;
  --gc-green: #4DB44D;
  --gc-green-dark: #3E9C3E;
  --gc-red: #E14D43;
  --gc-red-dark: #C93E35;
  --gc-dark: #2B3A4C;
  --gc-dark-2: #22303F;
  --gc-grey-btn: #ECECEC;
  --gc-grey-btn-border: #D5D5D5;
  --gc-panel: #F5F5F5;
  --gc-border: #E5E5E5;
  --gc-text: #333333;
  --gc-muted: #8A8F98;
  --gc-radius: 3px;
  --gc-sidebar-w: 68px;
  --gc-font: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* -------------------------------- base ----------------------------------- */
body {
  font-family: var(--gc-font);
  margin: 0;
  color: var(--gc-text);
  background: #fff;
  font-size: 14px;
}
a { color: var(--gc-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; font-weight: 600; margin: 10px 0 16px; }
h2 { font-size: 21px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
.gc-h1-blue { color: var(--gc-blue); }
.wrap { max-width: 960px; margin: 0 auto; padding: 8px 24px 32px; }
.muted { color: var(--gc-muted); font-size: 13px; }

/* ------------------------------ GC chrome -------------------------------- */
/* Dark-navy vertical icon bar — the most recognizable GetCourse element.
   On narrow screens it flips into a horizontal top bar (same markup). */
.gc-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--gc-sidebar-w);
  background: var(--gc-dark);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 100;
  overflow: visible;            /* let the click-flyout escape the 68px bar */
}
.gc-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 2px 9px;
  color: #C7CDD4;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.gc-nav-item:hover { background: var(--gc-dark-2); color: #fff; text-decoration: none; }
.gc-nav-item .gc-i { width: 20px; height: 20px; }
.gc-nav-user {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin: 12px auto 4px;
  border-radius: 50%;
  background: var(--gc-blue);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex: 0 0 auto;
}
.gc-nav-spacer { flex: 1 1 auto; }
.gc-main { margin-left: var(--gc-sidebar-w); }

/* GetCourse-style flyout: click an icon-group → submenu slides out to the right.
   Built on native <details name="gcnav"> — exclusive accordion, no JS. */
.gc-nav-group { position: relative; }
.gc-nav-group > summary { list-style: none; }
.gc-nav-group > summary::-webkit-details-marker { display: none; }
.gc-nav-group[open] > summary { background: var(--gc-dark-2); color: #fff; }
.gc-nav-flyout {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 224px;
  background: #fff;
  border: 1px solid var(--gc-grey-btn-border);
  border-radius: var(--gc-radius);
  box-shadow: 0 3px 12px rgba(0,0,0,.16);
  z-index: 101;
  padding: 6px 0;
}
.gc-nav-group[open] > .gc-nav-flyout { display: block; }
.gc-nav-flyout-title {
  padding: 6px 16px 8px;
  color: var(--gc-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.gc-nav-sub {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 8px 16px;
  color: var(--gc-text);
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.gc-nav-sub:hover { background: #F2F6FB; color: var(--gc-text); text-decoration: none; }
.gc-logo {
  color: #C9CDD1;
  padding: 14px 24px 0;
  max-width: 960px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.gc-logo > a { color: inherit; font-size: 26px; font-weight: 600; }
.gc-logo a:hover { text-decoration: none; color: #9AA1A9; }
/* Debug «войти как …» panel — small muted buttons in the top-right of the content header. */
.gc-debug { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.gc-debug form { margin: 0; }
.gc-debug-btn {
  display: inline-block;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  color: #6B7280;
  background: var(--gc-panel, #F3F4F6);
  border: 1px solid var(--gc-border, #E5E7EB);
  border-radius: var(--gc-radius, 6px);
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
}
.gc-debug-btn:hover { color: #111827; border-color: #9CA3AF; text-decoration: none; }
.linkform { display: inline; margin: 0; }
.linkbtn {
  background: none; border: 0; padding: 0;
  color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}
@media (max-width: 900px) {
  .gc-sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
  }
  .gc-nav-item { width: auto; padding: 8px 10px; }
  .gc-nav-user { margin: 4px 8px; width: 30px; height: 30px; font-size: 13px; }
  .gc-nav-spacer { display: none; }
  .gc-main { margin-left: 0; }
  /* Horizontal bar: flyout drops down under its icon, not to the side. */
  .gc-nav-flyout { left: 0; top: 100%; }
}

/* Full-bleed helper: break out of .wrap, centered within .gc-main (i.e. the viewport
   MINUS the fixed sidebar — a plain 50%/-50% viewport hack would drift 34px right). */
.gc-bleed {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: calc(96vw - var(--gc-sidebar-w));
  max-width: 1480px;
}
@media (max-width: 900px) { .gc-bleed { width: 96vw; } }

/* Breadcrumbs + page head (H1 + right-aligned action buttons). */
.gc-crumbs { font-size: 12px; color: var(--gc-muted); margin: 10px 0 2px; }
.gc-crumbs a { color: var(--gc-blue); }
.gc-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.gc-page-head h1 { margin: 6px 0 12px; }
.gc-page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}

/* Grey lesson-title panel (centered), as in the GC lesson page. */
.gc-panel {
  background: var(--gc-panel);
  border-radius: var(--gc-radius);
  text-align: center;
  padding: 26px 20px 20px;
  margin: 12px 0 18px;
}
.gc-panel h1, .gc-panel .gc-panel-title { font-size: 26px; font-weight: 600; margin: 0; }
.gc-panel .muted { display: block; margin-top: 6px; }

/* Tab bar: active tab = grey chip, inactive = plain blue links. */
.gc-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--gc-border);
  padding-bottom: 8px;
  margin: 10px 0 16px;
  font-size: 14px;
}
.gc-tabs a, .gc-tabs span { padding: 5px 12px; border-radius: var(--gc-radius); }
.gc-tabs .active { background: var(--gc-grey-btn); color: var(--gc-text); font-weight: 600; }

/* ------------------------------- buttons --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gc-blue);
  color: #fff !important;
  padding: 7px 14px;
  border-radius: var(--gc-radius);
  margin: 4px 0;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--gc-blue-dark); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .gc-i { width: 14px; height: 14px; }
.btn-grey {
  background: var(--gc-grey-btn);
  border-color: var(--gc-grey-btn-border);
  color: var(--gc-text) !important;
}
.btn-grey:hover { background: #E2E2E2; }
.btn-green { background: var(--gc-green); }
.btn-green:hover { background: var(--gc-green-dark); }
.btn-red, .btn[style*="#b91c1c"] { background: var(--gc-red); }
.btn-red:hover { background: var(--gc-red-dark); }
/* «Кнопки» authored in the constructor (imported ones bring their own captured markup). */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.linkbtn {
  background: none; border: 0; color: inherit;
  font: inherit; font-weight: 600; cursor: pointer; padding: 0;
}
.linkbtn:hover { text-decoration: underline; }

/* "Действия ▾"-style dropdown built on <details> (no JS needed). */
.gc-dd { position: relative; display: inline-block; }
.gc-dd > summary { list-style: none; }
.gc-dd > summary::-webkit-details-marker { display: none; }
.gc-dd-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--gc-grey-btn-border);
  border-radius: var(--gc-radius);
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
  min-width: 230px;
  z-index: 50;
  padding: 4px 0;
}
/* пункт меню; настоящие .btn исключены — иначе сброс фона делает их белыми по белому */
.gc-dd-menu a, .gc-dd-menu button:not(.btn) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 8px 14px;
  color: var(--gc-text);
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.gc-dd-menu a:hover, .gc-dd-menu button:not(.btn):hover {
  background: #F2F6FB; text-decoration: none;
}
/* a form inside a dropdown (создание урока/тренинга, подтверждение удаления) */
.gc-create-form { padding: 12px 14px; min-width: 320px; }
.gc-create-form form { margin: 0; padding: 0; }
.gc-create-form input[type=text] { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.gc-create-form .btn { margin: 0; width: auto; display: inline-block; padding: 6px 14px; }
.gc-create-form p.muted { margin: 0 0 8px; font-size: 12px; }
.gc-create-mode { margin-bottom: 8px; }
.gc-create-mode label {
  display: block; font-size: 12px; padding: 3px 0; cursor: pointer; white-space: normal;
}
.gc-create-mode input { margin-right: 6px; }

/* ------------------------- cards, tags, messages ------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--gc-border);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 12px 0;
}
.hidden-tag {
  display: inline-block; background: #FDEBEA; color: var(--gc-red);
  border-radius: var(--gc-radius); padding: 1px 7px; font-size: 12px; margin-left: 6px;
}
.lock-tag {
  display: inline-block; background: #FEF3D8; color: #92640E;
  border-radius: var(--gc-radius); padding: 1px 7px; font-size: 12px; margin-left: 6px;
}
/* «Новый» — тренинги последнего реализованного офферa. Та же жёлтая пара, что у .lock-tag /
   .hw-rework / .msg-warning, но заметнее (bold + uppercase): это единственная метка, ради
   которой ученик должен задержать взгляд на списке. */
.new-tag {
  display: inline-block; background: #FEF3D8; color: #92640E;
  border-radius: var(--gc-radius); padding: 1px 7px; font-size: 11px; margin-left: 6px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
}
/* «Осталось N дней» — обратный отсчёт срока доступа. Жёлтая пара та же, что у .lock-tag /
   .new-tag; красная — та же, что у .hidden-tag. Бессрочный доступ не показывает НИЧЕГО. */
.exp-tag {
  display: inline-block; background: #FEF3D8; color: #92640E;
  border-radius: var(--gc-radius); padding: 1px 7px; font-size: 11px; margin-left: 6px;
  font-weight: 700; vertical-align: middle; white-space: nowrap;
}
.exp-tag--danger { background: #FDEBEA; color: var(--gc-red); }
.exp-tag .gc-i { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }

.exp-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; background: #FEF3D8; color: #92640E; border-left: 4px solid #E0A32E;
  border-radius: var(--gc-radius); padding: 12px 16px; margin: 12px 0;
}
.exp-banner--danger { background: #FDEBEA; color: #A8302A; border-left-color: var(--gc-red); }
.exp-banner-text b { display: block; font-size: 15px; }
.exp-banner-meta { font-size: 13px; opacity: .85; }
.exp-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.exp-strip {
  font-size: 13px; color: #92640E; background: #FEF3D8; border-radius: var(--gc-radius);
  padding: 5px 10px; margin-bottom: 10px; display: inline-block;
}
.exp-strip--danger { background: #FDEBEA; color: var(--gc-red); }
.exp-strip .gc-i { width: 12px; height: 12px; vertical-align: -2px; margin-right: 5px; }

/* Раздел «Управление уведомлениями»: карта каналов и карточки видов рассылок. */
.chan-tag {
  display: inline-block; border-radius: var(--gc-radius); padding: 1px 8px; font-size: 12px;
  margin-left: 6px; white-space: nowrap;
}
.chan-works { background: #DCFCE7; color: #166534; }
.chan-planned { background: var(--gc-panel); color: var(--gc-muted); }
.chan-off { background: #FDEBEA; color: var(--gc-red); }
.chan-legend { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.chan-item .chan-tag { margin-left: 0; margin-right: 8px; }
.gc-notice-head { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap;
  align-items: center; gap: 4px; }
.gc-notice-head::-webkit-details-marker { display: none; }
.gc-notice-title { font-weight: 700; margin-right: auto; }
.gc-notice-body { margin-top: 12px; }
.gc-notice-settings { background: var(--gc-panel); border-radius: var(--gc-radius);
  padding: 12px 14px; margin: 12px 0; }
.gc-notice-settings .gc-field { margin: 6px 0; }
.gc-notice-settings label { font-weight: 500; }
.gc-notice-where { font-size: 12px; margin-bottom: 0; }
.gc-notice-where code { background: var(--gc-panel); padding: 1px 5px; border-radius: 2px; }

.lesson-locked { color: #9CA3AF; }
.tree ul { list-style: none; padding-left: 18px; }
.tree li { margin: 6px 0; }
.tree > ul { padding-left: 0; }
.banner { background: #FDE68A; color: #92400E; padding: 8px 24px; font-size: 14px; }
.messages { max-width: 960px; margin: 8px auto 0; padding: 0 24px; box-sizing: border-box; }
.msg { padding: 8px 12px; border-radius: var(--gc-radius); margin: 6px 0; font-size: 14px; }
.msg-success { background: #DCFCE7; color: #166534; }
.msg-error { background: #FEE2E2; color: #B91C1C; }
.msg-warning { background: #FEF9C3; color: #854D0E; }
.msg-info { background: #E0F2FE; color: #075985; }
hr { border: 0; border-top: 1px solid var(--gc-border); margin: 24px 0; }
.filelist a { display: block; padding: 6px 0; }

/* Info bars — full-width banners at the top of the content column (height fits the text). */
.infobar { position: relative; padding: 10px 44px 10px 24px; font-size: 14px; line-height: 1.45; }
.infobar-text { word-wrap: break-word; }
.infobar-text a { color: inherit; text-decoration: underline; }
.infobar-x {
  position: absolute; top: 8px; right: 12px; width: 24px; height: 24px;
  background: none; border: 0; color: inherit; font-size: 20px; line-height: 1;
  cursor: pointer; opacity: .7;
}
.infobar-x:hover { opacity: 1; }

/* Editor: a thin strip at the top, revealing a dropdown panel on hover (owner/admin only). */
.infobar-admin { position: relative; z-index: 40; }
.infobar-admin-tab {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--gc-muted); background: transparent; border: 0; padding: 3px 12px;
}
.infobar-admin-tab .gc-i { width: 14px; height: 14px; }
.infobar-editor {
  display: none; position: absolute; top: 100%; left: 12px;
  width: 380px; max-width: 92vw; max-height: 80vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--gc-border); border-radius: var(--gc-radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 12px;
}
.infobar-admin:hover .infobar-editor,
.infobar-admin:focus-within .infobar-editor { display: block; }
.infobar-editor-head { font-weight: 600; margin: 0 0 8px; }
.infobar-form { border: 1px solid var(--gc-border); border-radius: var(--gc-radius); padding: 10px; margin-bottom: 10px; }
.infobar-form-new { border-style: dashed; }
.infobar-form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.infobar-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #DCFCE7; color: #166534; }
.infobar-badge.off { background: #FEE2E2; color: #991B1B; }
.infobar-ord .linkbtn { padding: 0 3px; font-size: 12px; }
.infobar-rt {
  min-height: 34px; border: 1px solid var(--gc-grey-btn-border); border-radius: var(--gc-radius);
  padding: 6px 8px; font-size: 14px; background: #fff;
}
.infobar-rt:empty::before { content: attr(data-placeholder); color: #aaa; }
.infobar-rt:focus { outline: 2px solid var(--gc-blue); outline-offset: -1px; }
.infobar-form-row { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; font-size: 13px; }
.infobar-form-row label { display: inline-flex; align-items: center; gap: 5px; }
.infobar-form-row input[type="color"] { width: 34px; height: 24px; padding: 0; border: 1px solid var(--gc-border); }

/* ------------------------------- forms ----------------------------------- */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=datetime-local], textarea, select {
  font-family: inherit;
  font-size: 14px;
  color: var(--gc-text);
  border: 1px solid #CCC;
  border-radius: var(--gc-radius);
  padding: 7px 9px;
  box-sizing: border-box;
  background: #fff;
}
textarea { width: 100%; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--gc-blue);
  box-shadow: 0 0 0 2px rgba(61,126,204,.15);
}
.gc-form p { margin: 0 0 12px; }
.gc-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.gc-form input[type=text], .gc-form input[type=url], .gc-form input[type=number],
.gc-form input[type=datetime-local], .gc-form select { width: 100%; max-width: 520px; }
.gc-form .helptext { display: block; color: var(--gc-muted); font-size: 12px; margin-top: 3px; }
.gc-form ul.errorlist { color: var(--gc-red); font-size: 13px; margin: 2px 0 6px; padding-left: 18px; }
.gc-form-footer {
  border-top: 1px solid var(--gc-border);
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gc-form-footer .gc-cancel { color: var(--gc-muted); font-size: 13px; }
.gc-form-footer .gc-danger { margin-left: auto; }

/* --------------------------- trainings list ------------------------------ */
.gc-trainings li { margin: 14px 0; }
.gc-tr-link { font-size: 16px; font-weight: 600; }
.gc-trainings .muted { margin-top: 2px; }

/* Сворачиваемое дерево подтренингов (<details>, без JS). Свёрнуто по умолчанию. */
.gc-tr-branch > .gc-tr-summary,
.gc-subtrainings > .gc-subtrainings-summary { list-style: none; cursor: pointer; }
.gc-tr-branch > .gc-tr-summary::-webkit-details-marker,
.gc-subtrainings > .gc-subtrainings-summary::-webkit-details-marker { display: none; }
.gc-tr-summary { display: flex; align-items: flex-start; gap: 6px; }
.gc-tr-caret {
  width: 16px; height: 16px; flex: 0 0 auto; margin-top: 3px;
  color: var(--gc-muted); transform: rotate(-90deg); transition: transform .15s ease;
}
.gc-tr-branch[open] > .gc-tr-summary .gc-tr-caret { transform: rotate(0); }
.gc-tr-leaf { display: block; padding-left: 22px; }
/* Фон раскрытой ветки: полупрозрачные слои накладываются → каждый уровень чуть темнее. */
.gc-trainings details.gc-tr-branch > ul {
  background: rgba(61,126,204,.05);
  border-left: 2px solid rgba(61,126,204,.12);
  border-radius: 6px;
  padding: 6px 0 6px 14px;
  margin-top: 6px;
}
/* Страница тренинга: блок «Подтренинги» как свёрнутый заголовок-переключатель. */
.gc-subtrainings { margin: 12px 0; }
.gc-subtrainings-summary { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 600; }
.gc-subtrainings-summary .gc-tr-caret { margin-top: 0; }
.gc-subtrainings[open] > .gc-subtrainings-summary .gc-tr-caret { transform: rotate(0); }

/* --------------------------- lesson-tree rows ---------------------------- */
.gc-rows { border: 1px solid var(--gc-border); border-radius: 4px; margin: 12px 0; }
.gc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #EFEFEF;
  background: #fff;
  position: relative;
}
.gc-row:last-child { border-bottom: 0; }
.gc-row:hover { background: #F8FAFC; }
.gc-row-num { color: var(--gc-muted); font-size: 13px; min-width: 22px; text-align: right; }
.gc-row-title { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 500; }
.gc-row-thumb { width: 48px; height: 32px; object-fit: cover; border-radius: 2px; border: 1px solid var(--gc-border); flex: 0 0 auto; }
.gc-row-tools { display: flex; gap: 2px; align-items: center; visibility: hidden; }
.gc-row:hover .gc-row-tools, .gc-row:focus-within .gc-row-tools { visibility: visible; }
.gc-row .hw-status { margin: 0 0 0 6px; }
.gc-row form { margin: 0; }
.gc-row-tools .gc-dd-menu { right: auto; }
.gc-row-tools summary { display: inline-flex; }

/* ------------------- lesson cards (student lesson list) ------------------ *
   The GetCourse row: a colour-coded status square, the optional preview
   illustration, the status caption, the numbered title, the description.
   Colours come from lesson_marks.MARKS kinds: done/wait/rework/must/task/plain. */
.gc-lrows { background: var(--gc-panel); border-radius: 4px; padding: 10px; margin: 12px 0; }
.gc-lrow {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 3px;
  margin: 0 0 8px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
.gc-lrow:last-child { margin-bottom: 0; }
.gc-lrow:hover { text-decoration: none; box-shadow: 0 2px 6px rgba(16, 24, 40, .12); }
.gc-lrow-state {
  flex: 0 0 56px;
  display: flex; align-items: center; justify-content: center;
  background: #F0F2F5; color: var(--gc-muted);
  font-size: 20px; line-height: 1;
}
.gc-lrow-img {
  flex: 0 0 180px;
  background: #fff no-repeat center center;
  background-size: cover;
  border: 6px solid #fff;
  min-height: 96px;
}
.gc-lrow-body { flex: 1 1 auto; min-width: 0; padding: 14px 16px; }
.gc-lrow-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; color: var(--gc-muted); }
.gc-lrow-title { display: block; font-size: 16px; font-weight: 600; color: var(--gc-blue); }
.gc-lrow-num { color: var(--gc-muted); font-weight: 400; margin-right: 4px; }
.gc-lrow-desc { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: #5B6470; }
.gc-lrow--done .gc-lrow-state { background: var(--gc-green); color: #fff; }
.gc-lrow--done .gc-lrow-img { border-color: #A8DCA8; }
.gc-lrow--wait .gc-lrow-state { background: #F0AD4E; color: #fff; }
.gc-lrow--wait .gc-lrow-label { color: #92640E; }
.gc-lrow--rework .gc-lrow-state, .gc-lrow--must .gc-lrow-state { background: var(--gc-red); color: #fff; }
.gc-lrow--rework .gc-lrow-label, .gc-lrow--must .gc-lrow-label { color: var(--gc-red); }
.gc-lrow--task .gc-lrow-state { background: var(--gc-dark); color: #fff; }
.gc-lrow--task .gc-lrow-label { color: var(--gc-dark); }
.gc-lrow--locked { box-shadow: none; }
.gc-lrow--locked .gc-lrow-title { color: #9CA3AF; }
.gc-lrow--locked .gc-lrow-label { color: #92640E; }
.gc-lrow .hw-status { margin-left: 8px; vertical-align: middle; }

/* «Пройдено уроков N из M» — opt-in per training (Training.show_progress_counter). */
.gc-progress { background: var(--gc-panel); border-radius: 4px; padding: 14px 18px; margin: 12px 0; }
.gc-progress-track { height: 10px; border-radius: 5px; background: #D9DDE3; margin-top: 10px; overflow: hidden; }
.gc-progress-track span { display: block; height: 100%; background: var(--gc-blue); border-radius: 5px; }

@media (max-width: 700px) {
  .gc-lrow-state { flex-basis: 40px; font-size: 16px; }
  .gc-lrow-img { flex-basis: 96px; min-height: 68px; border-width: 4px; }
  .gc-lrow-body { padding: 10px 12px; }
  .gc-lrow-title { font-size: 15px; }
}

/* ------------------------- editor: block chrome -------------------------- */
.gc-block {
  position: relative;
  padding: 2px 0;
  margin: 6px 0;
  /* A resting hairline: a block whose content renders empty must still be findable and
     hoverable, not a transparent sliver. min-height guarantees a hover target. */
  min-height: 26px;
  border: 1px dashed #EDF1F6;
  border-radius: var(--gc-radius);
}
.gc-block:hover, .gc-block:focus-within { border-color: #BFD4EC; }
.gc-block:focus { outline: none; }   /* the dashed border (via :focus-within) is the indicator */
.gc-block-tools {
  position: absolute;
  top: -13px;
  right: 6px;
  display: none;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--gc-grey-btn-border);
  border-radius: var(--gc-radius);
  box-shadow: 0 1px 5px rgba(0,0,0,.14);
  padding: 2px 6px;
  z-index: 20;
  font-size: 12px;
}
.gc-block:hover .gc-block-tools, .gc-block:focus-within .gc-block-tools { display: flex; }
.gc-block-kind { color: var(--gc-muted); font-size: 11px; font-weight: 600; padding: 0 4px; white-space: nowrap; }
.gc-block.gc-dragging { opacity: .45; }
.gc-block.gc-drop-before { box-shadow: 0 -3px 0 0 var(--gc-blue); }
.gc-block.gc-drop-after { box-shadow: 0 3px 0 0 var(--gc-blue); }
.gc-row.gc-dragging { opacity: .45; }
.gc-row.gc-drop-before { box-shadow: inset 0 3px 0 0 var(--gc-blue); }
.gc-row.gc-drop-after { box-shadow: inset 0 -3px 0 0 var(--gc-blue); }

/* Small text button used in hover toolbars (dependent-editor 3-state controls). */
.gc-tb-btn {
  display: inline-block;
  border: 1px solid var(--gc-grey-btn-border);
  border-radius: var(--gc-radius);
  background: #fff;
  color: var(--gc-text);
  font-family: inherit;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.gc-tb-btn:hover { border-color: var(--gc-blue); color: var(--gc-blue); text-decoration: none; }

/* Small square icon button used in hover toolbars. */
.gc-ib {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border: 0;
  border-radius: var(--gc-radius);
  background: none;
  color: #555;
  cursor: pointer;
  padding: 0;
}
.gc-ib:hover { background: #F0F0F0; color: var(--gc-text); text-decoration: none; }
.gc-ib:disabled { opacity: .35; cursor: default; }
.gc-ib .gc-i { width: 15px; height: 15px; }
.gc-ib-danger:hover { background: #FDEBEA; color: var(--gc-red); }
.gc-drag-handle { cursor: grab; touch-action: none; }
.gc-drag-handle:active { cursor: grabbing; }

/* Hover caption under a toolbar icon (GC-style). Replaces the native title tooltip on
   .gc-block-tools buttons — it appears instantly and matches the skin. */
.gc-ib[data-tip] { position: relative; }
.gc-ib[data-tip]:hover::after,
.gc-ib[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  background: #2E3A46;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: var(--gc-radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  pointer-events: none;
  z-index: 60;
}

/* Insert-between "+" affordance (lives INSIDE .gc-block, hugging its top edge). */
.gc-insert { position: relative; height: 12px; margin: -4px 0; }
.gc-block > .gc-insert { position: absolute; top: -9px; left: 0; right: 0; height: 15px; margin: 0; z-index: 12; }
.gc-insert button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--gc-blue);
  background: #fff;
  color: var(--gc-blue);
  cursor: pointer;
  z-index: 15;
  padding: 0;
}
.gc-insert::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid transparent;
}
.gc-insert:hover button { display: inline-flex; }
.gc-insert:hover::before { border-top-color: #BFD4EC; }
.gc-insert button .gc-i { width: 13px; height: 13px; }

/* Quick-add toolbar (palette row under the lesson title, as in GC). */
.gc-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.gc-toolbar form { margin: 0; }
.gc-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--gc-grey-btn-border);
  border-radius: var(--gc-radius);
  color: var(--gc-text);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 11px;
  cursor: pointer;
}
.gc-tool:hover { border-color: var(--gc-blue); color: var(--gc-blue); text-decoration: none; }
.gc-tool .gc-i { width: 14px; height: 14px; }

/* Block palette modal (grid of block-type tiles). */
.gc-palette {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 60px 16px 16px;
  overflow-y: auto;
}
.gc-palette.open { display: flex; }
.gc-palette-box {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  max-width: 640px;
  width: 100%;
  padding: 18px 20px 20px;
}
.gc-palette-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.gc-palette-head h3 { margin: 0; }
.gc-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.gc-palette-grid form { margin: 0; display: contents; }
.gc-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #E0E0E0;
  border-radius: var(--gc-radius);
  background: #fff;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--gc-text);
  cursor: pointer;
  text-align: left;
}
.gc-tile:hover { border-color: var(--gc-blue); color: var(--gc-blue); }
.gc-tile .gc-i { width: 18px; height: 18px; flex: 0 0 auto; }

/* Icons (inline SVG sprite, see courses/_icons.html). */
.gc-i { display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gc-i-fill { fill: currentColor; stroke: none; }

/* ----------------------- lesson content blocks --------------------------- */
/* .gc-content = authored HTML that is NOT a block (a training's or a lesson's
   description_html) — it needs the same typography, or it renders unstyled. */
.block, .gc-content { margin: 18px 0; }
.block img, .gc-content img { max-width: 100%; height: auto; cursor: zoom-in; }
/* The magnifier is a PROMISE that the lightbox will open (base.html). A picture that is a
   link behaves like a button instead — hand cursor + a light hover — and so do homework
   thumbnails (they sit inside <a>). The before/after slider keeps ew-resize, see .imgcmp. */
.block a img, .gc-content a img { cursor: pointer; transition: opacity .12s; }
.block a img:hover, .gc-content a img:hover { opacity: .93; }
.block p, .gc-content p { margin: 0 0 .7em; line-height: 1.65; }
.block p:last-child, .gc-content p:last-child { margin-bottom: 0; }
.block ul, .block ol, .gc-content ul, .gc-content ol { margin: 0 0 .7em; padding-left: 1.5em; }
.block li, .gc-content li { margin: .15em 0; }
/* Вложенный список (кнопка «Вложить пункт» в конструкторе) — без сброса нижний отступ
   внутреннего ul даёт разрыв в 0.7em ПОСРЕДИ списка, как будто список кончился. */
.block li > ul, .block li > ol, .gc-content li > ul, .gc-content li > ol { margin-bottom: 0; }
.block blockquote, .gc-content blockquote {
  margin: .8em 0; padding: 2px 0 2px 14px;
  border-left: 3px solid var(--gc-blue); color: #555;
}
/* Заголовок и подзаголовок ВНУТРИ текстового блока (конструктор умеет их ставить). Без этих
   правил работал бы дефолт браузера — гигантский h2 с чужими отступами. */
.block h2, .gc-content h2 { font-size: 22px; font-weight: 700; margin: .8em 0 .4em; line-height: 1.3; }
.block h3, .gc-content h3 { font-size: 18px; font-weight: 700; margin: .8em 0 .35em; line-height: 1.35; }
/* h4 встречается в импорте из GetCourse (12 уроков) и есть в конструкторе. Без правила
   работал бы дефолт браузера: 1em, то есть МЕЛЬЧЕ окружающего текста, и чужие отступы. */
.block h4, .gc-content h4 { font-size: 16px; font-weight: 700; margin: .8em 0 .3em; line-height: 1.4; }
.block h2:first-child, .block h3:first-child, .block h4:first-child,
.gc-content h2:first-child, .gc-content h3:first-child, .gc-content h4:first-child { margin-top: 0; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--gc-radius); background: #000; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-src-tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.video-src-tab { border: 1px solid var(--gc-border); background: #fff; border-radius: var(--gc-radius); padding: 4px 12px; font: inherit; font-size: 13px; color: #555; cursor: pointer; }
.video-src-tab.active { background: var(--gc-blue); border-color: var(--gc-blue); color: #fff; cursor: default; }
.homework { background: #EFF6FF; border-left: 4px solid var(--gc-blue); padding: 12px 16px; border-radius: var(--gc-radius); }
.homework > strong { display: block; margin-bottom: 6px; }
.heading { font-size: 22px; font-weight: 700; }
.gallery { gap: 10px; }
.gallery.list { display: grid; align-items: start; }
.gallery.list.cols-1 { grid-template-columns: 1fr; }
.gallery.list.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery.list.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gallery.list figure { margin: 0; }
.gallery.list img { width: 100%; height: auto; display: block; }
.gallery.carousel, .gallery.carousel-block { display: flex; flex-wrap: nowrap; overflow-x: auto; }
.gallery.carousel figure, .gallery.carousel-block figure { margin: 0; flex: 0 0 auto; }
.gallery.carousel img, .gallery.carousel-block img { max-width: 280px; }
.twocol { display: flex; gap: 20px; flex-wrap: wrap; }
.twocol > div { flex: 1 1 45%; min-width: 260px; }
.imgcmp { position: relative; max-width: 100%; }
.imgcmp-single { display: flex; gap: 12px; flex-wrap: wrap; }
.imgcmp-single img { flex: 1; min-width: 240px; }
.imgcmp-frame { position: relative; width: 100%; overflow: hidden; user-select: none; touch-action: pan-y; cursor: ew-resize; }
.imgcmp-before { display: block; width: 100%; }
.imgcmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.imgcmp-after img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.imgcmp-divider { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.5); }
.imgcmp-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.imgcmp-cap { position: absolute; bottom: 10px; padding: 3px 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; border-radius: var(--gc-radius); }
.imgcmp-cap-before { left: 10px; }
.imgcmp-cap-after { right: 10px; }
.imgcmp img, .imgcmp-frame { cursor: ew-resize; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 1000; cursor: zoom-out; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; }
.carousel-wrap { position: relative; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; }
.carousel-prev { left: 6px; }
.carousel-next { right: 6px; }

/* ------------------------------ homework --------------------------------- */
.hw-box { background: #F9FAFB; border: 1px solid var(--gc-border); border-radius: 4px; padding: 12px 16px; margin-top: 10px; }
.hw-status { display: inline-block; border-radius: var(--gc-radius); padding: 2px 10px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.hw-draft { background: #E5E7EB; color: #374151; }
.hw-submitted { background: #DBEAFE; color: #1E40AF; }
.hw-accepted { background: #DCFCE7; color: #166534; }
.hw-rework { background: #FEF9C3; color: #854D0E; }
.hw-comment { background: #FFF7ED; border-left: 3px solid #F59E0B; padding: 8px 12px; border-radius: var(--gc-radius); margin: 8px 0; font-size: 14px; }
.hw-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.hw-thumb { position: relative; display: inline-block; }
.hw-thumb img { max-height: 120px; border-radius: 4px; border: 1px solid var(--gc-border); cursor: zoom-in; }
.hw-rm { position: absolute; top: -8px; right: -8px; margin: 0; }
.hw-rm button { background: var(--gc-red); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; line-height: 1; }
.hw-form textarea { width: 100%; box-sizing: border-box; border: 1px solid #D1D5DB; border-radius: var(--gc-radius); padding: 8px; font: inherit; margin-bottom: 8px; }
.hw-form input[type=file] { display: block; margin: 6px 0; }
.hw-hint { margin-bottom: 8px; }

/* лента проверки: цветной корешок карточки = состояние работы. Принятое обязано быть видно
   с одного взгляда, а не тонуть среди непринятого — иначе непонятно, принято ДЗ или нет. */
.hw-card { border-left: 3px solid transparent; }
.hw-card--accepted { border-left-color: #16A34A; background: #F6FDF8; }
.hw-card--submitted { border-left-color: var(--gc-blue); }
.hw-card--rework { border-left-color: #F59E0B; }
.hw-card--cmt { border-left-color: #9CA3AF; }
.hw-verdict { font-size: 13px; color: #166534; margin: 6px 0; }
.hw-seen { font-size: 12px; color: var(--gc-muted); margin: 4px 0; }
/* «✓ Принято» — не кнопка: нажимать нечего, но место в ряду держать надо */
.hw-btn-done { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; cursor: default; pointer-events: none; }
.hw-kind { font-size: 11px; }
.hw-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.hw-filters label { font-size: 13px; }
.hw-filters input[type=search] { padding: 5px 8px; border: 1px solid #D1D5DB; border-radius: var(--gc-radius); font: inherit; }

/* peer «Лента ответов» — accepted work by other students under a lesson */
.hw-peers { margin: 16px 0; }
.hw-peers-title { margin: 0 0 8px; font-size: 15px; }
.hw-peer { margin: 8px 0; }
.hw-peer-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }

/* Пользовательский текст и авторские ссылки: вставленная ссылка на Google-документ бывает
   150+ символов и иначе распирает карточку по горизонтали. Правило для контента намеренно
   сужено до самих ссылок, чтобы не трогать импортированные из GetCourse таблицы и сетки. */
.gc-usertext, .hw-comment, .gc-cmt-text,
.block a, .gc-content a { overflow-wrap: anywhere; }

/* ---------------- обсуждения: треды, комментарии, «нравится» ---------------- */
.gc-thread { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gc-border); }
.gc-thread-title { margin: 0 0 4px; font-size: 15px; }
.gc-thread-empty { margin: 0 0 8px; font-size: 13px; }
.gc-thread-more { margin-top: 8px; }
.gc-thread-more > summary { cursor: pointer; color: var(--gc-blue); font-size: 13px; }
.gc-lesson-comments { margin-top: 24px; }

.gc-cmt { display: flex; gap: 10px; margin: 10px 0; }
.gc-cmt-ava { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gc-dark-2, #3a4a5e); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.gc-cmt-body { flex: 1 1 auto; min-width: 0; }
.gc-cmt-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.gc-cmt-author { font-weight: 600; font-size: 13px; }
.gc-cmt-role { font-size: 11px; color: #fff; background: var(--gc-green);
  border-radius: 8px; padding: 1px 7px; }
.gc-cmt-time { font-size: 12px; color: var(--gc-muted); }
/* Длинная ссылка в комментарии не имеет права растянуть страницу. */
.gc-cmt-text { font-size: 14px; margin: 2px 0 4px; overflow-wrap: anywhere; }
.gc-cmt-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gc-cmt-tool { border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--gc-muted); text-decoration: underline; }
.gc-cmt-tool:hover { color: var(--gc-text); }
.gc-cmt-inline { display: inline; }
/* «Удалить работу»: свёрнуто выглядит как остальные мелкие действия, раскрывается в форму
   с обязательной галочкой — как опасная зона в конструкторе урока. */
.gc-hw-danger > summary { list-style: none; cursor: pointer; font-size: 12px;
  color: var(--gc-muted); text-decoration: underline; }
.gc-hw-danger > summary::-webkit-details-marker { display: none; }
.gc-hw-danger > summary:hover { color: var(--gc-red, #c0392b); }
.gc-hw-danger form { margin-top: 8px; padding: 10px; border-radius: var(--gc-radius);
  background: var(--gc-bg-soft, #f6f7f9); max-width: 520px; }
.gc-hw-danger label { display: block; margin-bottom: 8px; font-size: 13px; }
.gc-hw-danger label input { width: auto; margin-right: 6px; }
.gc-cmt-editbox > summary { list-style: none; }
.gc-cmt-form { margin-top: 8px; }
.gc-cmt-form textarea { width: 100%; box-sizing: border-box; padding: 8px;
  border: 1px solid var(--gc-border); border-radius: var(--gc-radius); font: inherit; }
.gc-cmt-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.gc-cmt-file { font-size: 12px; color: var(--gc-muted); cursor: pointer; }
.gc-cmt-file input { max-width: 190px; font-size: 12px; }

.gc-like-form { display: inline; }
.gc-like { border: 1px solid var(--gc-grey-btn-border); background: var(--gc-grey-btn);
  border-radius: 12px; padding: 2px 10px; cursor: pointer; font: inherit; font-size: 12px;
  color: var(--gc-muted); display: inline-flex; gap: 5px; align-items: center; }
.gc-like:hover { color: var(--gc-red); }
.gc-like.is-on { color: var(--gc-red); border-color: var(--gc-red); background: #fff; }
/* Подпись для скринридера: кнопка-сердечко иначе читается как «неизвестно». */
.gc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; }

.gc-emo { position: relative; display: inline-block; }
.gc-emo > summary { list-style: none; cursor: pointer; font-size: 18px; line-height: 1; }
.gc-emo > summary::-webkit-details-marker { display: none; }
.gc-emo-pop { position: absolute; z-index: 50; bottom: 100%; left: 0; width: 250px;
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: #fff;
  border: 1px solid var(--gc-border); border-radius: var(--gc-radius);
  box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.gc-emo-i { border: 0; background: none; cursor: pointer; font-size: 18px;
  line-height: 1; padding: 2px; border-radius: 3px; }
.gc-emo-i:hover { background: var(--gc-panel); }

/* метка «в обсуждении новая реплика» в ленте проверки */
.hw-chip-new { font-size: 11px; color: #fff; background: var(--gc-red);
  border-radius: 8px; padding: 1px 8px; }

/* ---------------- inline rich-text constructor ---------------- */
/* The editable region IS the rendered block content (true WYSIWYG). */
.gc-rt { outline: none; min-height: 1.4em; border-radius: 3px; transition: box-shadow .12s; }
.gc-rt:focus { box-shadow: 0 0 0 2px rgba(61,126,204,.35); }
.gc-rt:empty::before { content: attr(data-placeholder); color: var(--gc-muted); pointer-events: none; }
.gc-rt.gc-rt-saved, .gc-rt-saved { box-shadow: 0 0 0 2px rgba(34,197,94,.4); }
.gc-rt.gc-rt-error, .gc-rt-error { box-shadow: 0 0 0 2px rgba(220,38,38,.5); }
.gc-rt-label { display: block; font-size: 11px; color: var(--gc-muted); font-weight: 600; margin: 6px 0 2px; }

/* Lesson header in the constructor: name + description + preview illustration. */
.gc-lhead {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--gc-panel); border-radius: 4px; padding: 14px 18px; margin: 12px 0;
}
.gc-lhead-main { flex: 1 1 auto; min-width: 0; }
.gc-lhead-side { flex: 0 0 170px; }
.gc-lhead-title {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 22px; font-weight: 600;
  color: var(--gc-text); background: #fff; border: 1px solid var(--gc-border);
  border-radius: 3px; padding: 6px 10px; transition: box-shadow .12s;
}
.gc-lhead-title:focus { outline: none; box-shadow: 0 0 0 2px rgba(61,126,204,.35); }
.gc-lhead-descr { margin-top: 10px; }
.gc-lhead .gc-rt { background: #fff; border: 1px solid var(--gc-border); padding: 8px 10px; min-height: 2.6em; }
.gc-lhead-status { margin: 8px 0 0; font-size: 12px; }
.gc-save-hint { color: var(--gc-green-dark); font-weight: 600; margin-left: 6px; }
.gc-save-hint.gc-save-hint-error { color: var(--gc-red); }
.gc-lhead-prev { display: block; width: 100%; height: auto; border-radius: 3px; border: 1px solid var(--gc-border); background: #fff; }
.gc-lhead-clear {
  display: inline-block; margin: 6px 0 0; padding: 0; border: 0; background: none;
  color: var(--gc-muted); font: inherit; font-size: 12px; text-decoration: underline;
  cursor: pointer;
}
.gc-lhead-clear:hover { color: var(--gc-red); }
@media (max-width: 700px) {
  .gc-lhead { flex-direction: column; }
  .gc-lhead-side { flex-basis: auto; width: 100%; max-width: 260px; }
}

/* inline подпись under a picture / video in the constructor (editor/_caption_edit.html) */
.gc-caption-edit { margin-top: 6px; }
.gc-caption-edit .gc-rt {
  background: #fff; border: 1px dashed var(--gc-border); border-radius: 3px;
  padding: 4px 8px; font-size: 13px; color: var(--gc-muted);
}
.gc-click-hint { font-size: 12px; margin-top: 4px; word-break: break-all; }

/* «Удалить урок» section at the bottom of the ⚡Действия dropdown */
.gc-dd-danger { border-top: 1px solid var(--gc-border); margin-top: 4px; padding: 10px 14px; }
.gc-dd-danger p, .gc-dd-danger label { font-size: 12px; margin: 0 0 8px; display: block; }
.gc-dd-danger .btn { width: auto; display: inline-block; padding: 5px 12px; margin: 0; }
.gc-exp-edit { border-left: 3px solid var(--gc-border); padding-left: 10px; }
.gc-tbl { border-collapse: collapse; margin: 8px 0; }
.gc-tbl td { border: 1px solid var(--gc-border); padding: 6px 10px; }

.gc-rt-toolbar {
  position: absolute; z-index: 1000; display: none; align-items: center; gap: 1px;
  flex-wrap: wrap; max-width: 96vw;
  background: #fff; border: 1px solid var(--gc-border); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.16); padding: 3px;
}
.gc-rt-btn {
  min-width: 26px; height: 26px; padding: 0 5px; border: 0; background: transparent;
  border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--gc-text); line-height: 1;
}
.gc-rt-btn:hover { background: #EEF3FB; color: var(--gc-blue); }
.gc-rt-btn.is-on { background: #E3ECF9; color: var(--gc-blue); }
/* Отступы списка активны только внутри пункта; pointer-events заодно гасит :hover. */
.gc-rt-btn:disabled { opacity: .35; pointer-events: none; }
.gc-rt-sep { width: 1px; height: 18px; background: var(--gc-border); margin: 0 3px; }
/* Свой padding обязателен: иначе действует общее правило для select (7px 9px, см. «forms»)
   и при box-sizing:border-box с height:26px на текст остаётся 10px — метка режется сверху
   и снизу. Соседи .gc-rt-btn / .gc-rt-color / .gc-rt-url этот сброс уже делают. */
.gc-rt-select { height: 26px; padding: 0 4px; border: 1px solid var(--gc-border); border-radius: 4px; font-size: 12px; background: #fff; }
.gc-rt-color { width: 26px; height: 26px; padding: 0; border: 1px solid var(--gc-border); border-radius: 4px; background: #fff; cursor: pointer; }
/* Кнопки цвета текста и маркера — сама буква показывает, что кнопка делает. */
.gc-rt-ink { border-bottom: 3px solid #DC2626; padding-bottom: 1px; }
.gc-rt-hl { background: #FEF08A; padding: 0 3px; border-radius: 2px; }
/* Выпадашка панели (цвета, маркер, ссылка) */
.gc-rt-pop {
  position: absolute; z-index: 1001; background: #fff; border: 1px solid var(--gc-border);
  border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 8px; width: 250px;
}
.gc-rt-sw-row { display: flex; flex-wrap: wrap; gap: 5px; }
.gc-rt-sw { width: 24px; height: 24px; border: 1px solid var(--gc-border); border-radius: 4px; cursor: pointer; padding: 0; }
.gc-rt-pop-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.gc-rt-wide { width: auto; padding: 0 8px; border: 1px solid var(--gc-border); }
.gc-rt-lbl { display: block; font-size: 11px; color: var(--gc-muted); font-weight: 600; margin-bottom: 3px; }
.gc-rt-url { width: 100%; height: 28px; border: 1px solid var(--gc-border); border-radius: 4px; padding: 0 7px; font-size: 13px; }
.gc-rt-check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 8px; }
.gc-rt-hint { font-size: 11px; color: var(--gc-muted); margin-top: 4px; }
.gc-rt-pop .btn { padding: 5px 12px; }
/* Помеченная «заявкой» ссылка видна автору прямо в конструкторе. */
.gc-block a[data-lead]::after { content: " 📩"; font-size: 12px; }

/* inline «Настройки» panel (non-text blocks) */
/* Settings drawer — slides in from the left, past the fixed sidebar, so block and item
   settings are edited without leaving the lesson constructor. */
.gc-drawer[hidden] { display: none; }
.gc-drawer { position: fixed; inset: 0; z-index: 1000; display: flex; }
.gc-drawer-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.gc-drawer-box {
  position: relative; margin-left: var(--gc-sidebar-w);
  width: min(420px, calc(100vw - var(--gc-sidebar-w)));
  background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(-100%); transition: transform .18s ease-out;
}
.gc-drawer.open .gc-drawer-box { transform: translateX(0); }
.gc-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--gc-border); }
.gc-drawer-title { margin: 0; font-size: 15px; }
.gc-drawer-body { flex: 1; overflow-y: auto; padding: 14px; }
.gc-drawer-body .gc-form-footer { margin-top: 10px; }
/* the drawer is narrower than the 520px form cap used on full pages */
.gc-drawer-body .gc-form input, .gc-drawer-body .gc-form textarea, .gc-drawer-body .gc-form select,
.gc-drawer-body input, .gc-drawer-body textarea, .gc-drawer-body select { max-width: 100%; box-sizing: border-box; }
.gc-back { display: inline-block; margin-bottom: 10px; font-size: 13px; }

/* ---- empty-block placeholder (constructor only) + media drop zone ---- */
.gc-empty {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin: 4px 0;
  border: 1px dashed var(--gc-border); border-radius: var(--gc-radius);
  background: #FAFBFD;
}
.gc-empty-icon { width: 22px; height: 22px; color: var(--gc-muted); flex: none; }
.gc-empty-text { flex: 1; font-size: 14px; line-height: 1.45; }
.gc-empty-text span { display: block; font-size: 13px; }
.gc-empty-cta { flex: none; }
.gc-drop { cursor: pointer; }
.gc-drop.gc-drop-over { border-color: var(--gc-blue); background: #EEF4FC; }
.gc-drop.gc-busy { opacity: .6; pointer-events: none; }
/* Drop zone on an already-filled media block: a thin strip under its content. */
.gc-dropbar {
  display: block; margin: 4px 0 0; padding: 7px 10px;
  border: 1px dashed var(--gc-border); border-radius: var(--gc-radius);
  background: #FAFBFD; color: var(--gc-muted); font-size: 12.5px; cursor: pointer;
}
.gc-dropbar.gc-drop-over { border-color: var(--gc-blue); background: #EEF4FC; color: var(--gc-blue); }
.gc-dropbar.gc-busy { opacity: .6; pointer-events: none; }
@media (max-width: 900px) { .gc-drawer-box { margin-left: 0; width: 100vw; } }
@media (prefers-reduced-motion: reduce) { .gc-drawer-box { transition: none; } }
.gc-settings-form .gc-form-errors, .gc-form-errors { color: var(--gc-red); font-size: 13px; margin-bottom: 8px; }
.gc-items-head { font-size: 13px; margin: 12px 0 4px; }

/* One field row of a block/item settings form (editor/_form_fields.html). */
.gc-fld { margin: 0 0 14px; }
.gc-fld-check label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.gc-fld-check input[type=checkbox] { margin: 0; }
/* Picture field: what is there now, then how to replace or drop it. */
.gc-imgfld-prev {
  display: block; max-width: 100%; max-height: 180px; width: auto;
  border: 1px solid var(--gc-border); border-radius: var(--gc-radius);
  background: var(--gc-panel); margin: 0 0 8px;
}
.gc-imgfld input[type=file] { display: block; font-size: 13px; }
.gc-imgfld-clear {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-weight: 400; font-size: 12px; color: var(--gc-muted);
}
.gc-imgfld-clear input[type=checkbox] { margin: 0; }

/* ---- staff-editor field help (hover/focus tooltip) + product target picker ---- */
[hidden] { display: none !important; }
.gc-field { margin: 0 0 14px; }
.gc-field-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.gc-help { position: relative; display: inline-flex; align-items: center; color: var(--gc-muted, #6b7280); cursor: help; outline: none; }
.gc-help > .gc-i { width: 15px; height: 15px; }
.gc-help:focus > .gc-i { color: var(--gc-blue, #3D7ECC); }
.gc-help-pop { position: absolute; left: 0; top: 100%; margin-top: 6px; width: 270px; max-width: 76vw; background: #fff; color: #1f2733; border: 1px solid var(--gc-border, #d1d5db); border-radius: var(--gc-radius, 8px); box-shadow: 0 6px 22px rgba(0,0,0,.15); padding: 9px 11px; font-size: 12.5px; font-weight: 400; line-height: 1.45; z-index: 50; display: none; }
.gc-help-pop a { color: var(--gc-blue, #3D7ECC); }
.gc-help:hover .gc-help-pop, .gc-help:focus .gc-help-pop, .gc-help:focus-within .gc-help-pop { display: block; }
.gc-field-err { color: var(--gc-red, #d33); font-size: 13px; margin-top: 3px; }

.gc-picker { border: 1px solid var(--gc-border, #d1d5db); border-radius: var(--gc-radius, 8px); margin-top: 4px; }
.gc-picker-search { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--gc-border, #e5e7eb); border-radius: var(--gc-radius, 8px) var(--gc-radius, 8px) 0 0; font-size: 14px; }
.gc-picker-list { max-height: 340px; overflow-y: auto; padding: 6px 8px; }
.gc-picker-list ul { list-style: none; margin: 0; padding-left: 15px; }
.gc-picker-list > ul { padding-left: 0; }
.gc-picker-row { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 5px; font-size: 14px; }
.gc-picker-row:hover { background: rgba(61,126,204,.08); }
.gc-picker-row input { margin: 0; flex: none; }
.gc-picker-row .muted { margin-left: auto; }
.gc-picker-empty { padding: 10px; color: var(--gc-muted, #6b7280); font-size: 13px; }
.gc-discount { color: var(--gc-red, #d33); font-weight: 600; }

/* Группы полей в формах продаж: подзаголовок, вложенный блок условных полей и «кат». */
.gc-form-group { font-size: 14px; margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--gc-border, #e5e7eb); }
.gc-subfields { margin: -4px 0 14px 22px; padding-left: 12px; border-left: 2px solid var(--gc-border, #e5e7eb); }
.gc-more { margin: 18px 0 14px; }
.gc-more > summary { cursor: pointer; color: var(--gc-blue, #3D7ECC); font-size: 13.5px; font-weight: 600; }
.gc-more-body { margin-top: 12px; padding-left: 12px; border-left: 2px solid var(--gc-border, #e5e7eb); }
.gc-sort { display: inline-flex; gap: 10px; align-items: center; font-size: 13px; margin-left: 14px; }
.gc-sort a { color: var(--gc-muted, #6b7280); }
.gc-sort a.active { color: var(--gc-blue, #3D7ECC); font-weight: 600; text-decoration: none; }

@media (prefers-color-scheme: dark) {
  .gc-help-pop { background: #1c2430; color: #e6e9ef; border-color: #33404f; }
}
:root[data-theme="dark"] .gc-help-pop { background: #1c2430; color: #e6e9ef; border-color: #33404f; }
:root[data-theme="light"] .gc-help-pop { background: #fff; color: #1f2733; border-color: #d1d5db; }

/* ------------------------------------------------------------------ *
   Личный кабинет ученика: «Мой профиль» + «Мои покупки».
 * ------------------------------------------------------------------ */

/* Аватар вместо буквы в сайдбаре — та же коробка .gc-nav-user, только с картинкой. */
.gc-nav-avatar { object-fit: cover; padding: 0; }

/* Профиль в две колонки, как на GetCourse. Порядок полей задаёт ProfileForm.Meta.fields
   (пары Имя|Телефон, Фамилия|Страна, ДР|Город); аватар и «О себе» — во всю ширину. */
.gc-profile-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.gc-profile-form > .gc-imgfld,
.gc-profile-form > [data-field="about"],
.gc-profile-form > [data-field="telegram"],
.gc-profile-form > .gc-form-footer,
.gc-profile-form > p { grid-column: 1 / -1; }
.gc-profile-grid { display: grid; grid-template-columns: 160px 1fr; gap: 24px; }
.gc-avatar-lg { width: 135px; height: 135px; border-radius: 50%; object-fit: cover; }
.gc-avatar-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--gc-blue, #3D7ECC); color: #fff; font-size: 48px; font-weight: 600;
}
@media (max-width: 900px) {
  .gc-profile-form, .gc-profile-grid { grid-template-columns: 1fr; }
}

/* Таблицы кабинета. В теме их до сих пор не было вообще — каждая таблица в проекте
   размечена инлайновыми стилями; здесь заводим общий класс, старые не трогаем. */
.gc-table-wrap { overflow-x: auto; }
.gc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gc-table th {
  text-align: left; font-weight: 600; color: var(--gc-muted, #6b7280);
  padding: 6px 12px 6px 0; white-space: nowrap;
}
.gc-table td { padding: 9px 12px 9px 0; border-top: 1px solid var(--gc-border, #e5e7eb); vertical-align: top; }
.gc-table tr.is-dim td { color: var(--gc-muted, #6b7280); }
.gc-table .gc-num { white-space: nowrap; }
.gc-table .gc-money { white-space: nowrap; text-align: right; }
.gc-subrow { display: block; margin-top: 3px; font-size: 12.5px; color: var(--gc-muted, #6b7280); }

/* Чипы статуса покупки/заказа. Отдельные классы, а не .new-tag/.lock-tag: у тех в
   комментариях зафиксирован свой смысл, и переиспользование его бы размыло. */
.gc-chip { display: inline-block; border-radius: var(--gc-radius, 4px); padding: 1px 8px; font-size: 12px; white-space: nowrap; }
.gc-chip--ok { background: #E7F6EC; color: #1B7F3B; }
.gc-chip--muted { background: #F1F1F1; color: #6B6B6B; }
.gc-chip--warn { background: #FEF3D8; color: #92640E; }

/* Пары «подпись — значение» на карточке покупки. */
.gc-deflist { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; font-size: 14px; }
.gc-deflist dt { color: var(--gc-muted, #6b7280); }
.gc-deflist dd { margin: 0; }
@media (max-width: 700px) { .gc-deflist { grid-template-columns: 1fr; gap: 2px 0; } }

/* Поиск по тренингам и урокам. Сниппет намеренно pre-line: контекст режется из ПЛОСКОГО
   текста с сохранёнными переводами строк, поэтому <br> в размеченную строку не вставляем. */
.gc-search { display: flex; gap: 8px; margin: 14px 0 6px; }
.gc-search input[type=search] {
  flex: 1; max-width: 460px; padding: 8px 11px; font-size: 14px;
  border: 1px solid var(--gc-border, #d1d5db); border-radius: var(--gc-radius, 8px);
}
.gc-search-hint { font-size: 12px; margin: 0 0 14px; }
.gc-hit { margin-bottom: 10px; }
.gc-hit-head { display: flex; align-items: center; gap: 8px; }
.gc-hit-kind {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; text-transform: lowercase;
  background: rgba(61,126,204,.10); color: var(--gc-blue, #3D7ECC);
}
.gc-hit-kind-3, .gc-hit-kind-4, .gc-hit-kind-5 { background: #f1f5f9; color: var(--gc-muted, #6b7280); }
.gc-hit-title { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.gc-hit-edit { margin-left: 8px; font-weight: 400; color: var(--gc-muted, #6b7280); }
.gc-hit .gc-crumbs { margin: 6px 0 0; }
.gc-snippet { white-space: pre-line; color: #374151; font-size: 13.5px; margin: 6px 0 0; }
.gc-snippet mark, .gc-hit-title mark { background: #fef3c7; color: inherit; padding: 0 1px; }
.gc-pager { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
