#nomkamo-edu-admin-v2 {
    --nea-bg: #ffffff;
    --nea-text: #050505;
    --nea-muted: #707070;
    --nea-line: #050505;
    --nea-soft-line: rgba(5, 5, 5, 0.16);
    --nea-blue: #d9efff;
    --nea-soft-blue: #eef8ff;
    --nea-green: #dff7e7;
    --nea-yellow: #fff2bf;
    --nea-red: #ffe1e1;

    width: 100%;
    min-height: 100vh;
    background: var(--nea-bg);
    color: var(--nea-text);
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
  }

  #nomkamo-edu-admin-v2 *,
  #nomkamo-edu-admin-v2 *::before,
  #nomkamo-edu-admin-v2 *::after {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
  }

  .nea-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 22px 18px 72px;
  }

  .nea-head {
    border: 1px solid var(--nea-soft-line);
    padding: 18px;
    background: #ffffff;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
  }

  .nea-head-main {
    min-width: 0;
  }

  .nea-head-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(84px, 1fr));
    gap: 8px;
    min-width: 390px;
  }

  .nea-stat {
    border: 1px solid var(--nea-soft-line);
    padding: 10px 12px;
    background: #ffffff;
  }

  .nea-stat-value {
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.05em;
  }

  .nea-stat-label {
    margin-top: 6px;
    color: var(--nea-muted);
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .nea-label {
    display: inline-flex;
    border: 1px solid var(--nea-soft-line);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #ffffff;
  }

  .nea-title {
    margin: 14px 0 0;
    font-size: clamp(38px, 5vw, 72px);
    line-height: 0.88;
    letter-spacing: -0.08em;
    font-weight: 700;
  }

  .nea-subtitle {
    margin: 18px 0 0;
    color: var(--nea-muted);
    font-size: 16px;
    line-height: 1.45;
    max-width: 820px;
  }

  .nea-token {
    border: 1px solid var(--nea-soft-line);
    padding: 12px;
    margin-bottom: 12px;
    background: #ffffff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: end;
  }

  .nea-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--nea-muted);
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .nea-input,
  .nea-textarea,
  .nea-select {
    width: 100%;
    border: 1px solid var(--nea-soft-line);
    border-radius: 0;
    background: #ffffff;
    color: var(--nea-text);
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.35;
    outline: none;
    appearance: none;
  }

  .nea-textarea {
    min-height: 110px;
    resize: vertical;
  }

  .nea-input:focus,
  .nea-textarea:focus,
  .nea-select:focus {
    background: var(--nea-soft-blue);
  }

  .nea-btn {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    color: var(--nea-text);
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    min-height: 37px;
  }

  .nea-btn:hover {
    background: var(--nea-blue);
  }

  .nea-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .nea-btn-primary {
    background: var(--nea-text);
    color: #ffffff;
  }

  .nea-btn-primary:hover {
    background: #333333;
  }

  .nea-btn-red:hover {
    background: var(--nea-red);
  }

  .nea-btn-soft {
    background: var(--nea-soft-blue);
  }

  .nea-status {
    min-height: 22px;
    color: var(--nea-muted);
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 14px;
  }

  .nea-status.is-error {
    color: #b00020;
  }

  .nea-status.is-ok {
    color: #007a3d;
  }

  .nea-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    margin-bottom: 12px;
  }

  .nea-tab {
    border: 0;
    border-right: 1px solid var(--nea-soft-line);
    background: #ffffff;
    padding: 12px 13px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  .nea-tab:last-child {
    border-right: 0;
  }

  .nea-tab-count {
    border: 1px solid var(--nea-soft-line);
    border-radius: 999px;
    padding: 3px 6px;
    font-size: 11px;
    line-height: 1;
    color: var(--nea-muted);
  }

  .nea-tab:hover {
    background: var(--nea-soft-blue);
  }

  .nea-tab.is-active {
    background: var(--nea-blue);
  }

  .nea-panel {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    padding: 14px;
  }

  .nea-grid {
    display: grid;
    grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .nea-grid > .nea-card:first-child {
    position: sticky;
    top: 68px;
  }

  .nea-card {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
  }

  .nea-card-head {
    padding: 13px 14px;
    border-bottom: 1px solid var(--nea-soft-line);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }

  .nea-card-title {
    font-size: 13px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .nea-card-body {
    padding: 14px;
  }

  .nea-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .nea-form-grid-full {
    grid-column: 1 / -1;
  }

  .nea-list {
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 210px);
    overflow: auto;
  }

  .nea-item {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 8px;
  }

  .nea-item:hover {
    background: var(--nea-soft-blue);
  }

  .nea-item-title {
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
  }

  .nea-item-meta {
    color: var(--nea-muted);
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
  }

  .nea-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .nea-pill {
    display: inline-flex;
    width: fit-content;
    border: 1px solid var(--nea-soft-line);
    border-radius: 999px;
    background: #ffffff;
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1;
  }

  .nea-pill-blue {
    background: var(--nea-blue);
  }

  .nea-pill-green {
    background: var(--nea-green);
  }

  .nea-pill-yellow {
    background: var(--nea-yellow);
  }

  .nea-pill-red {
    background: var(--nea-red);
  }

  .nea-empty {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    padding: 18px;
    color: var(--nea-muted);
    font-size: 14px;
    line-height: 1.45;
  }

  .nea-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid var(--nea-line);
    border-top-color: transparent;
    border-radius: 50%;
    animation: nea-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
  }

  @keyframes nea-spin {
    to {
      transform: rotate(360deg);
    }
  }

  .nea-json-hint {
    margin-top: 8px;
    color: var(--nea-muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .nea-builder {
    grid-column: 1 / -1;
    border: 1px solid var(--nea-line);
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 12px;
  }

  .nea-builder-title {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .nea-quiz-question {
    border: 1px solid var(--nea-line);
    padding: 12px;
    background: var(--nea-soft-blue);
    display: grid;
    gap: 10px;
  }

  .nea-quiz-question-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }

  .nea-image-url-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }


  .nea-admin-search {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    margin-bottom: 12px;
    padding: 12px;
  }

  .nea-admin-search-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
  }

  .nea-admin-search-results {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
  }

  .nea-search-item {
    border: 1px solid var(--nea-soft-line);
    background: #ffffff;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
  }

  .nea-search-item:hover {
    background: var(--nea-soft-blue);
  }

  input[type="datetime-local"].nea-input {
    min-height: 37px;
  }

  input[type="datetime-local"].nea-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
  }

  .nea-card-body h4 {
    margin: 16px 0 8px;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  @media (max-width: 980px) {
    .nea-head,
    .nea-token,
    .nea-grid,
    .nea-form-grid,
    .nea-admin-search-line,
    .nea-search-item {
      grid-template-columns: 1fr;
    }

    .nea-head-stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      min-width: 0;
    }

    .nea-grid > .nea-card:first-child {
      position: relative;
      top: auto;
    }

    .nea-btn {
      width: 100%;
    }

    .nea-tabs {
      top: 0;
    }
  }


/* v21: вопросы учеников */
.nea-message-block {
  border: 1px solid var(--nea-soft-line);
  padding: 12px;
  background: #ffffff;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}

.nea-message-block.is-reply {
  background: var(--nea-green);
}

.nea-message-label {
  margin-bottom: 7px;
  color: var(--nea-muted);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* v24: accord formula builder and material rich toolbar */
.nea-formula-builder {
  border: 1px solid var(--nea-soft-line);
  background: #ffffff;
}

.nea-formula-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(90px, 0.6fr) minmax(90px, 0.6fr) minmax(150px, 1fr) 42px;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--nea-soft-line);
}

.nea-formula-row:last-child {
  border-bottom: 0;
}

.nea-formula-head {
  color: var(--nea-muted);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--nea-soft-blue);
}

.nea-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

@media (max-width: 820px) {
  .nea-formula-row {
    grid-template-columns: 1fr;
  }

  .nea-formula-head {
    display: none;
  }
}


/* v25: компактный и безопасный ввод формулы формулы */
.nea-formula-builder {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.nea-formula-row {
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.6fr) minmax(0, 0.6fr) minmax(0, 1fr) 34px;
  gap: 6px;
}

.nea-formula-row .nea-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

.nea-formula-row .nea-btn {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nea-formula-head {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.6fr) minmax(0, 0.6fr) minmax(0, 1fr) 34px;
}

@media (max-width: 1100px) {
  .nea-formula-row {
    grid-template-columns: 1fr 0.7fr;
  }

  .nea-formula-head {
    display: none;
  }

  .nea-formula-row .nea-btn {
    width: auto;
    min-width: 100%;
  }
}

@media (max-width: 720px) {
  .nea-formula-row {
    grid-template-columns: 1fr;
  }
}


/* v28: smaller formula table headers */
.nea-formula-head {
  font-size: 9px;
  letter-spacing: 0.04em;
}

.nea-formula-row {
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.56fr) minmax(0, 0.56fr) minmax(0, 0.96fr) 34px;
}

