/*
 * Скоро Пицца LMS v5.57.0 — финальный слой геометрии интерфейса.
 * Загружается последним и не зависит от порядка исторических модулей.
 */
:root {
  --sp-layout-width: 1160px;
  --sp-header-row: 76px;
  --sp-nav-row: 54px;
  --sp-control-height: 46px;
  --sp-icon-control: 44px;
  --sp-space-page: 40px;
  --sp-radius-hero: 28px;
  --sp-radius-panel: 22px;
  --sp-radius-control: 14px;
}
html { overflow-x: clip; }
body { min-width: 320px; overflow-x: clip; }
img, svg { max-width: 100%; }
button, a, input, select, textarea { box-sizing: border-box; }
main {
  box-sizing: border-box;
  width: min(var(--sp-layout-width), calc(100% - var(--sp-space-page)));
  margin-inline: auto;
}
.screen, .screen > *, .screen section, .screen article,
.screen header, .screen div { min-width: 0; }

/* Первый ряд — бренд и профиль. Второй ряд — независимая навигация. */
@media (min-width: 721px) {
  .topbar {
    position: sticky;
    z-index: 1000;
    top: 0;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, auto);
    grid-template-rows: var(--sp-header-row) var(--sp-nav-row);
    min-height: calc(var(--sp-header-row) + var(--sp-nav-row));
    padding: 0 clamp(22px, 3vw, 54px);
    column-gap: 24px;
    row-gap: 0;
    align-items: center;
  }
  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    min-width: 0;
  }
  .topbar .account {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .topbar .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: stretch;
    display: flex;
    min-width: 0;
    min-height: var(--sp-nav-row);
    align-items: stretch;
    justify-content: center;
    gap: clamp(18px, 2.2vw, 34px);
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--sp-line, #e3e6eb);
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .topbar .main-nav::-webkit-scrollbar { display: none; }
  .topbar .main-nav .nav-link {
    flex: 0 0 auto;
    min-height: var(--sp-nav-row);
    align-items: center;
    padding: 0 1px;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
  }
  .topbar .main-nav .nav-link::after { bottom: 0; }
}
.brand { flex: 0 0 auto; }
.brand img { width: 50px; height: 50px; flex: 0 0 50px; }
.brand span { min-width: 0; }
.brand strong { font-size: 16px; line-height: 1.15; }
.brand small { font-size: 11px; line-height: 1.2; }
.account { gap: 10px; }
.account__copy { min-width: 0; }
.account__copy strong, .account__copy small { max-width: 220px; }

.notification-center-trigger, .message-center-trigger, .avatar {
  width: var(--sp-icon-control);
  height: var(--sp-icon-control);
  min-width: var(--sp-icon-control);
  min-height: var(--sp-icon-control);
  flex: 0 0 var(--sp-icon-control);
  padding: 0;
}
.notification-center-trigger, .message-center-trigger {
  display: inline-grid;
  place-items: center;
  border-radius: var(--sp-radius-control);
}
.notification-center-trigger svg, .message-center-trigger svg {
  display: block;
  width: 21px;
  height: 21px;
}
.avatar { display: grid; place-items: center; }
.platform-mode-switch--top {
  min-width: 0;
  min-height: var(--sp-icon-control);
  height: var(--sp-icon-control);
  max-width: 250px;
  flex: 0 1 auto;
  padding-inline: 16px;
  border-radius: var(--sp-radius-control);
}
.platform-mode-switch--top .platform-mode-switch__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-menu { top: calc(var(--sp-header-row) - 10px); }

.admin-context { position: relative; z-index: 40; }
.admin-context__inner {
  box-sizing: border-box;
  width: min(var(--sp-layout-width), calc(100% - var(--sp-space-page)));
  min-height: 68px;
  margin-inline: auto;
  padding-block: 10px;
  gap: 14px;
}
.admin-context__mark { flex: 0 0 auto; }
.admin-context__exit { min-height: 40px; padding-inline: 18px; }

