/* Training attempts, scoring, and curator review primitives. */
.rating-tests-complete {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:112px;
  color:var(--muted);
  cursor:default;
}
.rating-tests-complete input[type="checkbox"] {
  width:18px;
  height:18px;
  flex:0 0 auto;
  accent-color:var(--good);
  opacity:1;
}
.rating-tests-complete span {
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.1;
}
.rating-tests-complete b {
  color:var(--ink);
  font-size:14px;
  font-weight:800;
}
.rating-tests-complete small {
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.rating-tests-complete.complete small { color:var(--good); }
.km-progress-table td:nth-child(4) { min-width: 360px; }
.km-progress-bar {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: #edf2fb;
  overflow: hidden;
}
.km-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--good), #38b779);
}
.test-progress-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.test-progress-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}
.test-progress-chip b {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  color: var(--brand);
  font-size: 12px;
}
.test-progress-chip span { color: var(--muted); font-weight: 700; }
.test-progress-chip.ok { background: #edf9f2; border-color: #bfe8cf; }
.test-progress-chip.ok span { color: var(--good); }
.test-progress-chip.warn { background: #fff7e8; border-color: #f2d39c; }
.test-progress-chip.warn span { color: var(--warn); }
.test-progress-chip.bad { background: #fff0ee; border-color: #f2c5bf; }
.test-progress-chip.bad span { color: var(--bad); }
.test-progress-chip.locked { opacity: .68; }
.test-progress-chip.open { background: #f4f8ff; border-color: #c8d8ee; }
.curator-test-status-panel {
  border-left: 5px solid var(--good);
}
.curator-test-status-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.curator-test-status-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}
.curator-test-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.curator-test-status-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.curator-test-status-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #c8d8ee;
}
.curator-test-status-card.ok { border-left-color: var(--good); background: #f4fbf7; }
.curator-test-status-card.bad { border-left-color: var(--bad); background: #fff7f6; }
.curator-test-status-card.warn { border-left-color: var(--warn); background: #fffaf0; }
.curator-test-status-card.open { border-left-color: var(--brand-3); background: #f8fbff; }
.curator-test-status-card.locked { background: #f7f9fc; opacity: .76; }
.curator-test-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(5,29,94,.10);
  font-size: 20px;
}
.curator-test-status-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.curator-test-status-body b {
  color: var(--brand);
  font-size: 14px;
  line-height: 1.25;
}
.curator-test-status-result {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.curator-test-status-card.ok .curator-test-status-result { color: var(--good); }
.curator-test-status-card.bad .curator-test-status-result { color: var(--bad); }
.curator-test-status-card.warn .curator-test-status-result { color: var(--warn); }
.curator-test-status-body small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.training-shell { max-width:880px; margin:0 auto; }
.training-card { min-height:430px; display:flex; flex-direction:column; justify-content:space-between; }
.training-meta { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-weight:600; margin-bottom:12px; }
.client-question { font-size:26px; line-height:1.25; color:var(--brand); font-weight:700; margin:16px 0 22px; }
.training-answer { min-height:150px; font-size:16px; }
.training-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:16px; }
.training-actions .button, .training-actions button { min-width:130px; text-align:center; }
.ghost-button { background:#fff; color:var(--brand); border:1px solid #c8d3e5; box-shadow:none; }
.training-tip { border-left:4px solid var(--brand); background:#f7faff; border-radius:8px; padding:12px; margin-top:14px; }
.training-answer-block { display:none; margin-top:16px; }
.learning-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.answer-panel { border:1px solid var(--line); border-radius:8px; padding:14px; background:#f8fbff; margin-top:10px; }
.answer-panel.bad { background:#fff7f6; }
.answer-panel.coach { background:#f1f6ff; border-color:#bfd0ee; }
details.answer-panel { padding:0; overflow:hidden; }
details.answer-panel summary { cursor:pointer; list-style:none; padding:12px 14px; font-weight:700; color:var(--brand); }
details.answer-panel summary::-webkit-details-marker { display:none; }
details.answer-panel summary:after { content:'Открыть'; float:right; color:var(--muted); font-size:13px; font-weight:600; }
details.answer-panel[open] summary { border-bottom:1px solid var(--line); }
details.answer-panel[open] summary:after { content:'Скрыть'; }
.coaching-collapse__body { padding:14px; }
.curator-comment-block.is-hidden { display:none; }
.error-review { border-left:5px solid var(--bad); }
.topic-pills { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.topic-pill { display:inline-block; padding:6px 10px; border-radius:8px; background:#edf3ff; color:var(--brand); font-weight:700; font-size:13px; }
.topic-pills.compact { gap:5px; margin:8px 0 4px; }
.topic-pills.compact .topic-pill { padding:4px 7px; font-size:11px; border-radius:7px; }
.autosave-status { background:#f8fbff; box-shadow:none; font-weight:600; color:var(--muted); }
.autosave-status.ok { border-left:5px solid var(--good); color:var(--good); }
.autosave-status.pending { border-left:5px solid var(--warn); color:var(--warn); }
.autosave-status.bad { border-left:5px solid var(--bad); color:var(--bad); }
.attempt-info-panel { position:relative; padding-right:62px; }
.attempt-info-panel[hidden] { display:none; }
.attempt-info-dismiss {
  position:absolute;
  top:12px;
  right:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  min-width:34px;
  height:34px;
  min-height:34px;
  padding:0;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:var(--muted);
  box-shadow:none;
  font-size:22px;
  line-height:1;
}
.attempt-info-dismiss:hover {
  background:#eef3ff;
  color:var(--brand);
  box-shadow:none;
}
.timer-panel { display:flex; justify-content:space-between; gap:14px; align-items:center; position:sticky; top:54px; z-index:9; }
.test-timer { font-size:24px; color:var(--brand); font-weight:700; }
.test-timer.warning { color:var(--warn); }
.test-timer.danger { color:var(--bad); }
.test-question { display:none; }
.test-question.active { display:block; }
.option-group {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.option-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.option-choice input[type="radio"],
.option-choice input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 3px 0 0;
  padding: 0;
  flex-shrink: 0;
  box-shadow: none;
}
.option-choice span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.option-choice:has(input:checked) {
  border-color: var(--brand-3);
  background: #f5f8ff;
}
.test-nav { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; }
.integrity-banner { border-left:6px solid var(--warn); }
.integrity-banner.bad { border-left-color:var(--bad); }
.integrity-list { margin:10px 0 0; padding-left:18px; }
.integrity-list a { font-weight:800; text-decoration:none; }
.integrity-list a:hover { text-decoration:underline; }
.answer-compare-summary {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:14px;
  align-items:center;
}
.answer-compare-arrow {
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f8fbff;
  color:var(--brand);
  font-weight:900;
}
.answer-compare-table { table-layout:fixed; }
.answer-compare-table th:first-child,
.answer-compare-table td:first-child { width:220px; }
.answer-compare-table th:last-child,
.answer-compare-table td:last-child { width:96px; text-align:center; }
.answer-compare-text {
  max-height:260px;
  overflow:auto;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.45;
}
.answer-compare-focus td {
  background:#fff8e6;
  box-shadow:inset 0 2px 0 #f2c15c, inset 0 -2px 0 #f2c15c;
}
.answer-compare-focus,
.curator-answer-focus {
  scroll-margin-top:112px;
}
.curator-answer-focus {
  border-left-color:#f2c15c;
  background:#fffaf0;
  box-shadow:0 0 0 2px rgba(242,193,92,.28);
}
.integrity-focus-badge {
  margin-left:8px;
  background:#fff3cd;
  color:#7a4b00;
  border-color:#f2c15c;
}
.integrity-focus-panel {
  scroll-margin-top:112px;
}
@media (max-width: 820px) {
  .answer-compare-summary { grid-template-columns:1fr; }
  .answer-compare-arrow { display:none; }
  .answer-compare-table { table-layout:auto; }
  .answer-compare-table th:first-child,
  .answer-compare-table td:first-child,
  .answer-compare-table th:last-child,
  .answer-compare-table td:last-child { width:auto; }
}
.repeat-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; }
.repeat-summary h2 { margin:0 0 8px; }
.repeat-summary .topic-pills { max-height:76px; overflow:auto; padding-right:4px; }
.repeat-summary .toolbar { margin:0; }
.quality-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:8px; margin-top:10px; }
.quality-score { grid-column:1/-1; border:1px solid #bfd0ee; background:#f1f6ff; color:var(--brand); border-radius:8px; padding:9px; font-size:13px; font-weight:700; }
.quality-axis { grid-column:1/-1; display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; }
.quality-axis span { border:1px solid #d6e1f3; background:#fbfdff; border-radius:8px; padding:9px; font-size:13px; color:#41516f; }
.quality-axis b { display:block; color:var(--brand); font-size:18px; line-height:1.1; margin-bottom:2px; }
.quality-item { border:1px solid var(--line); border-radius:8px; padding:9px; background:#fff; font-size:13px; }
.quality-item.ok { border-color:#b7dfcd; background:#f2fbf6; color:var(--good); }
.quality-item.warn { border-color:#f3d18b; background:#fffaf0; color:#9a6500; }
.quality-item.bad { border-color:#f0b8b0; background:#fff7f6; color:var(--bad); }
.quality-scorecard-panel { border-color:#d8e8df; background:linear-gradient(180deg,#fbfffd,#fff); }
.quality-scorecard-panel.compact .quality-grid { margin-top:8px; }
.quality-scorecard-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px; }
.quality-scorecard-head h2 { margin:0 0 4px; }
.quality-scorecard-head p { margin:0; }
.quality-scorecard-grid .quality-item { min-height:76px; }
.quality-scorecard-mini { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
.quality-scorecard-mini-title { display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; font-weight:700; }
.quality-scorecard-mini-title span { color:var(--muted); font-size:13px; font-weight:500; }
.quality-audio-player audio { width:100%; margin-bottom:10px; }
.audio-scrub-row { display:grid; grid-template-columns:62px minmax(180px,1fr) 62px; gap:10px; align-items:center; }
.audio-time { font-weight:700; color:var(--brand); font-variant-numeric:tabular-nums; text-align:center; }
.audio-scrub-wrap { position:relative; padding:18px 0; }
.audio-scrub { width:100%; margin:0; accent-color:var(--brand); cursor:pointer; }
.audio-hover-time { display:none; position:absolute; top:-4px; transform:translateX(-50%); background:#071733; color:#fff; border-radius:8px; padding:3px 7px; font-size:12px; font-weight:700; pointer-events:none; white-space:nowrap; }
.audio-scrub-wrap.active .audio-hover-time { display:block; }
.transcript-turn.active { background:#fff7e8; border-left:4px solid var(--warn); padding-left:8px; border-radius:8px; }
.review-focus { border-left:6px solid var(--brand); }
.review-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.review-action { border:1px solid var(--line); border-radius:8px; padding:14px; background:#fff; }
.review-action b { display:block; color:var(--brand); margin-bottom:5px; }
.attention-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.attention-card { border:1px solid var(--line); border-left:5px solid var(--brand); border-radius:8px; padding:14px; background:#fff; }
.attention-card b { display:block; color:var(--brand); margin-bottom:5px; font-size:20px; line-height:1; }
.attention-card-title { color:var(--text); font-weight:700; line-height:1.25; }
.attention-count-button {
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  margin-bottom:8px;
  padding:8px 12px;
  border-radius:8px;
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  font-weight:700;
  box-shadow:0 2px 6px rgba(5,29,94,.20);
}
.attention-count-button:visited { color:#fff; }
.attention-count-button:hover { background:var(--brand-2); color:#fff; text-decoration:none; }
.attention-count-value { font-size:22px; line-height:1; font-variant-numeric:tabular-nums; }
.attention-count-label { font-size:13px; line-height:1; }
.attention-card.bad { border-left-color:var(--bad); }
.attention-card.warn { border-left-color:var(--warn); }
.attention-list { margin:12px 0 0; padding:0; list-style:none; }
.attention-list li { border-top:1px solid var(--line); padding:10px 0; }
.attention-list li:first-child { border-top:0; padding-top:0; }
.review-queue-page { display:flex; flex-direction:column; gap:16px; }
.review-queue-head,
.review-queue-subhead,
.review-queue-item {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.review-queue-head h2,
.review-queue-subhead h2 { margin:0; }
.review-queue-total {
  min-width:150px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-left:5px solid var(--brand);
  border-radius:8px;
  background:#fff;
}
.review-queue-total b { display:block; color:var(--brand); font-size:30px; line-height:1; }
.review-queue-total span { color:var(--muted); font-size:13px; line-height:1.25; }
.review-queue-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; }
.review-queue-card {
  display:block;
  padding:14px;
  border:1px solid var(--line);
  border-left:5px solid var(--brand);
  border-radius:8px;
  background:#fff;
  text-decoration:none;
  color:var(--text);
}
.review-queue-card span { display:block; color:var(--brand); font-size:30px; line-height:1; font-weight:800; }
.review-queue-card b { display:block; margin-top:6px; color:var(--text); }
.review-queue-card small { display:block; margin-top:4px; color:var(--muted); }
.review-queue-card:nth-child(1) { border-left-color:var(--bad); }
.review-queue-card:nth-child(2) { border-left-color:var(--warn); }
.review-queue-card.active,
.review-queue-card:hover {
  border-color:var(--brand);
  box-shadow:0 8px 24px rgba(5,29,94,.10);
  text-decoration:none;
}
.queue-filter-row { display:flex; flex-wrap:wrap; gap:8px; }
.queue-filter-chip {
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--text);
  text-decoration:none;
  font-weight:700;
  font-size:14px;
}
.queue-filter-chip span {
  min-width:22px;
  padding:2px 7px;
  border-radius:999px;
  background:#eef3ff;
  color:var(--brand);
  text-align:center;
  font-size:12px;
}
.queue-filter-chip.active,
.queue-filter-chip:hover {
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
  text-decoration:none;
}
.queue-filter-chip.active span,
.queue-filter-chip:hover span { background:#fff; color:var(--brand); }
.review-queue-list { display:flex; flex-direction:column; gap:10px; }
.review-queue-item {
  padding:14px;
  border:1px solid var(--line);
  border-left:5px solid var(--brand);
  border-radius:8px;
  background:#fff;
}
.review-queue-item.risk-high { border-left-color:var(--bad); }
.review-queue-item.risk-medium { border-left-color:var(--warn); }
.review-queue-main { min-width:0; flex:1; }
.review-queue-top { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.review-queue-title { font-weight:800; color:var(--brand); }
.review-queue-meta { margin-top:4px; color:var(--muted); font-size:14px; line-height:1.35; }
.review-queue-item p { margin:8px 0 0; }
.review-queue-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
@media (max-width: 820px) {
  .learning-grid,
  .review-actions {
    grid-template-columns:1fr;
    gap:10px;
  }
  .attention-grid { grid-template-columns:1fr; }
  .attention-card { padding:12px; }
  .review-queue-head,
  .review-queue-subhead,
  .review-queue-item { flex-direction:column; align-items:stretch; }
  .review-queue-total { min-width:0; }
  .review-queue-actions { justify-content:stretch; }
  .review-queue-actions .button { width:100%; }
  .client-question { font-size:21px; }
  .training-card { min-height:calc(100vh - 270px); }
  .training-meta { flex-direction:column; gap:4px; }
  .training-actions { flex-wrap:wrap; }
  .training-actions .button, .training-actions button { flex:1 1 130px; }
  .timer-panel { position:static; display:grid; grid-template-columns:1fr; gap:10px; }
  .timer-panel .toolbar { grid-template-columns:1fr; }
  .attempt-info-panel { padding-right:52px; }
  .attempt-info-dismiss { top:10px; right:10px; }
  .test-timer { font-size:28px; }
  .test-nav { position:sticky; bottom:0; z-index:12; margin:14px -12px -34px; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:rgba(246,248,252,.96); border-top:1px solid var(--line); box-shadow:0 -10px 28px rgba(5,29,94,.08); }
  .test-nav button { flex:1 1 0; padding:11px 8px; min-width:0; }
  .quality-grid { grid-template-columns:1fr; }
  .quality-scorecard-head { flex-direction:column; align-items:stretch; }
  .audio-scrub-row { grid-template-columns:52px minmax(0,1fr) 52px; gap:6px; }
  .test-progress-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .test-progress-chip { width:100%; }
  .answer-panel { padding:11px; }
}
@media (max-width: 520px) {
  .client-question { font-size:19px; }
  .training-card { min-height:auto; }
  .test-nav { gap:6px; }
  .test-nav button { font-size:14px; }
  .test-progress-list { grid-template-columns:1fr; }
}


.avatar-preset-form {
  margin:18px 0 22px;
}
.avatar-preset-form h2 {
  margin:0 0 6px;
  color:var(--brand);
}
.avatar-preset-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(92px, 1fr));
  gap:12px;
  margin:14px 0;
}
.avatar-preset-card {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:1;
  border:2px solid var(--line);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  overflow:hidden;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.avatar-preset-card:hover {
  transform:translateY(-1px);
  border-color:var(--brand-2);
  box-shadow:0 10px 24px rgba(5,29,94,.12);
}
.avatar-preset-card input {
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.avatar-preset-card img {
  width:100%;
  height:100%;
  object-fit:cover;
}
.avatar-preset-card span {
  position:absolute;
  right:6px;
  bottom:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:999px;
  background:rgba(255,255,255,.92);
  color:var(--brand);
  font-size:12px;
  font-weight:800;
  box-shadow:0 4px 12px rgba(5,29,94,.12);
}
.avatar-preset-card:has(input:checked) {
  border-color:var(--brand-2);
  box-shadow:0 0 0 4px rgba(245,166,35,.24);
}
.avatar-panel input[type="file"] {
  padding:12px;
  border:1px dashed var(--line);
  border-radius:8px;
  background:#f8fbff;
}
.direction-leaderboard {
  position: relative;
  border-left:5px solid var(--brand-2);
  background:linear-gradient(135deg,#fff 0%,#fff8ea 100%);
  padding-right: 54px;
}
.direction-leaderboard[hidden] { display: none; }
.leaderboard-dismiss {
  position:absolute;
  top:12px;
  right:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  min-width:34px;
  height:34px;
  min-height:34px;
  padding:0;
  border:1px solid #f0d6a2;
  border-radius:8px;
  background:#fff;
  color:var(--brand);
  box-shadow:none;
  font-size:22px;
  line-height:1;
}
.leaderboard-dismiss:hover {
  background:#fff4dc;
  color:var(--brand-2);
  box-shadow:none;
}
.leaderboard-hero {
  display:flex;
  align-items:center;
  gap:16px;
  margin:14px 0;
}
.leaderboard-hero h3 {
  margin:0 0 4px;
  color:var(--brand);
}
.leaderboard-hero p,
.leaderboard-self {
  margin:0;
  color:var(--muted);
}
.leader-avatar {
  width:48px;
  height:48px;
  font-size:15px;
  box-shadow:none;
}
.leader-avatar-large {
  width:96px;
  height:96px;
  font-size:28px;
}
.leaderboard-self {
  border:1px solid #f0d6a2;
  background:#fff;
  border-radius:8px;
  padding:10px 12px;
  margin-bottom:12px;
}
.leaderboard-self small,
.leaderboard-name small {
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.leaderboard-list {
  display:grid;
  gap:8px;
}
.leaderboard-row {
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  padding:8px 10px;
}
.leaderboard-rank {
  font-weight:800;
  color:var(--brand-2);
}
.leaderboard-name {
  min-width:0;
  overflow-wrap:anywhere;
  font-weight:700;
  color:var(--ink);
}
.leaderboard-score {
  color:var(--muted);
  font-size:13px;
  text-align:right;
}
.leaderboard-more {
  margin-top:10px;
}
.leaderboard-more > summary {
  cursor:pointer;
  list-style:none;
  border:1px solid #f0d6a2;
  border-radius:8px;
  background:#fff;
  color:var(--brand);
  font-weight:800;
  padding:10px 12px;
}
.leaderboard-more > summary::-webkit-details-marker {
  display:none;
}
.leaderboard-more > summary::after {
  content:"↓";
  float:right;
  color:var(--brand-2);
}
.leaderboard-more[open] > summary {
  margin-bottom:8px;
}
.leaderboard-more[open] > summary::after {
  content:"↑";
}
@media (max-width: 820px) {
  .nav-user { text-align: left; }
  .direction-leaderboard {
    padding-right: 46px;
  }
  .leaderboard-dismiss {
    top:10px;
    right:10px;
  }
  .leaderboard-row {
    grid-template-columns:auto auto minmax(0,1fr);
  }
  .leaderboard-score {
    grid-column:3;
    text-align:left;
  }
}

/* --- Bugfix: ensure <a class="button"> stays white-on-navy (the global `a` rule would otherwise tint it dark) --- */
a.button { color: #fff; }
a.button:visited { color: #fff; }
a.button.secondary { color: var(--brand); }
a.button.secondary:visited { color: var(--brand); }

/* --- Mobile compression: tighter top so retake/important panels land sooner --- */
@media (max-width: 820px) {
  .nav { padding: 10px 14px; gap: 8px; }
  .nav-user { line-height: 1.2; }
  .nav-user b { font-size: 13px; }
  .nav-user .small { font-size: 11px; }
  .wrap { padding: 14px 12px 32px; }
  h1 { font-size: 22px; margin-bottom: 8px; }
  h2 { font-size: 17px; margin: 18px 0 8px; }
  .program-switch { margin: 2px 0 8px; gap: 4px; }
  .program-switch .label { display: none; } /* save a line on small screens */
}

/* --- Highlighted voice-input button ("Надиктовать ответ") --- */
.voice-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.voice-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
  padding: 9px 14px;
  font: inherit;
}
.voice-button-icon { font-size: 16px; line-height: 1; }
/* Primary: the "Надиктовать ответ" entry button — filled brand */
.voice-button-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  box-shadow: 0 1px 3px rgba(5, 29, 94, .15);
}
.voice-button-primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  box-shadow: 0 2px 8px rgba(5, 29, 94, .22);
}
.voice-button-primary:disabled,
.voice-button-primary.recording {
  background: #fff7f6;
  color: var(--bad);
  border-color: #f0b8b0;
  box-shadow: none;
  cursor: default;
}
.voice-button-primary.recording .voice-button-icon { animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-button-primary.recording .voice-button-icon { animation: none; }
}
/* Stop: secondary white button with a red accent */
.voice-button-stop {
  background: #ffffff;
  color: var(--bad);
  border: 1px solid #f0b8b0;
}
.voice-button-stop:hover {
  background: #fff5f4;
  border-color: var(--bad);
}
/* Speak (output) buttons reuse base .voice-button — keep them quiet */
.speak-button {
  background: #ffffff;
  color: var(--brand);
  border: 1px solid var(--line-strong);
}
.speak-button:hover { background: #f4f7fd; border-color: var(--brand-3); }
.speak-button.speaking { background: #fff7e8; color: var(--warn); border-color: #f3c780; }
@media (max-width: 820px) {
  .voice-button { padding: 11px 16px; min-height: 44px; }
}

/* --- Training page polish --- */
.training-intro { margin: -2px 0 14px; max-width: 720px; }
.training-shell .timer-panel { padding: 12px 18px; }
.training-shell .timer-panel b { font-size: 14px; }
.training-card .client-question { margin: 12px 0 18px; }
.training-card .training-tip { margin-top: 12px; font-size: 13px; }
/* Wrap voice control snug under textarea inside training card */
.training-card .voice-control { margin-top: 10px; }
.manager-curator-comment {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #efc1bb;
  border-left: 4px solid var(--bad);
  border-radius: 8px;
  background: #fff6f5;
  color: #5f1d15;
}
.manager-curator-comment b {
  color: var(--bad);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.manager-curator-comment span {
  color: #5f1d15;
  font-size: 13px;
  line-height: 1.45;
}
.manager-curator-comment.good {
  border-color: #b7dcc5;
  border-left-color: var(--good);
  background: #f3fbf6;
  color: #164b2a;
}
.manager-curator-comment.good b,
.manager-curator-comment.good span {
  color: #164b2a;
}
.training-lesson-page {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  overflow-x: hidden;
}
.training-lesson-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border: 1px solid #d7e2f2;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96) 0%, rgba(246,250,255,.96) 54%, rgba(255,248,234,.96) 100%);
  box-shadow: var(--shadow-lg);
  min-width: 0;
}
.training-hero-copy {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.training-hero-copy > div {
  min-width: 0;
}
.training-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #fff3dc;
  box-shadow: 0 12px 28px rgba(240,122,42,.18);
  font-size: 34px;
}
.training-lesson-hero h1 {
  margin: 8px 0 10px;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
}
.training-lesson-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  overflow-wrap: anywhere;
}
.training-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.training-hero-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #d7e2f2;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}
.training-hero-stats .todo {
  border-color: #f4b763;
  background: #fff7e6;
  color: #9a4a0f;
}
.training-hero-stats .done {
  border-color: #bfe8cf;
  background: #edf9f2;
  color: var(--good);
}
.training-hero-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.training-source-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid #f4b763;
  border-left: 5px solid #f07a2a;
  border-radius: 12px;
  background: #fffaf0;
  box-shadow: var(--shadow);
  min-width: 0;
}
.training-source-band > div {
  min-width: 0;
  max-width: 100%;
}
.training-source-band h2 {
  margin: 5px 0 4px;
  font-size: 22px;
  letter-spacing: 0;
}
.training-source-band p {
  margin: 0;
}
.training-material-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.training-material-actions .onboarding-presentation-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.training-lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}
.training-lesson-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.training-lesson-aside {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.training-section-title {
  margin-bottom: 12px;
}
.training-section-title h2 {
  margin: 6px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}
.training-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.mini-test-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #c8d8ee;
  border-left: 5px solid var(--good);
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fcf9 0%, #ffffff 100%);
  box-shadow: var(--shadow);
}
.mini-test-head {
  display: grid;
  gap: 4px;
}
.mini-test-head h3 {
  margin: 0;
  color: var(--brand);
  font-size: 21px;
  line-height: 1.25;
}
.mini-test-head p {
  margin: 0;
  color: var(--muted);
}
.mini-test-question {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #fff;
}
.mini-test-question > b {
  color: #273452;
  font-size: 15px;
  line-height: 1.4;
}
.mini-test-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.mini-test-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  padding: 10px 11px;
  border: 1px solid #d8e2f1;
  border-radius: 8px;
  background: #f9fbff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: none;
}
.mini-test-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf3ff;
  color: var(--brand);
  font-weight: 800;
  font-size: 12px;
}
.mini-test-option:hover {
  border-color: var(--brand-3);
  background: #f3f7ff;
  color: var(--ink);
}
.mini-test-option:disabled {
  cursor: default;
  opacity: 1;
}
.mini-test-option.right {
  border-color: #a6ddb9;
  background: #edf9f2;
  color: #134d30;
}
.mini-test-option.right span {
  background: var(--good);
  color: #fff;
}
.mini-test-option.chosen-wrong {
  border-color: #efb7b0;
  background: #fff3f2;
  color: #7e251c;
}
.mini-test-option.chosen-wrong span {
  background: var(--bad);
  color: #fff;
}
.mini-test-feedback {
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}
.mini-test-question.answered .mini-test-feedback {
  display: block;
}
.mini-test-question.correct .mini-test-feedback {
  border: 1px solid #bfe8cf;
  background: #edf9f2;
  color: #175734;
}
.mini-test-question.wrong .mini-test-feedback {
  border: 1px solid #efc1bb;
  background: #fff6f5;
  color: #76271f;
}
.training-lesson-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #d8e2f1;
  border-left: 5px solid var(--brand-3);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.training-lesson-card.theme-1 { border-left-color: #2f80ed; background: #f8fbff; }
.training-lesson-card.theme-2 { border-left-color: #18a058; background: #f7fcf9; }
.training-lesson-card.theme-3 { border-left-color: #8b5cf6; background: #fbf9ff; }
.training-lesson-card.theme-4 { border-left-color: #f59e0b; background: #fffaf1; }
.training-lesson-card.theme-5 { border-left-color: #ef4444; background: #fff7f7; }
.training-lesson-card.theme-6 { border-left-color: #0891b2; background: #f2fbfd; }
.training-lesson-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.training-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  line-height: 1;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(5,29,94,.12);
}
.training-lesson-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.24;
  letter-spacing: 0;
}
.training-source-pill {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.training-lesson-card p {
  margin: 0;
  color: #273452;
  font-size: 15px;
  line-height: 1.62;
}
.training-lesson-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: auto;
}
.training-lesson-note {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d9e5f4;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}
.training-lesson-note b {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 13px;
}
.training-lesson-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.46;
}
.training-lesson-note.risk {
  border-color: #f0c7c1;
  background: #fffafa;
}
.training-lesson-note.risk b {
  color: var(--bad);
}
.training-next-card {
  padding: 16px;
  border: 1px solid #d8e2f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.training-next-card.accent {
  border-color: #f4b763;
  background: #fffaf0;
}
.training-next-card b {
  display: block;
  color: var(--brand);
  font-size: 16px;
  margin-bottom: 8px;
}
.training-next-card p {
  margin: 0 0 12px;
  color: var(--muted);
}
.training-next-card ol {
  margin: 0;
  padding-left: 21px;
  color: var(--muted);
}
.training-next-card li {
  margin: 7px 0;
}
.training-next-card .button {
  width: 100%;
  text-align: center;
}
.training-bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  .training-lesson-hero,
  .training-source-band {
    align-items: stretch;
    flex-direction: column;
  }
  .training-hero-actions,
  .training-material-actions {
    justify-content: stretch;
  }
  .training-material-actions .button,
  .training-hero-actions .button {
    width: 100%;
    text-align: center;
  }
  .training-material-actions .onboarding-presentation-button {
    justify-content: center;
    white-space: normal;
    line-height: 1.3;
  }
  .training-lesson-layout {
    grid-template-columns: 1fr;
  }
  .training-lesson-main,
  .training-lesson-aside {
    grid-column: auto;
    grid-row: auto;
  }
  .training-lesson-aside {
    position: static;
    order: 2;
  }
  .training-lesson-main {
    order: 1;
  }
}
@media (max-width: 520px) {
  .training-lesson-page {
    gap: 12px;
  }
  .training-lesson-hero,
  .training-source-band,
  .training-lesson-card,
  .mini-test-card,
  .mini-test-question,
  .training-next-card {
    padding: 14px;
  }
  .training-hero-copy {
    flex-direction: column;
  }
  .training-hero-icon {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    font-size: 28px;
  }
  .training-lesson-hero h1 {
    font-size: 25px;
  }
  .training-lesson-hero p {
    font-size: 15px;
  }
  .training-hero-stats {
    display: grid;
    grid-template-columns: 1fr;
  }
  .training-hero-stats span {
    display: block;
    width: 100%;
    min-height: 40px;
    white-space: normal;
    line-height: 1.3;
  }
  .training-material-actions .onboarding-presentation-button {
    display: block;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }
  .training-lesson-grid,
  .mini-test-options,
  .training-lesson-notes {
    grid-template-columns: 1fr;
  }
  .mini-test-option {
    grid-template-columns: 26px minmax(0, 1fr);
    min-height: 44px;
  }
  .training-bottom-nav {
    display: grid;
    grid-template-columns: 1fr;
  }
  .training-bottom-nav .button {
    width: 100%;
    text-align: center;
  }
}

/* Sortable table headers (curator rating) */
th.sortable a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
th.sortable a:hover { color: var(--brand); }
th.sortable.sort-active a { color: var(--brand); }

/* === Quality call detail: AI summary section highlighting === */
.summary-section {
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
  background: #fafcff;
  border-left: 3px solid var(--line-strong);
}
.summary-section-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.summary-section-body { font-size: 14px; line-height: 1.55; }
.summary-section-body br + br { content: ""; display: block; margin-top: 4px; }
.summary-section.summary-plain { background: #fafcff; }
.summary-section.summary-red {
  background: #fff0ee;
  border-left-color: var(--bad);
}
.summary-section.summary-red .summary-section-title { color: var(--bad); }
.summary-section.summary-weak {
  background: #fff7e8;
  border-left-color: var(--warn);
}
.summary-section.summary-weak .summary-section-title { color: var(--warn); }
.summary-section.summary-good {
  background: #edf9f2;
  border-left-color: var(--good);
}
.summary-section.summary-good .summary-section-title { color: var(--good); }
.summary-section .audio-jump {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(5, 29, 94, .06);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.summary-section .audio-jump:hover { background: rgba(5, 29, 94, .12); }

/* Header strip on the AI разбор panel — verdict + score + meta */
.quality-page-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 6px 0;
}
.quality-page-meta > div {
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.quality-page-meta b { color: var(--muted); font-weight: 600; display: block; font-size: 12px; margin-bottom: 2px; }
.quality-page-meta span { color: var(--ink); font-weight: 600; }
.quality-dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 12px;
}
.quality-dashboard-head h1 { margin-bottom: 2px; }
.quality-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.quality-summary-card {
  border: 1px solid #d8e3f2;
  border-left: 4px solid #2f6fed;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  min-width: 0;
  box-shadow: 0 8px 22px rgba(20, 43, 88, .05);
}
.quality-summary-card b {
  display: block;
  color: var(--brand);
  font-size: 26px;
  line-height: 1;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.quality-summary-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.quality-summary-card.danger { border-left-color: var(--bad); background: #fff7f6; }
.quality-summary-card.warn { border-left-color: var(--warn); background: #fffaf0; }
.quality-summary-card.pending { border-left-color: #2f6fed; background: #f4f8ff; }
.quality-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.quality-panel-head h2 { margin: 0 0 2px; }
.quality-panel-head p { margin: 0; }
.quality-priority-panel {
  border-color: #f4c278;
  background: linear-gradient(180deg, #fffaf2, #fff);
}
.quality-priority-panel.ok {
  border-color: #b7dfcd;
  background: #f5fbf7;
}
.quality-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.quality-compact-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.quality-compact-table th,
.quality-compact-table td {
  padding: 9px 10px;
  vertical-align: top;
}
.quality-compact-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.quality-issue-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.quality-issue-pill.danger { color: var(--bad); background: #ffe8e4; }
.quality-issue-pill.warn { color: #9a6500; background: #fff0cc; }
.quality-issue-pill.pending { color: #1e5bbd; background: #eaf2ff; }
.quality-issue-pill.muted { color: var(--muted); background: #edf2f7; }
.quality-issue-pill.ok { color: var(--good); background: #e8f8ef; }
.quality-row-danger td { background: #fff8f7; }
.quality-row-warn td { background: #fffdf4; }
.quality-row-pending td { background: #f7fbff; }
.quality-upload-panel { padding-top: 14px; }
.button.tiny {
  min-height: 0;
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 8px;
}
.ai-verdict-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.ai-verdict-strip .badge { font-size: 14px; padding: 6px 12px; }
.ai-verdict-strip .ai-score { font-size: 22px; font-weight: 700; color: var(--brand); }

/* === Collapsible rubric block on the quality call page === */
.rubric-block { margin-top: 14px; }
.rubric-block .quality-score {
  background: #f1f6ff;
  border: 1px solid #bfd0ee;
  color: var(--brand);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
}
.rubric-block .quality-axis-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.rubric-block .quality-axis-row span {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
}
.rubric-block .quality-axis-row b {
  display: block;
  color: var(--brand);
  font-size: 18px;
  line-height: 1.1;
  margin-bottom: 2px;
}
.rubric-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}
.rubric-details > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--brand);
  font-size: 14px;
  list-style: none;
}
.rubric-details > summary::-webkit-details-marker { display: none; }
.rubric-details > summary::after {
  content: "Раскрыть";
  float: right;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.rubric-details[open] > summary { border-bottom: 1px solid var(--line); }
.rubric-details[open] > summary::after { content: "Свернуть"; }
.rubric-details .quality-grid { padding: 12px; gap: 8px; }

/* === "На что обратить внимание" panel === */
.attention-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.attention-list li {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fafcff;
}
.attention-list li.attention-good { background: #edf9f2; border-left: 4px solid var(--good); }
.attention-list li.attention-bad  { background: #fff0ee; border-left: 4px solid var(--bad); }
.attention-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.attention-sign {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-weight: 700; font-size: 15px;
}
.attention-good .attention-sign { background: var(--good); color: #fff; }
.attention-bad  .attention-sign { background: var(--bad); color: #fff; }
.attention-reason { font-weight: 600; color: var(--ink); }
.attention-good .attention-reason { color: #155f33; }
.attention-bad  .attention-reason { color: #7f1d12; }
.attention-quote { margin-top: 6px; font-size: 13px; color: var(--ink); line-height: 1.5; }

/* card-attention extras */
.attention-card-q { margin-top: 2px; }
.attention-why { margin-top: 4px; font-style: italic; }

/* Emergency profile gate */
.emergency-profile-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: 32px 0;
}
.emergency-profile-card {
  width: min(760px, 100%);
  border-top: 5px solid var(--brand);
}
.emergency-profile-card h1 {
  margin-bottom: 8px;
}
.emergency-profile-card textarea {
  resize: vertical;
  min-height: 110px;
}
.profile-readonly-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.readonly-value {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
  font-weight: 700;
}
.inline-details {
  margin-top: 10px;
}
.inline-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}
.profile-sensitive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.profile-sensitive-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
  white-space: pre-wrap;
}
.emergency-curator-panel.warn {
  border-left: 5px solid var(--warn);
  background: #fffaf0;
}
.emergency-curator-panel.ok {
  border-left: 5px solid var(--good);
  background: #f2fbf6;
}
.pending-registration-panel {
  border-left: 5px solid var(--warn);
  background: #fffaf0;
}
.registration-pending-card {
  max-width: 760px;
  margin: 24px auto;
  border-top: 5px solid var(--warn);
}
.mention-card {
  margin-top: 14px;
  border: 1px solid #f2d6a0;
  border-radius: 8px;
  background: #fff8e9;
  padding: 14px 16px;
  color: var(--ink);
}
.mention-card b {
  color: var(--brand);
}

/* Personal data policy signature */
.personal-data-page {
  display: grid;
  gap: 16px;
}
.personal-data-head {
  border-top: 5px solid var(--brand);
}
.personal-data-viewer-panel {
  padding: 0;
  overflow: hidden;
}
.personal-data-frame {
  min-height: 72vh;
  border: 0;
  background: #fff;
}
.personal-data-sign-panel {
  border-left: 5px solid var(--brand);
}
.personal-data-signed {
  border-left: 5px solid var(--good);
  background: #f2fbf6;
}
.personal-data-form {
  display: grid;
  gap: 14px;
}
.personal-data-check {
  align-items: flex-start;
}
.curator-fold,
.chip-fold {
  margin-top: 10px;
}
.curator-fold > summary,
.chip-fold > summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
}
.curator-fold > summary::-webkit-details-marker,
.chip-fold > summary::-webkit-details-marker {
  display: none;
}
.curator-fold > summary::after,
.chip-fold > summary::after {
  content: "↓";
  color: var(--muted);
}
.curator-fold[open] > summary::after,
.chip-fold[open] > summary::after {
  content: "↑";
}
.curator-fold table {
  margin-top: 10px;
}
.page-view-row-meta {
  display: none;
  margin-top: 5px;
  line-height: 1.45;
}
.curator-fold[open] .page-view-row-meta {
  display: inline-block;
}
.user-role-edit {
  display:block;
  margin-top:6px;
}
.user-role-edit > summary {
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--brand);
  background:#fff;
  border:1px solid var(--line-strong);
  border-radius:8px;
  padding:6px 9px;
  cursor:pointer;
  font-size:12px;
  font-weight:800;
  list-style:none;
}
.user-role-edit > summary::-webkit-details-marker { display:none; }
.user-role-edit > summary::after {
  content:"↓";
  font-size:11px;
}
.user-role-edit[open] > summary::after {
  content:"↑";
}
.user-role-edit form {
  display:grid;
  gap:6px;
  margin-top:8px;
  max-width:260px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  padding:10px;
}
.user-role-edit label {
  margin:0;
  font-size:12px;
}
.chip-fold {
  width: 100%;
}
.chip-fold .test-progress-list.folded {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .emergency-profile-shell {
    display: block;
    min-height: 0;
    padding: 12px 0;
  }
  .emergency-profile-card {
    width: 100%;
  }
  .emergency-profile-card .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .emergency-profile-card .toolbar .button,
  .emergency-profile-card .toolbar button {
    width: 100%;
  }
  .personal-data-frame {
    min-height: 68vh;
  }
  .personal-data-sign-panel .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .personal-data-sign-panel button {
    width: 100%;
  }
}

/* Mobile overflow guard: shared shell/nav/cards/forms */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
img,
video,
iframe,
embed,
object {
  max-width: 100%;
}
.wrap,
.panel,
.nav,
.curator-nav,
.toolbar,
.grid,
.learning-grid,
.review-actions,
.training-lesson-page,
.training-lesson-layout,
.training-lesson-card,
.training-source-band,
.tests-status-panel,
.personal-data-page,
.personal-data-viewer-panel,
.personal-data-sign-panel,
.emergency-profile-card {
  min-width: 0;
}
.nav-chip,
.button,
button,
.pill,
.badge {
  max-width: 100%;
}
@media (max-width: 820px) {
  .nav,
  .curator-nav,
  .wrap {
    width: 100%;
    max-width: 100vw;
  }
  .nav {
    overflow: hidden;
  }
  .nav-right,
  .nav-user,
  .curator-links,
  .history-controls,
  .program-switch,
  .toolbar,
  .training-actions,
  .training-hero-actions,
  .training-material-actions,
  .training-bottom-nav,
  .test-nav,
  .personal-data-form,
  .personal-data-check {
    min-width: 0;
    max-width: 100%;
  }
  .nav-user {
    display: block;
    overflow-wrap: anywhere;
  }
  .nav-user b,
  .nav-user .small {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .curator-links,
  .history-controls {
    width: 100%;
  }
  .desktop-nav-row {
    display: none;
  }
  .mobile-nav-menu {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .mobile-nav-menu summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--brand);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
  }
  .mobile-nav-menu summary::-webkit-details-marker {
    display: none;
  }
  .mobile-nav-menu summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
  }
  .mobile-nav-menu[open] summary::after {
    transform: rotate(225deg) translateY(-2px);
  }
  .mobile-nav-menu-body {
    display: grid;
    gap: 8px;
    padding-top: 8px;
  }
  .curator-links .nav-chip,
  .history-controls .nav-chip,
  .program-switch .nav-chip,
  .toolbar .nav-chip,
  .toolbar .button,
  .toolbar button,
  .test-nav button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
  .curator-links .nav-chip,
  .history-controls .nav-chip {
    padding-left: 8px;
    padding-right: 8px;
  }
  .login-title h1,
  .login-card h1,
  .panel h1,
  .training-lesson-hero h1,
  .personal-data-page h1,
  .emergency-profile-card h1 {
    overflow-wrap: anywhere;
  }
  .personal-data-head,
  .personal-data-viewer-panel,
  .personal-data-sign-panel,
  .emergency-profile-card,
  .tests-status-panel,
  .training-lesson-card,
  .training-source-band {
    width: 100%;
  }
  .personal-data-frame {
    width: 100%;
    display: block;
  }
}
@media (max-width: 520px) {
  .wrap {
    padding-left: 10px;
    padding-right: 10px;
  }
  .curator-nav {
    padding-left: 10px;
    padding-right: 10px;
  }
  .curator-links,
  .history-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-controls .nav-chip {
    min-height: 40px;
  }
  .nav-right {
    width: 100%;
  }
  .nav-exit {
    max-width: 100%;
  }
  .login-card.panel {
    width: 100%;
  }
  .personal-data-check {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
  }
  .personal-data-check input[type="checkbox"] {
    width: auto;
    min-height: 0;
    margin-top: 4px;
  }
}

/* Final mobile fit fixes: login form, dashboard tiles, quality call controls */
.action-tile,
.action-tile-body,
.action-tile-title,
.action-tile-sub,
.quality-item,
.quality-score,
.quality-axis,
.quality-axis span,
.rubric-block,
.rubric-block .quality-axis-row,
.rubric-block .quality-axis-row span,
.attention-reason,
.attention-quote {
  min-width: 0;
  max-width: 100%;
}
.action-tile-title,
.action-tile-sub,
.quality-item,
.quality-score,
.quality-axis span,
.rubric-block .quality-axis-row span,
.attention-reason,
.attention-quote {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.action-tile-title,
.action-tile-sub {
  display: block;
}
.toolbar form {
  min-width: 0;
  max-width: 100%;
}
.toolbar button,
.toolbar .button {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .login-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .login-card,
  .login-card.panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-self: stretch;
    box-sizing: border-box;
  }
  .login-card.panel {
    padding: 16px;
    overflow: visible;
  }
  .login-card form,
  .login-card label,
  .login-card input,
  .login-card select,
  .login-card button,
  .login-profile,
  .login-profile summary,
  .login-profile-fields {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .login-card input,
  .login-card select,
  .login-card button {
    display: block;
  }
  .login-card-brand {
    min-width: 0;
  }
  .login-card-brand > div {
    min-width: 0;
  }
  .login-card-brand h1 {
    overflow-wrap: anywhere;
  }
  .action-tile {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  .action-tile-icon {
    width: 44px;
    text-align: center;
  }
  .action-grid,
  .direction-leaderboard,
  .leaderboard-list,
  .leaderboard-row,
  .leaderboard-self,
  .quality-scorecard-panel,
  .quality-scorecard-grid,
  .quality-scorecard-mini,
  .standard-checklist,
  .standard-checklist .check-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .leaderboard-row {
    grid-template-columns: auto 34px minmax(0, 1fr);
    overflow: visible;
  }
  .leaderboard-name,
  .leaderboard-score,
  .leaderboard-self,
  .quality-scorecard-head,
  .quality-scorecard-head h2,
  .quality-scorecard-head p,
  .quality-item,
  .quality-item b,
  .standard-checklist .check-row {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .quality-scorecard-head > div {
    min-width: 0;
  }
  .toolbar form,
  .toolbar form button {
    width: 100%;
  }
  .quality-axis,
  .rubric-block .quality-axis-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .quality-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quality-dashboard-head,
  .quality-panel-head {
    flex-direction: column;
    align-items: stretch;
  }
}