.nea-formula-head > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* v32: embedded material editor controls */
.nea-rich-toolbar {
  padding: 6px;
  border: 1px solid var(--nea-soft-line);
  background: #ffffff;
  border-radius: 12px;
}

.nea-rich-toolbar .nea-btn,
.nea-rich-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.nea-rich-toolbar .nea-btn:hover {
  background: #f7f7f8;
  color: #111;
}

.nea-rich-toolbar em {
  font-style: italic;
}


/* Admin v2 v1: NOMKAMO Online lab dashboard style */
#nomkamo-edu-admin-v2 {
  --nea-bg: #f5f5f7;
  --nea-card: #ffffff;
  --nea-text: #1d1d1f;
  --nea-muted: #6e6e73;
  --nea-line: rgba(29,29,31,0.10);
  --nea-soft-line: rgba(29,29,31,0.07);
  --nea-blue: #f0f0f2;
  --nea-soft-blue: #f7f7f8;
  --nea-green: #edf7ef;
  --nea-yellow: #fff7db;
  --nea-red: #ffe9e9;
  min-height: 100vh;
  background: var(--nea-bg);
  color: var(--nea-text);
  font-size: 13px;
}

.nea2-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.nea2-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid var(--nea-soft-line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nea2-logo {
  padding: 0 10px 8px;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.nea2-logo span {
  color: var(--nea-muted);
  white-space: nowrap;
}

.nea2-side-note {
  margin-top: auto;
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 14px;
  padding: 10px;
}

.nea2-side-note span {
  display: block;
  color: #8a8a90;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nea2-side-note b {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.nea2-main {
  min-width: 0;
  padding: 12px 12px 54px;
}

.nea-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.nea-head,
.nea-token,
.nea-admin-search,
.nea-panel,
.nea-card,
.nea-search-item,
.nea-submission,
.nea-list-card,
.nea-review-card,
.nea-message-card,
.nea-event-card {
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-head {
  padding: 18px;
  margin-bottom: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
}

.nea-label,
.nea-pill {
  border: 1px solid var(--nea-soft-line);
  background: #f7f7f8;
  color: var(--nea-muted);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 9.5px;
}

.nea-title {
  margin: 10px 0 0;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: .96;
  letter-spacing: -0.055em;
}

.nea-subtitle {
  margin-top: 12px;
  color: var(--nea-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.nea-head-stats {
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.nea-stat {
  border: 0;
  background: #f5f5f7;
  border-radius: 15px;
  padding: 11px;
}

.nea-stat-value {
  font-size: 20px;
  letter-spacing: -.04em;
}

.nea-stat-label {
  color: #8a8a90;
  font-size: 9px;
}

.nea-token {
  padding: 10px;
  margin-bottom: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

.nea-admin-search {
  padding: 10px;
  margin-bottom: 10px;
}

.nea-admin-search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.nea-tabs {
  display: grid;
  gap: 2px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}

.nea-tab {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  color: var(--nea-text);
}

.nea-tab:hover {
  background: #fbfbfc;
}

.nea-tab.is-active {
  background: #f0f0f2;
  color: #1d1d1f;
}

.nea-tab-label {
  font-size: 12px;
  font-weight: 600;
}

.nea-tab-count {
  min-width: 20px;
  min-height: 20px;
  border-radius: 999px;
  background: #ffffff;
  color: #6e6e73;
  border: 1px solid var(--nea-soft-line);
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.nea-status {
  min-height: 0;
  border: 0;
  border-radius: 14px;
  padding: 0;
  margin: 0 0 10px;
  color: var(--nea-muted);
  background: transparent;
}

.nea-status:not(:empty) {
  border: 1px solid var(--nea-soft-line);
  background: #ffffff;
  padding: 10px 12px;
}

.nea-status.is-error:not(:empty) {
  background: var(--nea-red);
  color: #9d1b1b;
}

.nea-status.is-ok:not(:empty) {
  background: var(--nea-green);
  color: #1d6c32;
}

.nea-panel {
  padding: 12px;
}

.nea-grid {
  gap: 12px;
}

.nea-card {
  overflow: hidden;
}

.nea-card-head {
  border-bottom: 1px solid var(--nea-soft-line);
  background: #ffffff;
  padding: 13px 14px;
}

.nea-card-title {
  font-size: 16px;
  letter-spacing: -.035em;
}

.nea-card-body {
  padding: 14px;
}

.nea-input,
.nea-select,
.nea-textarea {
  min-height: 36px;
  border: 1px solid var(--nea-soft-line);
  border-radius: 12px;
  background: #ffffff;
  padding: 9px 11px;
  font-size: 12px;
}

.nea-textarea {
  min-height: 118px;
}

.nea-field label {
  color: #8a8a90;
  font-size: 10px;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.nea-btn {
  min-height: 34px;
  border: 1px solid rgba(29,29,31,.10);
  border-radius: 14px;
  background: linear-gradient(180deg,#ffffff 0%,#f7f7f8 100%);
  color: #1d1d1f;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 1px rgba(0,0,0,.02);
}

.nea-btn:hover {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.nea-btn-primary {
  background: linear-gradient(180deg,#2b2b2d 0%,#171718 100%);
  border-color: #171718;
  color: #ffffff;
}

.nea-btn-primary:hover {
  background: #ffffff;
  color: #1d1d1f;
  border-color: rgba(29,29,31,.12);
}

.nea-row,
.nea-actions,
.nea-form-actions {
  gap: 8px;
}

.nea-table,
.nea-simple-table,
.nea-formula-table {
  border-color: var(--nea-soft-line);
  border-radius: 14px;
  overflow: hidden;
}

.nea-table th,
.nea-table td,
.nea-simple-table th,
.nea-simple-table td {
  border-color: var(--nea-soft-line);
  font-size: 12px;
}

.nea-empty {
  border: 1px dashed var(--nea-soft-line);
  background: #fbfbfc;
  color: var(--nea-muted);
  border-radius: 14px;
  padding: 14px;
}

.nea-rich-toolbar {
  border-radius: 12px;
  background: #fbfbfc;
}

@media (max-width: 980px) {
  .nea2-app {
    grid-template-columns: 1fr;
  }

  .nea2-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--nea-soft-line);
  }

  .nea-tabs {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .nea-head,
  .nea-token,
  .nea-admin-search-line {
    grid-template-columns: 1fr;
  }

  .nea-head-stats {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 560px) {
  .nea2-main,
  .nea2-sidebar {
    padding: 10px;
  }

  .nea-tabs,
  .nea-head-stats {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v2: simplified logical structure */
.nea-hub {
  display: grid;
  gap: 12px;
}

.nea-hub-hero {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  gap: 16px;
  align-items: end;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-hub-hero h2 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: .96;
  letter-spacing: -0.055em;
}

.nea-hub-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--nea-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.nea-hub-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.nea-hub-stats div {
  background: #f5f5f7;
  border-radius: 15px;
  padding: 11px;
}

.nea-hub-stats b {
  display: block;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -.04em;
}

.nea-hub-stats span {
  display: block;
  margin-top: 6px;
  color: #8a8a90;
  font-size: 10px;
  line-height: 1.15;
}

.nea-hub-stack {
  display: grid;
  gap: 12px;
}

.nea-hub-stack > .nea-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.nea-hub-stack .nea-grid {
  gap: 12px;
}

.nea-admin-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.nea-admin-home-card {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  padding: 14px;
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-admin-home-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  border-radius: 999px;
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 700;
}

.nea-admin-home-card h3 {
  margin: 12px 0 8px;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.nea-admin-home-card p {
  margin: 0;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.4;
}

.nea-link-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 14px;
}

.nea-link-preview-grid h4 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: -.02em;
}

.nea-simple-list {
  display: grid;
  gap: 8px;
}

@media (max-width: 1180px) {
  .nea-admin-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nea-hub-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nea-admin-home-grid,
  .nea-link-preview-grid,
  .nea-hub-stats {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v3: compact top, no sidebar scroll, login/password access */
#nomkamo-edu-admin-v2 {
  min-height: calc(100vh - 0px);
}

.nea2-app {
  min-height: calc(100vh - 0px);
}

.nea2-sidebar {
  height: 100vh;
  overflow: hidden;
  padding-top: 12px;
  padding-bottom: 12px;
}

.nea2-main {
  padding-top: 10px;
}

.nea-head {
  padding: 12px 14px;
  margin-bottom: 8px;
  min-height: 0;
  align-items: center;
}

.nea-title {
  font-size: clamp(28px, 3.5vw, 48px);
  margin-top: 6px;
}

.nea-subtitle {
  margin-top: 7px;
  font-size: 12px;
}

.nea-head-stats {
  gap: 7px;
}

.nea-stat {
  padding: 9px 10px;
  min-height: 54px;
}

.nea-stat-value {
  font-size: 18px;
}

.nea-admin-search {
  margin-bottom: 8px;
}

.nea-panel {
  padding: 10px;
}

.nea-hub-hero {
  padding: 14px;
}

.nea-hub-hero h2 {
  font-size: clamp(26px, 3.4vw, 46px);
  margin: 7px 0 7px;
}

.nea-hub-hero p {
  font-size: 12px;
}

.nea-admin-login {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: end;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
  margin-bottom: 8px;
}

.nea-admin-login h2 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: .96;
  letter-spacing: -.055em;
}

.nea-admin-login p {
  margin: 0;
  max-width: 660px;
  color: var(--nea-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.nea-admin-login-form {
  display: grid;
  gap: 9px;
}

.nea-authbar {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-authbar span,
.nea2-login-mini {
  display: block;
  color: #8a8a90;
  font-size: 10px;
  line-height: 1.3;
}

.nea-authbar b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.nea2-login-mini {
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 14px;
  padding: 10px;
}

@media (max-width: 980px) {
  .nea2-sidebar {
    height: auto;
    overflow: visible;
  }

  .nea-admin-login,
  .nea-authbar {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v4: remove duplicate homepage hero, move auth info to sidebar */
.nea-hub-home {
  margin-top: 0;
}

.nea2-authbox {
  margin-top: auto;
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.nea2-authbox span {
  display: block;
  color: #8a8a90;
  font-size: 9px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nea2-authbox b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.nea2-authbox-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.nea2-authbox-actions .nea-btn {
  min-height: 30px;
  border-radius: 11px;
  padding: 6px 8px;
  font-size: 11px;
}

.nea-authbar {
  display: none;
}

.nea-admin-home-grid {
  margin-top: 0;
}

.nea2-sidebar {
  overflow: hidden;
}

@media (max-width: 980px) {
  .nea2-authbox {
    margin-top: 8px;
  }
}


/* Admin v2 v5: courses workspace, no global top outside main */
.nea2-main > .nea-head + .nea-admin-search {
  margin-top: 8px;
}

.nea-course-section {
  display: grid;
  gap: 10px;
}

.nea-course-toolbar {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 14px;
  align-items: end;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-course-toolbar h2 {
  margin: 8px 0 6px;
  font-size: clamp(25px, 3vw, 42px);
  line-height: .98;
  letter-spacing: -.05em;
}

.nea-course-toolbar p {
  margin: 0;
  max-width: 760px;
  color: var(--nea-muted);
  font-size: 12px;
  line-height: 1.4;
}

.nea-course-toolbar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.nea-course-toolbar-stats div,
.nea-course-public-stats div {
  background: #f5f5f7;
  border-radius: 14px;
  padding: 10px;
}

.nea-course-toolbar-stats b,
.nea-course-public-stats b {
  display: block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.04em;
}

.nea-course-toolbar-stats span,
.nea-course-public-stats span {
  display: block;
  margin-top: 5px;
  color: #8a8a90;
  font-size: 10px;
}

.nea-course-main-grid {
  display: grid;
  grid-template-columns: minmax(310px, .85fr) minmax(0, 1.15fr);
  gap: 10px;
}

.nea-course-public-card {
  display: grid;
  gap: 12px;
}

.nea-course-public-cover,
.nea-course-cover-preview {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfbfc 0%, #f1f1f3 100%);
  border: 1px solid var(--nea-soft-line);
  min-height: 190px;
  display: grid;
  place-items: center;
}

.nea-course-public-cover img,
.nea-course-cover-preview img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  display: block;
}

.nea-course-public-cover span,
.nea-course-cover-preview span {
  color: #8a8a90;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nea-course-public-body h3 {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.055em;
}

.nea-course-public-body p {
  margin: 0;
  color: var(--nea-muted);
  font-size: 12px;
  line-height: 1.45;
}

.nea-course-public-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 7px;
  margin-top: 12px;
}

.nea-course-image-uploader {
  display: grid;
  gap: 10px;
}

.nea-course-upload-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.nea-file-input {
  max-width: 260px;
  font-size: 12px;
}

.nea-small-link {
  color: #1d1d1f;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid rgba(29,29,31,.25);
}

.nea-course-subgrid,
.nea-course-editor-stack {
  display: grid;
  gap: 10px;
}

.nea-course-map {
  display: grid;
  gap: 8px;
}

.nea-course-module-card {
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 16px;
  padding: 12px;
}

.nea-course-module-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: start;
}

.nea-course-module-head span {
  display: block;
  color: #8a8a90;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.nea-course-module-head h3 {
  margin: 5px 0;
  font-size: 17px;
  letter-spacing: -.035em;
}

.nea-course-module-head p {
  margin: 0;
  color: var(--nea-muted);
  font-size: 12px;
  line-height: 1.4;
}

.nea-course-lesson-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.nea-course-lesson-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 14px;
  padding: 10px;
}

.nea-course-lesson-row b {
  display: block;
  font-size: 13px;
}

.nea-course-lesson-row span {
  display: block;
  margin-top: 4px;
  color: #8a8a90;
  font-size: 11px;
}

@media (max-width: 1080px) {
  .nea-course-main-grid,
  .nea-course-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nea-course-toolbar-stats,
  .nea-course-public-stats {
    grid-template-columns: 1fr;
  }

  .nea-course-module-head,
  .nea-course-lesson-row {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v6: course list -> open course -> edit structure inside */
.nea-course-list-top {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-course-list-top h2 {
  margin: 8px 0 6px;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: .96;
  letter-spacing: -.055em;
}

.nea-course-list-top p {
  margin: 0;
  max-width: 780px;
  color: var(--nea-muted);
  font-size: 12px;
  line-height: 1.4;
}

.nea-course-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.nea-admin-course-card {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  overflow: hidden;
  min-height: 380px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-admin-course-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.045);
}

.nea-admin-course-cover {
  min-height: 128px;
  background: linear-gradient(180deg, #fbfbfc 0%, #f1f1f3 100%);
  display: grid;
  place-items: center;
}

.nea-admin-course-cover img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.nea-admin-course-cover span {
  color: #8a8a90;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nea-admin-course-body {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.nea-admin-course-body h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.06;
  letter-spacing: -.045em;
}

.nea-admin-course-body p {
  margin: 0;
  color: var(--nea-muted);
  font-size: 12px;
  line-height: 1.4;
}

.nea-admin-course-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.nea-admin-course-stats div {
  background: #f5f5f7;
  border-radius: 14px;
  padding: 9px;
}

.nea-admin-course-stats b {
  display: block;
  font-size: 17px;
  line-height: 1;
}

.nea-admin-course-stats span {
  display: block;
  margin-top: 5px;
  color: #8a8a90;
  font-size: 9.5px;
}

.nea-admin-course-actions {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--nea-soft-line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nea-back-btn {
  width: fit-content;
  border: 0;
  background: transparent;
  color: #1d1d1f;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.nea-course-editor-stack > .nea-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .nea-course-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .nea-course-list-top {
    grid-template-columns: 1fr;
  }

  .nea-course-list-grid {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v7: course structure inline editing */
.nea-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nea-course-module-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nea-course-lesson-row-wrap {
  display: grid;
  gap: 8px;
}

.nea-course-lesson-row {
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto) auto;
}

.nea-course-lesson-main {
  min-width: 0;
}

.nea-free-toggle {
  min-height: 34px;
  border: 1px solid var(--nea-soft-line);
  border-radius: 999px;
  background: #fbfbfc;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  cursor: pointer;
  white-space: nowrap;
  color: #1d1d1f;
  font-size: 11px;
}

.nea-free-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #1d1d1f;
}

.nea-free-toggle:has(input:checked) {
  background: #edf7ef;
  border-color: rgba(38, 126, 61, .18);
}

.nea-inline-editor {
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(29,29,31,.10);
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-inline-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nea-inline-editor-head b {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.nea-inline-editor-head span {
  display: block;
  margin-top: 4px;
  color: #8a8a90;
  font-size: 11px;
  line-height: 1.3;
}

.nea-inline-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nea-inline-form-grid .nea-field:has(textarea),
.nea-inline-form-grid .nea-field:has([data-nea-key="description"]) {
  grid-column: 1 / -1;
}

.nea-inline-form-grid textarea {
  min-height: 92px;
}

.nea-course-editor-stack {
  display: none;
}

@media (max-width: 940px) {
  .nea-course-lesson-row {
    grid-template-columns: 1fr;
  }

  .nea-course-module-actions,
  .nea-course-lesson-actions {
    justify-content: flex-start;
  }

  .nea-inline-form-grid {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v9: correct course count + purchase/access modes */
.nea-pill-mode {
  background: #f0f0f2;
  color: #1d1d1f;
}

.nea-admin-course-card .nea-pill-mode {
  font-weight: 700;
}

.nea-course-edit-card .nea-form-grid {
  align-items: start;
}


/* Admin v2 v10: purchase mode fallback */
.nea-pill-mode {
  white-space: nowrap;
}


/* Admin v2 v11: human students section */
.nea-students-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.nea-students-list-panel,
.nea-student-empty,
.nea-student-profile-hero,
.nea-student-stat,
.nea-student-access-card,
.nea-student-course-card,
.nea-student-recent-item {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-students-list-panel {
  position: sticky;
  top: 10px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.nea-students-list-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}

.nea-students-list-head h2 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: .98;
  letter-spacing: -.05em;
}

.nea-students-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.nea-students-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 2px;
}

.nea-student-row {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 15px;
  padding: 9px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.nea-student-row:hover,
.nea-student-row.is-active {
  background: #f5f5f7;
  border-color: var(--nea-soft-line);
}

.nea-student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f0f0f2;
  color: #1d1d1f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.nea-student-avatar.is-large {
  width: 54px;
  height: 54px;
  font-size: 22px;
}

.nea-student-row-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.nea-student-row-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.15;
}

.nea-student-row-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8a8a90;
  font-style: normal;
  font-size: 11px;
}

.nea-student-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.nea-student-empty {
  min-height: 360px;
  padding: 24px;
  display: grid;
  align-content: center;
}

.nea-student-empty h2 {
  margin: 10px 0;
  font-size: clamp(34px, 5vw, 72px);
  line-height: .92;
  letter-spacing: -.06em;
}

.nea-student-empty p {
  margin: 0;
  max-width: 520px;
  color: var(--nea-muted);
  font-size: 13px;
  line-height: 1.45;
}

.nea-student-profile-hero {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.nea-student-profile-title {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.nea-student-profile-title h1 {
  margin: 8px 0 5px;
  font-size: clamp(28px, 3.8vw, 52px);
  line-height: .96;
  letter-spacing: -.055em;
}

.nea-student-profile-title p {
  margin: 0;
  color: var(--nea-muted);
  font-size: 12px;
}

.nea-student-profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nea-student-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.nea-student-stat {
  padding: 12px;
}

.nea-student-stat b {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.nea-student-stat span {
  display: block;
  margin-top: 5px;
  color: #8a8a90;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.nea-student-layout-grid {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr);
  gap: 12px;
  align-items: start;
}

.nea-student-left-stack,
.nea-student-right-stack {
  display: grid;
  gap: 12px;
}

.nea-student-access-list,
.nea-student-course-activity,
.nea-student-recent-list {
  display: grid;
  gap: 8px;
}

.nea-student-access-card,
.nea-student-course-card,
.nea-student-recent-item {
  padding: 12px;
}

.nea-student-access-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.nea-student-access-card h3,
.nea-student-course-card h3 {
  margin: 8px 0 5px;
  font-size: 15px;
  line-height: 1.12;
  letter-spacing: -.03em;
}

.nea-student-access-card p,
.nea-student-course-card p {
  margin: 0;
  color: #8a8a90;
  font-size: 11.5px;
  line-height: 1.35;
}

.nea-student-course-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.nea-student-course-top b {
  font-size: 20px;
  line-height: 1;
  letter-spacing: -.04em;
}

.nea-progress-line {
  height: 6px;
  background: #f0f0f2;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.nea-progress-line span {
  display: block;
  height: 100%;
  background: #1d1d1f;
  border-radius: 999px;
}

.nea-student-recent-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.nea-student-recent-item > span {
  height: 26px;
  border-radius: 999px;
  background: #f5f5f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6e6e73;
  font-size: 10px;
  font-weight: 700;
}

.nea-student-recent-item b {
  display: block;
  font-size: 12px;
}

.nea-student-recent-item em {
  display: block;
  color: #8a8a90;
  font-size: 11px;
  font-style: normal;
  margin-top: 2px;
}

.nea-students-create {
  display: grid;
  gap: 12px;
}

@media (max-width: 1180px) {
  .nea-students-workspace,
  .nea-student-layout-grid {
    grid-template-columns: 1fr;
  }

  .nea-students-list-panel {
    position: relative;
    top: auto;
  }

  .nea-students-list {
    max-height: 420px;
  }
}

@media (max-width: 760px) {
  .nea-student-profile-hero,
  .nea-student-access-card,
  .nea-student-course-top {
    grid-template-columns: 1fr;
  }

  .nea-student-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nea-student-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .nea-student-row .nea-pill {
    grid-column: 2;
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .nea-student-stat-grid {
    grid-template-columns: 1fr;
  }
}


/* Admin v2 v12: human homework section */
.nea-homework-admin {
  display: grid;
  gap: 12px;
}

.nea-homework-hero,
.nea-homework-type-note,
.nea-homework-editor-card {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-homework-hero {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  gap: 14px;
  align-items: end;
}

.nea-homework-hero h2 {
  margin: 8px 0 6px;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: .96;
  letter-spacing: -.055em;
}

.nea-homework-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--nea-muted);
  font-size: 12px;
  line-height: 1.42;
}

.nea-homework-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.nea-homework-stats div {
  background: #f5f5f7;
  border-radius: 14px;
  padding: 10px;
}

.nea-homework-stats b {
  display: block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.04em;
}

.nea-homework-stats span {
  display: block;
  margin-top: 5px;
  color: #8a8a90;
  font-size: 10px;
}

.nea-homework-type-note {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #6e6e73;
  font-size: 12px;
}

.nea-homework-type-note b {
  color: #1d1d1f;
}

.nea-homework-type-note span {
  background: #f5f5f7;
  border: 1px solid var(--nea-soft-line);
  border-radius: 999px;
  padding: 5px 9px;
  color: #1d1d1f;
  font-size: 11px;
}

.nea-homework-type-note em {
  margin-left: auto;
  color: #8a8a90;
  font-style: normal;
  font-size: 11px;
}

.nea-homework-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 12px;
  align-items: start;
}

.nea-homework-inbox-card,
.nea-homework-library-card {
  min-width: 0;
}

.nea-card-subtitle {
  margin-top: 4px;
  color: #8a8a90;
  font-size: 11px;
  line-height: 1.35;
}

.nea-homework-filter-row {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.nea-homework-inbox-list,
.nea-homework-library-list {
  display: grid;
  gap: 8px;
}

.nea-submission-card,
.nea-homework-card {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.018);
}

.nea-submission-card {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.nea-submission-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.nea-submission-card h3,
.nea-homework-card h3 {
  margin: 8px 0 5px;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.nea-submission-card p,
.nea-homework-card p {
  margin: 0;
  color: #8a8a90;
  font-size: 11.5px;
  line-height: 1.35;
}

.nea-submission-date {
  color: #8a8a90;
  font-size: 10.5px;
  white-space: nowrap;
}

.nea-submission-answer {
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.nea-answer-text {
  color: #1d1d1f;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.45;
}

.nea-answer-json {
  margin: 0;
  white-space: pre-wrap;
  font-size: 11px;
  color: #6e6e73;
}

.nea-answer-image {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #1d1d1f;
  text-decoration: none;
}

.nea-answer-image img {
  width: 92px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
  background: #f0f0f2;
}

.nea-answer-image span {
  font-size: 12px;
  font-weight: 600;
}

.nea-answer-formula {
  display: grid;
  gap: 5px;
}

.nea-answer-formula-head,
.nea-answer-formula-row {
  display: grid;
  grid-template-columns: 1.1fr .55fr .55fr 1fr;
  gap: 6px;
  align-items: start;
}

.nea-answer-formula-head span {
  color: #8a8a90;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.nea-answer-formula-row {
  background: #ffffff;
  border: 1px solid var(--nea-soft-line);
  border-radius: 10px;
  padding: 8px;
  font-size: 11.5px;
  line-height: 1.3;
}

.nea-submission-review {
  display: grid;
  gap: 10px;
}

.nea-homework-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.nea-homework-card-main {
  border: 0;
  background: #ffffff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.nea-homework-card-main:hover {
  background: #fbfbfc;
}

.nea-homework-card-actions {
  border-left: 1px solid var(--nea-soft-line);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 7px;
}

.nea-homework-editor-card .nea-card-body {
  display: grid;
  gap: 12px;
}

.nea-homework-type-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.nea-homework-type-choice {
  position: relative;
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  min-height: 92px;
}

.nea-homework-type-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nea-homework-type-choice span {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.025em;
}

.nea-homework-type-choice em {
  color: #8a8a90;
  font-size: 11px;
  font-style: normal;
}

.nea-homework-type-choice.is-active,
.nea-homework-type-choice:has(input:checked) {
  background: #ffffff;
  border-color: rgba(29,29,31,.28);
  box-shadow: 0 0 0 2px rgba(29,29,31,.06);
}

.nea-homework-editor-grid {
  align-items: start;
}

.nea-builder {
  border: 1px solid var(--nea-soft-line);
  background: #fbfbfc;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.nea-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.nea-builder-head p {
  margin: 4px 0 0;
  color: #8a8a90;
  font-size: 11.5px;
  line-height: 1.35;
}

.nea-image-mini-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #f0f0f2;
  overflow: hidden;
  margin-bottom: 7px;
}

.nea-image-mini-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1200px) {
  .nea-homework-main-grid {
    grid-template-columns: 1fr;
  }

  .nea-homework-type-note em {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .nea-homework-hero {
    grid-template-columns: 1fr;
  }

  .nea-homework-type-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nea-homework-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nea-homework-filter-row,
  .nea-submission-card-head,
  .nea-homework-card,
  .nea-answer-formula-head,
  .nea-answer-formula-row,
  .nea-answer-image {
    grid-template-columns: 1fr;
  }

  .nea-homework-card-actions {
    border-left: 0;
    border-top: 1px solid var(--nea-soft-line);
  }

  .nea-homework-type-picker {
    grid-template-columns: 1fr;
  }

  .nea-submission-date {
    white-space: normal;
  }
}

/* Admin v2 v14-full: ДЗ — показываем все созданные задания через отдельный backend action.
   Стиль v12 сохранён, меняется только порядок и читабельность списка. */

.nea-homework-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.nea-homework-library-card {
  order: 1;
}

.nea-homework-inbox-card {
  order: 2;
}

.nea-homework-library-list,
.nea-homework-inbox-list {
  max-height: none;
}

@media (min-width: 1201px) {
  .nea-homework-library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .nea-homework-library-list {
    grid-template-columns: 1fr;
  }
}

/* Admin v2 v15: ДЗ — удалён информационный блок «4 типа ДЗ», добавлен архив проверенных работ. */

.nea-homework-inbox-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  align-items: center;
}

.nea-homework-inbox-tools .nea-select {
  width: auto;
  max-width: 190px;
}

@media (max-width: 760px) {
  .nea-homework-inbox-tools {
    justify-content: flex-start;
    width: 100%;
  }

  .nea-homework-inbox-tools .nea-btn,
  .nea-homework-inbox-tools .nea-select {
    width: 100%;
    max-width: none;
  }
}

/* Admin v2 v16: исправлен выбор типа ДЗ. Карточки типа теперь кнопки, а не radio внутри label. */

.nea-homework-type-choice {
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--nea-text);
}

.nea-homework-type-choice:hover {
  background: #ffffff;
  border-color: rgba(29,29,31,.22);
  box-shadow: 0 2px 10px rgba(0,0,0,.035);
}

.nea-homework-type-choice:focus-visible {
  outline: 2px solid rgba(29,29,31,.22);
  outline-offset: 2px;
}

/* Admin v2 v17: левый счётчик «Домашние задания» показывает только созданные ДЗ, без работ учеников. */


/* Admin v2 v18: человеческий раздел «Занятия» */

.nea-events-admin {
  display: grid;
  gap: 16px;
}

.nea-events-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 24px;
  background: #fff;
}

.nea-events-hero h2 {
  margin: 10px 0 6px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .9;
  letter-spacing: -.07em;
}

.nea-events-hero p {
  margin: 0;
  max-width: 760px;
  color: #7b7b82;
  font-size: 14px;
  line-height: 1.35;
}

.nea-events-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nea-event-form-card,
.nea-events-list-card {
  overflow: hidden;
}

.nea-event-type-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.nea-event-type-choice {
  appearance: none;
  border: 1px solid rgba(29,29,31,.1);
  border-radius: 18px;
  background: #f7f7f8;
  padding: 14px;
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.nea-event-type-choice span {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -.03em;
}

.nea-event-type-choice em {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.3;
  color: #8a8a90;
  font-style: normal;
}

.nea-event-type-choice:hover,
.nea-event-type-choice.is-active {
  background: #fff;
  border-color: rgba(29,29,31,.34);
  box-shadow: 0 6px 18px rgba(0,0,0,.045);
}

.nea-event-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nea-events-list {
  display: grid;
  gap: 8px;
}

.nea-event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  background: #fff;
}

.nea-event-card.is-past {
  background: #fafafa;
}

.nea-event-card h3 {
  margin: 8px 0 5px;
  font-size: 18px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.nea-event-card p {
  margin: 0 0 4px;
  color: #77777d;
  font-size: 13px;
  line-height: 1.35;
}

.nea-event-card-desc,
.nea-event-card-meta {
  margin-top: 8px;
  color: #8a8a90;
  font-size: 12px;
  line-height: 1.35;
}

.nea-event-card-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-width: 132px;
}

@media (max-width: 860px) {
  .nea-events-hero {
    display: block;
  }

  .nea-events-hero-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .nea-event-form-grid,
  .nea-event-type-picker {
    grid-template-columns: 1fr;
  }

  .nea-event-card {
    grid-template-columns: 1fr;
  }

  .nea-event-card-actions {
    flex-direction: row;
    justify-content: flex-start;
    min-width: 0;
  }
}


/* Admin v2 v19: человеческий раздел «Библиотека» */

.nea-library-admin {
  display: grid;
  gap: 16px;
}

.nea-library-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 24px;
  background: #fff;
}

.nea-library-hero h2 {
  margin: 10px 0 6px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .9;
  letter-spacing: -.07em;
}

.nea-library-hero p {
  margin: 0;
  max-width: 780px;
  color: #7b7b82;
  font-size: 14px;
  line-height: 1.35;
}

.nea-library-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nea-library-list-card,
.nea-library-editor-card {
  overflow: hidden;
}

.nea-library-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nea-library-editor-grid .nea-form-grid-full {
  grid-column: 1 / -1;
}

.nea-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 7px;
}

.nea-rich-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.nea-library-lesson-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  background: #f7f7f8;
}

.nea-library-lesson-block h4 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: -.03em;
}

.nea-library-lesson-block p {
  margin: 0 0 12px;
  color: #85858b;
  font-size: 12px;
}

.nea-library-lessons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 310px;
  overflow: auto;
}

.nea-library-lesson-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.nea-library-lesson-choice input {
  margin-top: 3px;
  accent-color: #1d1d1f;
}

.nea-library-lesson-choice b {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  color: #1d1d1f;
}

.nea-library-lesson-choice em {
  display: block;
  margin-top: 3px;
  color: #8a8a90;
  font-size: 11px;
  line-height: 1.2;
  font-style: normal;
}

.nea-library-card-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nea-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  background: #fff;
}

.nea-library-item h3 {
  margin: 8px 0 5px;
  font-size: 18px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.nea-library-item p {
  margin: 0 0 8px;
  color: #77777d;
  font-size: 13px;
  line-height: 1.35;
}

.nea-library-item-link,
.nea-library-item-lessons {
  margin-top: 7px;
  color: #8a8a90;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.nea-library-item-lessons::before {
  content: 'уроки: ';
  color: #b0b0b5;
}

.nea-library-item-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-width: 132px;
}

@media (max-width: 860px) {
  .nea-library-hero {
    display: block;
  }

  .nea-library-hero-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .nea-library-editor-grid,
  .nea-library-lessons {
    grid-template-columns: 1fr;
  }

  .nea-library-item {
    grid-template-columns: 1fr;
  }

  .nea-library-item-actions {
    flex-direction: row;
    justify-content: flex-start;
    min-width: 0;
  }
}

/* Admin v2 v20: библиотека — вкладки и компактный список «только название» */

.nea-library-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin: 0 0 12px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
}

.nea-library-tab {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 9px 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: #77777d;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.nea-library-tab.is-active {
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.nea-library-item-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 12px;
}

.nea-library-item-title-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 0;
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.035em;
  color: #1d1d1f;
  cursor: pointer;
}

.nea-library-item-title-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nea-library-item-compact .nea-library-item-actions {
  flex-direction: row;
  min-width: 0;
}

@media (max-width: 760px) {
  .nea-library-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    border-radius: 18px;
  }

  .nea-library-tab {
    width: 100%;
  }

  .nea-library-item-compact {
    grid-template-columns: 1fr;
  }

  .nea-library-item-compact .nea-library-item-actions {
    width: 100%;
  }

  .nea-library-item-compact .nea-library-item-actions .nea-btn {
    flex: 1;
  }
}


/* Admin v2 v21: раздел «Компоненты» */

.nea-components-admin {
  display: grid;
  gap: 16px;
}

.nea-components-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 24px;
  background: #fff;
}

.nea-components-hero h2 {
  margin: 10px 0 6px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .9;
  letter-spacing: -.07em;
}

.nea-components-hero p {
  margin: 0;
  max-width: 820px;
  color: #7b7b82;
  font-size: 14px;
  line-height: 1.35;
}

.nea-components-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nea-component-editor-card,
.nea-components-list-card {
  overflow: hidden;
}

.nea-component-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nea-component-form-grid .nea-form-grid-full {
  grid-column: 1 / -1;
}

.nea-components-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin: 0 0 12px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
}

.nea-components-tab {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 9px 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: #77777d;
}

.nea-components-tab.is-active {
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.nea-component-checkgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.nea-component-check {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
  font-size: 12px;
  cursor: pointer;
}

.nea-component-check input {
  accent-color: #1d1d1f;
}

.nea-component-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nea-component-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  background: #fff;
}

.nea-component-item h3 {
  margin: 8px 0 4px;
  font-size: 18px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.nea-component-item p {
  margin: 0 0 8px;
  color: #77777d;
  font-size: 13px;
}

.nea-component-actions {
  display: flex;
  gap: 7px;
}

.nea-pyramid-display {
  display: inline-grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 6px;
  max-width: 360px;
  padding: 4px;
  border: 1px solid rgba(29,29,31,.12);
  border-radius: 999px;
  background: #fff;
}

.nea-pyramid-display span {
  height: 42px;
  border: 1px solid rgba(29,29,31,.12);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fafafa;
}

.nea-pyramid-display span i {
  width: 28px;
  height: 24px;
  display: block;
  background:
    linear-gradient(to bottom,
      transparent 0 0,
      #b9b9b9 0 2px,
      transparent 2px 6px,
      #b9b9b9 6px 8px,
      transparent 8px 12px,
      #b9b9b9 12px 14px,
      transparent 14px 18px,
      #b9b9b9 18px 20px,
      transparent 20px 24px);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: .65;
}

.nea-pyramid-display span.is-active i {
  background:
    linear-gradient(to bottom,
      transparent 0 0,
      #1d1d1f 0 2px,
      transparent 2px 6px,
      #1d1d1f 6px 8px,
      transparent 8px 12px,
      #1d1d1f 12px 14px,
      transparent 14px 18px,
      #1d1d1f 18px 20px,
      transparent 20px 24px);
  opacity: 1;
}

.nea-component-family-list {
  display: grid;
  gap: 8px;
}

.nea-component-family-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 16px;
  background: #fff;
}

.nea-component-family-item > span {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #d8d8d8;
}

.nea-component-family-item b {
  font-size: 15px;
  letter-spacing: -.03em;
}

.nea-component-family-item em {
  color: #8a8a90;
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 860px) {
  .nea-components-hero {
    display: block;
  }

  .nea-components-hero-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .nea-component-form-grid {
    grid-template-columns: 1fr;
  }

  .nea-component-item {
    grid-template-columns: 1fr;
  }

  .nea-component-actions {
    flex-wrap: wrap;
  }

  .nea-components-tabs {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 18px;
    width: 100%;
  }

  .nea-component-family-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .nea-component-family-item .nea-btn,
  .nea-component-family-item em {
    grid-column: 1 / -1;
  }
}


/* Admin v2 v22: компоненты — просмотр карточки, компактный список, поиск в подборках */

.nea-component-info-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(29,29,31,.07);
}

.nea-component-info-row span {
  color: #8a8a90;
  font-size: 12px;
  line-height: 1.3;
}

.nea-component-info-row b {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-wrap;
}

.nea-component-info-row.is-pyramid {
  align-items: center;
}

.nea-component-view-grid {
  display: grid;
  gap: 0;
}

.nea-component-time-grid {
  display: grid;
  gap: 8px;
}

.nea-component-time-grid .nea-field {
  margin: 0;
}

.nea-component-picker {
  display: grid;
  gap: 8px;
}

.nea-component-picker-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 16px;
  background: #f7f7f8;
}

.nea-component-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(29,29,31,.07);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.nea-component-picker-row input {
  accent-color: #1d1d1f;
}

.nea-component-picker-row span {
  font-size: 13px;
  line-height: 1.25;
  color: #1d1d1f;
}

.nea-component-item .nea-pyramid-display {
  display: none;
}

@media (max-width: 760px) {
  .nea-component-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* Admin v2 v23: рабочие растворы, блоки формы, компактный список компонентов */

.nea-component-section {
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 20px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
}

.nea-component-section-head {
  margin-bottom: 12px;
}

.nea-component-section-head h4 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.nea-component-section-head p {
  margin: 0;
  color: #8a8a90;
  font-size: 12px;
  line-height: 1.35;
}

.nea-component-item-compact {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 0;
  padding: 8px 10px;
}

.nea-component-title h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.nea-component-title p {
  margin: 2px 0 0;
  color: #8a8a90;
  font-size: 11px;
  line-height: 1.2;
}

.nea-component-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 170px;
}

.nea-component-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 8px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
  color: #67676d;
  font-size: 11px;
  line-height: 1;
}

.nea-component-item-compact .nea-component-actions {
  gap: 5px;
}

.nea-component-item-compact .nea-btn {
  min-height: 30px;
  padding: 7px 10px;
  font-size: 12px;
}

.nea-component-view-grid .nea-pyramid-display,
.nea-component-info-row.is-pyramid .nea-pyramid-display {
  max-width: 220px;
  grid-template-columns: repeat(5, 34px);
  gap: 4px;
  padding: 3px;
}

.nea-component-view-grid .nea-pyramid-display span,
.nea-component-info-row.is-pyramid .nea-pyramid-display span {
  height: 30px;
}

.nea-component-view-grid .nea-pyramid-display span i,
.nea-component-info-row.is-pyramid .nea-pyramid-display span i {
  width: 20px;
  height: 17px;
}

.nea-component-selected-line {
  color: #8a8a90;
  font-size: 12px;
}

.nea-component-picker-row.is-selected {
  border-color: rgba(29,29,31,.2);
  background: #fff;
}

@media (max-width: 980px) {
  .nea-component-item-compact {
    grid-template-columns: 1fr;
  }

  .nea-component-meta {
    justify-content: flex-start;
    min-width: 0;
  }
}


/* Admin v2 v24: компоненты — метки рядом с названием, понятная пирамида, стабильные чекбоксы */

.nea-component-item-compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.nea-component-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nea-component-title {
  min-width: 0;
}

.nea-component-title h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nea-component-title-row .nea-component-meta {
  justify-content: flex-start;
  min-width: 0;
  flex-shrink: 0;
}

.nea-pyramid-display-v24 {
  display: grid;
  grid-template-columns: repeat(5, minmax(62px, 1fr));
  gap: 0;
  width: min(100%, 470px);
  margin: 0 auto;
  padding: 5px;
  border: 1px solid rgba(29,29,31,.15);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.nea-pyramid-display-v24 span {
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 5px 6px;
  border-right: 1px solid rgba(29,29,31,.1);
  background: #f9f9f9;
  text-align: center;
}

.nea-pyramid-display-v24 span:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.nea-pyramid-display-v24 span:last-child {
  border-right: 0;
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.nea-pyramid-display-v24 i {
  width: 18px;
  height: 14px;
  display: block;
  background:
    linear-gradient(to bottom,
      transparent 0 0,
      #c3c3c3 0 2px,
      transparent 2px 5px,
      #c3c3c3 5px 7px,
      transparent 7px 10px,
      #c3c3c3 10px 12px,
      transparent 12px 14px);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: .7;
}

.nea-pyramid-display-v24 b {
  display: block;
  color: #9a9aa0;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.nea-pyramid-display-v24 span.is-active {
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(29,29,31,.72);
  position: relative;
  z-index: 2;
}

.nea-pyramid-display-v24 span.is-active i {
  background:
    linear-gradient(to bottom,
      transparent 0 0,
      #1d1d1f 0 2px,
      transparent 2px 5px,
      #1d1d1f 5px 7px,
      transparent 7px 10px,
      #1d1d1f 10px 12px,
      transparent 12px 14px);
  opacity: 1;
}

.nea-pyramid-display-v24 span.is-active b {
  color: #1d1d1f;
  font-weight: 800;
}

@media (max-width: 900px) {
  .nea-component-item-compact {
    grid-template-columns: 1fr;
  }

  .nea-component-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .nea-pyramid-display-v24 {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .nea-pyramid-display-v24 span,
  .nea-pyramid-display-v24 span:first-child,
  .nea-pyramid-display-v24 span:last-child {
    border-radius: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(29,29,31,.1);
  }

  .nea-pyramid-display-v24 span:last-child {
    border-bottom: 0;
  }
}


/* Admin v2 v25: пирамида компонента — меньше и по левому краю */

.nea-component-info-row.is-pyramid {
  align-items: start;
}

.nea-component-info-row.is-pyramid .nea-pyramid-display-v24,
.nea-component-view-grid .nea-pyramid-display-v24 {
  width: 320px;
  max-width: 100%;
  margin: 0;
  grid-template-columns: repeat(5, 64px);
  padding: 3px;
}

.nea-component-info-row.is-pyramid .nea-pyramid-display-v24 span,
.nea-component-view-grid .nea-pyramid-display-v24 span {
  min-height: 40px;
  padding: 4px 5px;
}

.nea-component-info-row.is-pyramid .nea-pyramid-display-v24 i,
.nea-component-view-grid .nea-pyramid-display-v24 i {
  width: 14px;
  height: 11px;
}

.nea-component-info-row.is-pyramid .nea-pyramid-display-v24 b,
.nea-component-view-grid .nea-pyramid-display-v24 b {
  font-size: 8px;
  line-height: 1;
}

@media (max-width: 900px) {
  .nea-component-info-row.is-pyramid .nea-pyramid-display-v24,
  .nea-component-view-grid .nea-pyramid-display-v24 {
    width: 100%;
    grid-template-columns: 1fr;
  }
}

/* Admin v2 v29: emergency rollback to stable v25 base. */


/* Admin v2 v30: мягкий ремонт кликов */
.nea2-app {
  min-height: 70vh;
}

.nea-status:not(:empty) {
  transition: opacity .18s ease;
}

/* Admin v2 v33: admin_course_content fallback repair. */

/* Admin v2 v34: submissions isolation and fallback. */

/* Admin v2 v35: admin_messages fallback repair. */


/* Admin v2 v36: несколько семейств и цена компонента */
.nea-component-title-row .nea-component-meta {
  flex-wrap: wrap;
}


/* Admin v2 v37: component scroll and Russian title styling */
.nea-component-title .nea-component-title-ru {
  margin-top: 4px;
  color: #8a8a90;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 400;
}

/* Admin v2 v37: scroll behavior after component open/save. */

/* Admin v2 v38: component form waits for families/lists before opening. */

/* Admin v2 v39: component save no longer fails on component list sync resource exhaustion. */


/* Admin v2 v40: safe human formulas step 1 */
.nea-formulas-admin {
  display: grid;
  gap: 16px;
}

.nea-formulas-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 24px;
  background: #fff;
}

.nea-formulas-hero h2 {
  margin: 10px 0 6px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .9;
  letter-spacing: -.07em;
}

.nea-formulas-hero p {
  margin: 0;
  max-width: 820px;
  color: #7b7b82;
  font-size: 14px;
  line-height: 1.35;
}

.nea-formulas-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nea-formulas-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nea-formula-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  background: #fff;
}

.nea-formula-item h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.nea-formula-item p {
  margin: 4px 0 0;
  color: #77777d;
  font-size: 12px;
  line-height: 1.25;
}

.nea-formula-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.nea-formula-item-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 8px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
  color: #67676d;
  font-size: 11px;
  line-height: 1;
}

.nea-formula-item-actions {
  display: flex;
  gap: 7px;
}

.nea-formula-editor-card {
  overflow: hidden;
}

.nea-formula-section {
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 20px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
}

.nea-formula-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.nea-formula-section > p {
  margin: -4px 0 12px;
  color: #8a8a90;
  font-size: 12px;
  line-height: 1.35;
}

.nea-formula-lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 280px;
  overflow: auto;
}

.nea-formula-lesson-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 14px;
  background: #f7f7f8;
  cursor: pointer;
}

.nea-formula-lesson-choice input {
  margin-top: 3px;
  accent-color: #1d1d1f;
}

.nea-formula-lesson-choice b {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  color: #1d1d1f;
}

.nea-formula-lesson-choice em {
  display: block;
  margin-top: 3px;
  color: #8a8a90;
  font-size: 11px;
  line-height: 1.2;
  font-style: normal;
}

@media (max-width: 900px) {
  .nea-formulas-hero,
  .nea-formula-item {
    display: block;
  }

  .nea-formula-item-actions,
  .nea-formulas-hero-actions {
    justify-content: flex-start;
    margin-top: 12px;
    flex-wrap: wrap;
  }

  .nea-formula-lesson-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin v2 v40: formulas safe step 1. */


/* Admin v2 v41: formula marketplace fields */
.nea-formula-subtitle {
  color: #8a8a90 !important;
  font-size: 12px !important;
}

/* Admin v2 v41: formula fields and lesson link capture fix. */

/* Admin v2 v42: hard formula lesson binding via admin_set_accord_lessons. */

/* Admin v2 v43: formula lesson links stored in accords.lesson_ids_json as fallback. */


/* Admin v2 v44: formula components, solutions and cost */
.nea-formula-builder-v44 .nea-formula-row {
  grid-template-columns: minmax(220px, 1.45fr) minmax(110px, .55fr) minmax(100px, .5fr) minmax(150px, .85fr) 42px;
  align-items: start;
}

.nea-formula-builder-v44 .nea-formula-row-hint {
  margin-top: 4px;
  color: #8a8a90;
  font-size: 10.5px;
  line-height: 1.2;
}

.nea-formula-total-row {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nea-formula-total-cost {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
  color: #1d1d1f;
  font-size: 12px;
  line-height: 1;
}

.nea-formula-total-cost.is-muted {
  color: #8a8a90;
}

@media (max-width: 900px) {
  .nea-formula-builder-v44 .nea-formula-row {
    grid-template-columns: 1fr;
  }
}

/* Admin v2 v44: formula component picker and cost estimate. */


/* Admin v2 v45: formula view and filters */
.nea-formula-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 190px;
  gap: 8px;
  margin-bottom: 12px;
}

.nea-formula-view-card {
  overflow: hidden;
}

.nea-formula-view-image {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(29,29,31,.08);
  margin-bottom: 12px;
}

.nea-formula-view-meta,
.nea-formula-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.nea-formula-view-meta span,
.nea-formula-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 6px 9px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
  color: #5f5f66;
  font-size: 11px;
  line-height: 1;
}

.nea-formula-view-description {
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 18px;
  background: #fff;
  color: #3b3b40;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.nea-formula-view-table {
  display: grid;
  gap: 4px;
}

.nea-formula-view-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(70px, .5fr) minmax(70px, .45fr) minmax(90px, .55fr) minmax(110px, .65fr) minmax(130px, .8fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(29,29,31,.07);
  border-radius: 14px;
  background: #fff;
  font-size: 12px;
  line-height: 1.25;
}

.nea-formula-view-row.is-head {
  background: #f7f7f8;
  color: #8a8a90;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media (max-width: 900px) {
  .nea-formula-filters,
  .nea-formula-view-row {
    grid-template-columns: 1fr;
  }

  .nea-formula-view-row.is-head {
    display: none;
  }
}

/* Admin v2 v45: formula view card and filters. */

/* Admin v2 v46: formula view/filter delegated controls fix. */

/* Admin v2 v47: safe formula open view render. */

/* Admin v2 v48: debounced formula search to keep typing focus. */


/* Admin v2 v49: formula normalization to 1000 units */
.nea-formula-stats-pills,
.nea-formula-view-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.nea-formula-stats-pills span,
.nea-formula-view-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 7px 9px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #f7f7f8;
  color: #5f5f66;
  font-size: 11px;
  line-height: 1;
}

.nea-formula-view-summary {
  margin-bottom: 8px;
}

.nea-formula-view-row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(70px, .45fr) minmax(70px, .45fr) minmax(70px, .45fr) minmax(80px, .45fr) minmax(90px, .55fr) minmax(100px, .65fr) minmax(120px, .8fr);
}

/* Admin v2 v49: formula percent and 1000 units. */

/* Admin v2 v50: neutral formula units and enriched formula_json. */


/* Admin v2 v51: formula copy buttons */
.nea-formula-view-card .nea-card-head .nea-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Admin v2 v51: copy formula text/json. */

/* Admin v2 v52: formula CSV export. */

/* Admin v2 v53: duplicate formula as draft. */


/* Admin v2 v54: formula project/tag filters */
.nea-formula-filters-v54 {
  grid-template-columns: minmax(220px, 1fr) 150px 160px 170px 150px;
}

.nea-formula-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
}

.nea-formula-active-filters span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(29,29,31,.08);
  background: #f7f7f8;
  color: #5f5f66;
  font-size: 11px;
  line-height: 1;
}

@media (max-width: 900px) {
  .nea-formula-filters-v54 {
    grid-template-columns: 1fr;
  }
}

/* Admin v2 v54: project and tag filters for formulas. */


/* Admin v2 v55: component usage in formulas */
.nea-component-usage {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 20px;
  background: #fafafa;
}

.nea-component-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.nea-component-usage-head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.nea-component-usage-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(29,29,31,.08);
  background: #fff;
  font-size: 11px;
  color: #5f5f66;
}

.nea-component-usage-list {
  display: grid;
  gap: 8px;
}

.nea-component-usage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(29,29,31,.07);
  border-radius: 16px;
  background: #fff;
}