.section-header:not(.sp-infographic-hero), .news-editor-header {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 138px;
  padding: 28px 4px 24px;
}
.section-header:not(.sp-infographic-hero) h1, .news-editor-header h1 {
  margin: 0;
  font-size: clamp(38px, 4vw, 48px);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.section-header:not(.sp-infographic-hero) > div > p:last-child {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
}
.sp-infographic-hero, .analytics-screen .analytics-hero,
.team-ranking__hero.sp-infographic-hero, .sp-team__hero.sp-infographic-hero,
.assessment-hero {
  box-sizing: border-box;
  width: 100%;
  height: 220px;
  min-height: 220px;
  margin-top: 0;
  padding: 38px 42px;
  border-radius: var(--sp-radius-hero);
}

.panel, .course-row, .catalog-card, .banner-admin-card,
.banner-admin-footer, .empty-state, .editor-guide, .home-news-card,
.news-admin-row, .news-detail__content, .analytics-panel, .analytics-card,
.analytics-kpi, .assessment-panel, .assessment-summary article,
.assessment-template-card, .assessment-question, .team-ranking__unit,
.team-ranking__summary article, .team-ranking__leaders, .team-ranking__board,
.sp-team__scope, .sp-team__metrics article, .sp-team__workspace,
.sp-card, .sp-structure {
  box-sizing: border-box;
  border-radius: var(--sp-radius-panel);
}
.button, .sp-button, .assessment-template-card > button,
.assessment-dialog__footer .button {
  min-height: var(--sp-control-height);
  align-items: center;
  justify-content: center;
  padding-inline: 20px;
  border-radius: var(--sp-radius-control);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.button svg, .sp-button svg, .icon-action svg, .dialog-close svg { display: block; }
.icon-action, .dialog-close, .sp-modal__close, .assessment-dialog__close,
.notification-center-close, .message-center-close {
  box-sizing: border-box;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  line-height: 1;
}
.search, .form-control input, .form-control select, .sp-field input,
.sp-field select, .assessment-field input, .assessment-field select {
  min-height: var(--sp-control-height);
  border-radius: var(--sp-radius-control);
}
.editor-guide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 58px;
  overflow: hidden;
}
.editor-guide span { min-height: 58px; padding: 14px 16px; }
.editor-guide b { flex: 0 0 28px; width: 28px; height: 28px; }
.panel__head { min-height: 76px; align-items: center; }
.panel__head > * { min-width: 0; }
.editor-row { min-height: 76px; }
.editor-row__icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px; }
.editor-row__copy { min-width: 0; }
.editor-row__copy strong, .editor-row__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-row__status { white-space: nowrap; }

@media (max-width: 1100px) and (min-width: 721px) {
  .account__copy { display: none; }
  .platform-mode-switch--top {
    width: var(--sp-icon-control);
    flex: 0 0 var(--sp-icon-control);
    padding: 0;
  }
  .platform-mode-switch--top .platform-mode-switch__label { display: none; }
  .topbar .main-nav { justify-content: flex-start; }
}
@media (max-width: 940px) and (min-width: 721px) {
  .editor-guide {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
  }
  .editor-guide span:nth-child(n) { border-top: 0; }
}
@media (max-width: 720px) {
  :root {
    --sp-space-page: 24px;
    --sp-header-row: 72px;
    --sp-icon-control: 40px;
  }
  .topbar {
    position: sticky;
    z-index: 1000;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: var(--sp-header-row);
    padding: 6px 14px;
    column-gap: 10px;
    align-items: center;
  }
  .topbar .brand { min-width: 0; }
  .topbar .brand img { width: 46px; height: 46px; flex-basis: 46px; }
  .topbar .brand span, .topbar .account__copy, .topbar .main-nav { display: none; }
  .topbar .account { gap: 7px; }
  .platform-mode-switch--top {
    width: var(--sp-icon-control);
    min-width: var(--sp-icon-control);
    height: var(--sp-icon-control);
    min-height: var(--sp-icon-control);
    flex: 0 0 var(--sp-icon-control);
    padding: 0;
  }
  .platform-mode-switch--top .platform-mode-switch__label { display: none; }
  .notification-center-trigger, .message-center-trigger { border-radius: 12px; }
  .avatar { border-radius: 50%; }
  .profile-menu { top: calc(var(--sp-header-row) + 4px); }
  .admin-context__inner {
    width: min(var(--sp-layout-width), calc(100% - var(--sp-space-page)));
    min-height: 72px;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .admin-context__exit { display: none; }
  .section-header:not(.sp-infographic-hero), .news-editor-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 16px;
    min-height: 0;
    padding: 22px 0 20px;
  }
  .section-header:not(.sp-infographic-hero) h1, .news-editor-header h1 {
    font-size: 36px;
  }
  .section-header:not(.sp-infographic-hero) .button,
  .news-editor-header .button { width: 100%; }
  .sp-infographic-hero, .analytics-screen .analytics-hero,
  .team-ranking__hero.sp-infographic-hero, .sp-team__hero.sp-infographic-hero,
  .assessment-hero {
    height: auto;
    min-height: 300px;
    padding: 28px 22px;
    border-radius: 22px;
  }
  .panel, .course-row, .catalog-card, .banner-admin-card,
  .banner-admin-footer, .empty-state, .editor-guide, .home-news-card,
  .news-admin-row, .news-detail__content, .analytics-panel, .assessment-panel,
  .team-ranking__unit, .team-ranking__leaders, .team-ranking__board,
  .sp-team__scope, .sp-team__workspace { border-radius: 18px; }
  .editor-guide { display: flex; min-height: 58px; overflow-x: auto; }
  .editor-guide span { min-width: 150px; }
  .panel__head { min-height: 0; }
  .button, .sp-button { white-space: normal; }
}
@media (max-width: 430px) {
  .topbar .account { gap: 6px; }
  .topbar .brand img { width: 42px; height: 42px; flex-basis: 42px; }
  .notification-center-trigger, .message-center-trigger,
  .avatar, .platform-mode-switch--top { --sp-icon-control: 38px; }
}
