/* ============================================================
   Khan SAT-1600 · Студия контента
   Author: Xudoyorxon Bunyodov / Худоёрхон Бунёдов
   ============================================================ */
.ct { max-width: 1040px; margin: 0 auto; padding: 4px 0 96px; }
.ct-head h1 { margin: 0; font-size: 24px; }
.ct-sub { color: #6B7B88; font-size: 13px; margin: 3px 0 14px; }
.ct-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid #E1E8ED; border-radius: 11px;
  background: #fff; margin-bottom: 14px;
}
.ct-bar select { padding: 7px 10px; border: 1px solid #D6DEE5; border-radius: 8px; font-size: 14px; }
.ct-info { font-size: 12.5px; color: #6B7B88; }
.ct-h2 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .05em;
  color: #6B7B88; margin: 20px 0 8px; font-weight: 700;
}
.ct-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.ct-col {
  padding: 14px 16px; border: 1px solid #E1E8ED; border-radius: 11px; background: #fff;
}
.ct-col .ct-h2 { margin-top: 0; }
.ct-hint { font-size: 12.5px; line-height: 1.6; color: #5A6B78; margin-bottom: 8px; }
.ct-hint code {
  background: #F1F5F8; border: 1px solid #DDE5EB; border-radius: 5px;
  padding: 1px 5px; font-size: 12px;
}
.ct-paste {
  width: 100%; min-height: 150px; padding: 10px; font-family: ui-monospace, monospace;
  font-size: 13px; border: 1px solid #D6DEE5; border-radius: 9px; resize: vertical;
}
.ct-file { display: block; margin: 6px 0 10px; font-size: 13px; }
.ct-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.ct-actions--save { margin-top: 14px; }
.ct-media { margin-top: 10px; display: grid; gap: 5px; }
.ct-m {
  display: flex; gap: 8px; align-items: center; font-size: 13px;
  padding: 6px 10px; background: #F5F8FA; border-radius: 8px;
}
.ct-m span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-m i { color: #8A99A6; font-style: normal; font-size: 12px; }

.ct-secs { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-sec {
  font-size: 12.5px; padding: 5px 10px; border-radius: 8px;
  background: #F1F5F8; color: #46586A;
}
.ct-sec i { color: #93A3AF; font-style: normal; }

.ct-rows { display: grid; gap: 8px; }
.ct-row {
  display: flex; gap: 10px; padding: 10px 12px;
  border: 1px solid #E1E8ED; border-radius: 10px; background: #fff;
}
.ct-row__g { font-size: 12px; color: #93A3AF; flex: 0 0 62px; padding-top: 8px; }
.ct-row__main { flex: 1 1 auto; min-width: 0; }
.ct-in {
  width: 100%; padding: 7px 10px; font-size: 14px;
  border: 1px solid #D6DEE5; border-radius: 8px;
}
.ct-in--sm { width: 82px; }

.ct-ch { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ct-ch span { font-size: 12.5px; background: #F1F5F8; border-radius: 6px; padding: 3px 8px; }
.ct-ch i { color: #93A3AF; font-size: 12.5px; }
.ct-row__opts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ct-row__opts label { font-size: 12px; color: #6B7B88; display: flex; gap: 5px; align-items: center; }
.ct-del {
  margin-left: auto; border: 1px solid #F0C9CD; background: #fff; color: #922B21;
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer;
}
.ct-result { font-size: 13px; }
.ct-result .is-ok { color: #14562B; }
.ct-result .is-warn { color: #922B21; }

/* медиа в задании */
.mr-audio { display: block; width: 100%; margin: 8px 0; }
.mr-video { display: block; width: 100%; max-height: 380px; margin: 8px 0; border-radius: 8px; background: #000; }

@media (max-width: 620px) {
  .ct-row { flex-direction: column; gap: 6px; }
  .ct-row__g { padding-top: 0; }
  .ct-in--md { width: 100%; }
}
[data-theme="dark"] .ct-bar,
[data-theme="dark"] .ct-col,
[data-theme="dark"] .ct-row { background: #1E2A33; border-color: #2E4150; color: #DDE7EE; }
[data-theme="dark"] .ct-in,
[data-theme="dark"] .ct-paste { background: #16222B; border-color: #2E4150; color: #DDE7EE; }
[data-theme="dark"] .ct-m,
[data-theme="dark"] .ct-sec,
[data-theme="dark"] .ct-ch span { background: #22323E; color: #C3D4E0; }

.mr-svg { margin: 8px 0; text-align: center; }
.mr-svg svg { max-width: 100%; height: auto; }
.ct-fig { margin: 7px 0; }
.ct-fig svg { max-width: 100%; height: auto; border: 1px solid #E6ECF1; border-radius: 8px; background: #fff; }

/* зона перетаскивания файлов */
.ct-drop {
  border: 2px dashed #C4D3DE; border-radius: 11px; padding: 14px;
  text-align: center; font-size: 13px; color: #5A6B78; margin: 10px 0;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: border-color .15s, background .15s;
}
.ct-drop.is-over { border-color: var(--k-green, #1B5E20); background: #F1F8F2; }
[data-theme="dark"] .ct-drop { border-color: #2E4150; color: #C3D4E0; }
.ct-bulk { font-size: 12.5px; color: #46586A; display: flex; gap: 6px; align-items: center; }
.ct-bulk select { padding: 6px 9px; border: 1px solid #D6DEE5; border-radius: 8px; }

/* панель формул и живой показ */
.fm-bar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 8px 0 6px; }
.fm-b {
  min-width: 34px; padding: 6px 9px; font-size: 14px; cursor: pointer;
  border: 1px solid #D6DEE5; background: #fff; border-radius: 8px; color: #1B3A4B;
}
.fm-b:hover { background: #EEF3F7; border-color: #9FC3DA; }
.fm-hint { font-size: 11.5px; color: #8A99A6; margin-left: 4px; }
.ct-preview {
  display: none; padding: 8px 12px; margin-bottom: 6px; border-radius: 9px;
  background: #F1F8F2; color: #14562B; font-size: 15px; line-height: 1.6;
}
[data-theme="dark"] .fm-b { background: #1E2A33; border-color: #2E4150; color: #DDE7EE; }
[data-theme="dark"] .ct-preview { background: #22323E; color: #C3D4E0; }
.ct-tmpl { font-size: 12.5px; color: #5A6B78; margin-top: 4px; }
.ct-tmpl a { font-weight: 600; }
.ct-warn { font-size: 12.5px; color: #922B21; background: #FDEBEC; border-radius: 7px; padding: 5px 9px; margin: 5px 0; }
[data-theme="dark"] .ct-warn { background: #3A2326; color: #F0B9BC; }

/* вложения и предпросмотр-решение */
.ct-attach { margin-top: 6px; gap: 6px; }
.ct-att { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  background: #F1F5F8; border-radius: 8px; padding: 3px 6px; }
.ct-att.is-set { background: #EAF7EE; }
.ct-att button { border: 0; background: none; cursor: pointer; font-size: 12px; color: #35485A; padding: 3px 4px; }
.ct-att i { font-style: normal; color: #14562B; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-att__x { color: #922B21 !important; }
.ct-play { margin-left: auto; border: 1px solid #BFD9EC; background: #F7FBFE; color: #1B4F72;
  border-radius: 8px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }

.ct-modal { position: fixed; inset: 0; z-index: 320; background: rgba(12,24,32,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.ct-modal__b { background: #fff; border-radius: 13px; padding: 16px 18px; max-width: 560px;
  width: 100%; max-height: 90vh; overflow: auto; }
.ct-modal__h { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.ct-modal__h button { border: 0; background: #F1F5F8; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; }
.ct-solve__t { font-size: 16px; line-height: 1.55; margin-bottom: 10px; }
.ct-solve__img, .ct-solve__vid { display: block; max-width: 100%; border-radius: 9px; margin: 8px 0; }
.ct-modal__b audio { width: 100%; margin: 8px 0; }
.ct-opts { display: grid; gap: 7px; margin: 10px 0; }
.ct-opt { text-align: left; padding: 10px 13px; border: 1px solid #D6DEE5; background: #fff;
  border-radius: 9px; cursor: pointer; font-size: 14.5px; }
.ct-opt:hover { border-color: #9FC3DA; background: #F7FBFE; }
.ct-free { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.ct-verdict { font-size: 14px; margin-top: 6px; }
.ct-verdict .is-ok { color: #14562B; font-weight: 600; }
.ct-verdict .is-warn { color: #922B21; font-weight: 600; }
.ct-solve__e { margin-top: 10px; font-size: 13px; color: #46586A; background: #F5F8FA; border-radius: 8px; padding: 8px 11px; }
[data-theme="dark"] .ct-modal__b { background: #1E2A33; color: #DDE7EE; }

/* полоса показателей в шапке конструктора — базовый вид для всех режимов */
.ct-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ct-stat {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: #EEF3F7; border: 1px solid #DDE5EB;
  font-size: 12.5px; color: #46586A; white-space: nowrap;
}
.ct-stat b { font-size: 14.5px; color: #1B3A4B; }
.ct-stat--gold { background: #FBF4DD; border-color: #EBDCA8; color: #6F5510; }
[data-theme="dark"] .ct-stat { background: #22323E; border-color: #2E4150; color: #C3D4E0; }
[data-theme="dark"] .ct-stat b { color: #EAF3F8; }

/* ---------- трёхколоночная раскладка конструктора ---------- */
.ct-pro { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1280px) {
  .ct-pro { grid-template-columns: 236px minmax(0, 1fr) 316px; align-items: start; }
  .ct-lib, .ct-meta { position: sticky; top: 74px; }
}
.ct-lib, .ct-meta {
  padding: 14px 16px; border: 1px solid #E1E8ED; border-radius: 12px; background: #fff;
}
.ct-lib__list { display: grid; gap: 6px; }
.ct-lib__b {
  text-align: left; padding: 9px 12px; border: 1px solid #DDE5EB; border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 13px;
}
.ct-lib__b:hover { border-color: #1B5E20; background: #F4FBF5; }
.ct-lib__b b { display: block; }
.ct-lib__b span { font-size: 11.5px; color: #7C8B97; }
.ct-lib__hint { font-size: 11.5px; color: #6B7B88; margin-top: 10px; line-height: 1.5; }

.ct-meta__g { font-size: 12px; color: #93A3AF; }
.ct-meta__t { font-size: 13.5px; line-height: 1.5; margin: 4px 0 10px; }
.ct-meta__f { display: block; font-size: 12px; color: #6B7B88; margin-bottom: 9px; }
.ct-meta__f .ct-in { margin-top: 3px; }
.ct-meta__row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px;
  padding: 5px 0; border-top: 1px solid #EEF3F7; }
.ct-meta__row span { color: #7C8B97; }
.ct-meta__att { margin: 10px 0; display: grid; gap: 4px; font-size: 12px; color: #7C8B97; }
.ct-meta__att .is-set { color: #14562B; }
.ct-row.is-sel { border-color: #1B5E20; box-shadow: 0 0 0 3px rgba(27,94,32,.12); }
[data-theme="dark"] .ct-lib, [data-theme="dark"] .ct-meta { background: #1E2A33; border-color: #2E4150; }
[data-theme="dark"] .ct-lib__b { background: #16222B; border-color: #2E4150; color: #DDE7EE; }

/* ---------- схема разбора архива ---------- */
.ct-dist { display: grid; gap: 6px; margin-bottom: 8px; }
.ct-dist__r {
  display: grid; grid-template-columns: minmax(0,1fr) 26px minmax(0,1fr);
  align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid #E1E8ED; border-radius: 10px; background: #fff;
}
.ct-dist__r.is-lost { border-color: #F0C9CD; background: #FDF6F6; }
.ct-dist__f { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.ct-dist__f b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-dist__f i { font-style: normal; font-size: 11.5px; color: #8A99A6; white-space: nowrap; }
.ct-dist__a { text-align: center; color: #9FC3DA; font-size: 15px; }
.ct-dist__t { display: flex; flex-wrap: wrap; gap: 5px; font-size: 12.5px; }
.ct-dist__t span { background: #EAF7EE; color: #14562B; border-radius: 7px; padding: 3px 9px; }
.ct-dist__t em { color: #922B21; font-style: normal; }
@media (max-width: 620px) {
  .ct-dist__r { grid-template-columns: 1fr; gap: 4px; }
  .ct-dist__a { display: none; }
}
[data-theme="dark"] .ct-dist__r { background: #1E2A33; border-color: #2E4150; }

/* добавление разделов и типов */
.ct-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.ct-add .ct-in { flex: 1 1 180px; }
.ct-sec.is-own { background: #EAF7EE; color: #14562B; display: inline-flex; align-items: center; gap: 6px; }
.ct-sec.is-own button { border: 0; background: none; cursor: pointer; color: #922B21; font-size: 12px; padding: 0 2px; }
[data-theme="dark"] .ct-sec.is-own { background: #1F3527; color: #BFE6C9; }

/* форма одного задания */
.ct-form { max-width: 620px; }
.ct-form .ct-meta__f { font-size: 12.5px; }
.ct-form textarea.ct-in { resize: vertical; font-family: inherit; }
.ct-form__opts { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.ct-form__row { display: grid; gap: 8px; grid-template-columns: 1.4fr .6fr 1fr; }
.ct-form__hint { font-size: 12px; color: #6B7B88; margin: -4px 0 8px; }
@media (max-width: 620px) {
  .ct-form__opts, .ct-form__row { grid-template-columns: 1fr; }
}