.nea-component-usage-item b {
  display: block;
  font-size: 13px;
}

.nea-component-usage-item p,
.nea-component-usage-item em {
  display: block;
  margin: 4px 0 0;
  color: #77777d;
  font-size: 11px;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .nea-component-usage-item {
    grid-template-columns: 1fr;
  }
}

/* Admin v2 v55: show formulas using component. */

/* Admin v2 v56: open formula from component usage switches to formulas tab. */

/* Admin v2 v57: scroll to top after saving formula. */


/* Admin v2 v58: formula composition statistics */
.nea-formula-stats-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 22px;
  background: #fafafa;
}

.nea-formula-stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.nea-formula-stats-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 7px 10px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 999px;
  background: #fff;
  color: #5f5f66;
  font-size: 11px;
  line-height: 1;
}

.nea-formula-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nea-formula-stats-grid section {
  padding: 12px;
  border: 1px solid rgba(29,29,31,.07);
  border-radius: 18px;
  background: #fff;
}

.nea-formula-stats-grid h4 {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.2;
}

.nea-formula-stat-row {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.nea-formula-stat-row:last-child {
  margin-bottom: 0;
}

.nea-formula-stat-row-head {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.nea-formula-stat-row-head b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nea-formula-stat-row-head em {
  color: #77777d;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.nea-formula-stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d8d8d8;
  border: 1px solid rgba(29,29,31,.08);
}

.nea-formula-stat-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeeef;
}

.nea-formula-stat-bar i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: #1d1d1f;
}

@media (max-width: 900px) {
  .nea-formula-stats-grid {
    grid-template-columns: 1fr;
  }

  .nea-formula-stat-row-head {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .nea-formula-stat-row-head em {
    grid-column: 2;
    white-space: normal;
  }
}

/* Admin v2 v58: formula statistics by families and pyramid. */

/* Admin v2 v59: backend student formulas package. */

/* Admin v2 v60: student blank screen loader fix package. */

/* Admin v2 v61: student formula table headers package. */

/* Admin v2 v62: robust student formula headers package. */

/* Admin v2 v63: card-based student formula headers package. */

/* Admin v2 v64: hard student formula headers package. */

/* Admin v2 v65: student emergency rollback package. */

/* Admin v2 v66: real student courses backend package. */

/* Admin v2 v67: student overlay rollback package. */

/* Admin v2 v68: student v17 real courses package. */

/* Admin v2 v69: student v18 course covers package. */

/* Admin v2 v70: course cover persistence package. */

/* Admin v2 v71: course cover select fix package. */

/* Admin v2 v72: course cover debug package. */

/* Admin v2 v73: student duplicate course card renderer fix package. */

/* Admin v2 v74: student course detail cover fix package. */

/* Admin v2 v75: student course detail cover layout fix package. */

/* Admin v2 v76: student no detail course cover package. */

/* Admin v2 v80: emergency restore package. */

/* Admin v2 v87: static safe components placeholder package. */

/* Admin v2 v89: student components external API package. */

/* Admin v2 v90: student local component versions package. */

/* Admin v2 v91: component form controls package. */

/* Admin v2 v92: full student component fields package. */

/* Admin v2 v93: conditional student component fields package. */

/* Admin v2 v94: student add components and local families package. */

/* Admin v2 v95: student family selection only package. */

/* Admin v2 v96: derived student family labels package. */

/* Admin v2 v97: family manager overrides package. */

/* Admin v2 v100: emergency student restore package. */

/* Admin v2 v101: safe student anchor navigation package. */

/* Admin v2 v102: student family delete/hide package. */

/* Admin v2 v103: student family save/delete fix package. */

/* Admin v2 v104: student family delete cleanup package. */

/* Admin v2 v105: better component/family separation package. */

/* Admin v2 v106: release visual polish package. */

/* Admin v2 v107: release visual polish 2 package. */

/* Admin v2 v109: safe student login/icons fix package. */

/* Admin v2 v110: student family edit position package. */

/* Admin v2 v111: add family button fix package. */

/* Admin v2 v112: no default component open package. */

/* Admin v2 v113: marketplace first version package. */

/* Admin v2 v114: marketplace polish package. */

/* Admin v2 v116: marketplace restore stable package. */

/* Admin v2 v117: marketplace saved products package. */

/* Admin v2 v118: marketplace search fix package. */

/* Admin v2 v119: marketplace quick start package. */

/* Admin v2 v120: marketplace access cards package. */

/* Admin v2 v121: marketplace free content package. */

/* Admin v2 v122: marketplace collections package. */

/* Admin v2 v123: marketplace product details package. */

/* Admin v2 v124: marketplace cart safe package. */

/* Admin v2 v125: topbar saved/cart package. */

/* Admin v2 v126: topbar icon size fix package. */

/* Admin v2 v127: smaller topbar icons package. */


/* NOMKAMO EDU Admin v128 — Marketplace */
.nea-market-panel {
  display: grid;
  gap: 12px;
}

.nea-market-form-card {
  scroll-margin-top: 92px;
}

.nea-market-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.nea-market-form-grid label {
  display: grid;
  gap: 6px;
}

.nea-market-form-grid label span {
  color: #6e6e73;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nea-market-form-grid textarea.nea-input {
  min-height: 92px;
  resize: vertical;
  padding-top: 10px;
}

.nea-market-wide {
  grid-column: span 2;
}

.nea-market-form-actions,
.nea-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nea-market-form-actions {
  margin-top: 12px;
}

.nea-market-list {
  display: grid;
  gap: 8px;
}

.nea-market-item {
  border: 1px solid rgba(29,29,31,.08);
  background: #fff;
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.nea-market-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nea-market-item-top b {
  font-size: 15px;
  letter-spacing: -.025em;
}

.nea-market-item-top span,
.nea-market-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f7f7f8;
  color: #6e6e73;
  padding: 0 9px;
  font-size: 10px;
}

.nea-market-item p {
  margin: 7px 0 0;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.35;
}

.nea-market-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.nea-market-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 1100px) {
  .nea-market-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nea-market-wide {
    grid-column: span 2;
  }

  .nea-market-item {
    grid-template-columns: 1fr;
  }

  .nea-market-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .nea-market-form-grid {
    grid-template-columns: 1fr;
  }

  .nea-market-wide {
    grid-column: auto;
  }
}


/* NOMKAMO EDU Admin v129 — human marketplace form */
.nea-market-form-card .nea-card-head p {
  max-width: 720px;
}

.nea-market-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nea-market-wide {
  grid-column: span 3;
}

@media (max-width: 1100px) {
  .nea-market-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nea-market-wide {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .nea-market-form-grid {
    grid-template-columns: 1fr;
  }

  .nea-market-wide {
    grid-column: auto;
  }
}


/* NOMKAMO EDU Admin v130 — marketplace course sync */
.nea-actions-row [data-nea-market-sync-courses] {
  border-color: rgba(29,29,31,.18);
  background: #f7f7f8;
}

.nea-actions-row [data-nea-market-sync-courses]:hover {
  background: #1d1d1f;
  color: #fff;
}


/* NOMKAMO EDU Admin v131 — marketplace free lessons sync fix */
.nea-actions-row [data-nea-market-sync-courses] {
  font-weight: 600;
}


/* NOMKAMO EDU Admin v132 — manual marketplace sync */
.nea-actions-row [data-nea-market-sync-courses] {
  background: #fff;
  border-color: rgba(29,29,31,.18);
}

.nea-json-hint {
  line-height: 1.35;
}


/* NOMKAMO EDU Admin v133 — backend free lessons sync */
.nea-market-sync-debug {
  border: 1px dashed rgba(29,29,31,.14);
  border-radius: 14px;
  padding: 9px 10px;
  color: #6e6e73;
  background: #fbfbfc;
  font-size: 11px;
  line-height: 1.35;
}


/* NOMKAMO EDU Admin v134 — only marketplace lessons */
.nea-market-actions [data-nea-market-delete] {
  color: #8a1f1f;
}

.nea-market-actions [data-nea-market-delete]:hover {
  border-color: #8a1f1f;
}


/* NOMKAMO EDU Admin v135 — stable visible marketplace list */
.nea-market-list + .nea-empty,
.nea-empty {
  line-height: 1.35;
}

/* Admin v2 v136 package: student marketplace YDB backend included. */

/* Admin v2 v138 package: student emergency rollback. */

/* Admin v2 v139 package: student quick start hidden. */

/* Admin v2 v140 package: student formulas. */

/* Admin v2 v141 package: student available formulas backend. */

/* Admin v2 v142 package: student formulas fallback from lessons. */

/* Admin v2 v143 package: student formulas open bundles fix. */

/* Admin v2 v144 package: student formula filters. */

/* Admin v2 v145 package: student own formulas local. */

/* Admin v2 v146 package: own formula component select. */

/* Admin v2 v147 package: own formula component api select. */

/* Admin v2 v148 package: own formula component autoload fix. */

/* Admin v2 v149 package: own formula component search. */

/* Admin v2 v150 package: own formula component datalist. */

/* Admin v2 v151 package: component source fix. */

/* Admin v2 v153 package: emergency restore student components from v151. */

/* Admin v2 v154 package: safe formula repair. */

/* Admin v2 v155 package: marketplace no demo products. */

/* Admin v2 v156 — marketplace backend restore. */

/* Admin v2 v157 package: student marketplace endpoint fix. */

/* Admin v2 v158 package: student component scroll open. */

/* Admin v2 v160 — emergency restore components backend from v158. */


/* Admin v2 v161 — single component family */


/* Admin v2 v162 — API retry diagnostics */
.nea-error,
.admin-error,
.nsc2-error {
  white-space: pre-wrap;
}


/* Admin v2 v163 — API GET retry diagnostics */
.nea-error,
.admin-error,
.nsc2-error {
  white-space: pre-wrap;
}

/* Admin v2 v164 — backend safe course/components package */


/* Admin v2 v165 — admin token guard */
.nea-error,
.admin-error,
.nsc2-error {
  white-space: pre-wrap;
}


/* Admin v2 v166 — unified admin session */
.nea-error,
.admin-error,
.nsc2-error {
  white-space: pre-wrap;
}
