/* Страницы темы, материалов и тестов */
[hidden] { display: none !important; }
a.btn { text-decoration: none; }

/* метки в списке тем */
.t-link { text-decoration: none; }
.t-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 10px; vertical-align: 1px; }
.badges .chip { font-size: 12px; padding: 2px 8px; }
.chip.yellow { background: #F3EBA2; }
.open-topic {
  text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 9px; margin-right: 6px;
  background: #F1F0FA; white-space: nowrap;
}
.open-topic:hover { background: var(--lav); }

/* главная ученика: новое */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 26px; }
.news h3 { margin-bottom: 8px; }
.news-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; text-decoration: none; }
.news-row:hover { background: #F6F5FC; }
.news-row i { width: 12px; height: 34px; border-radius: 6px; flex: none; }
.news-row span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.news-row small { color: var(--ink-soft); }

/* страница темы */
.topic-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-chip { padding: 5px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.topic-title { margin: 12px 0 8px; }
.block-title { margin: 28px 0 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.block-head .block-title { margin-bottom: 12px; }
.list { display: grid; gap: 12px; }
.row-card { display: flex; align-items: center; gap: 14px; text-decoration: none; padding: 16px 20px; flex-wrap: wrap; }
.row-card:hover { box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 30px -14px rgba(45,42,74,.4); }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.empty.small { padding: 20px; }
.ficon {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em; background: #EFEEF8;
  box-shadow: 0 2px 0 rgba(255,255,255,.7) inset, 0 6px 12px -8px rgba(45,42,74,.5);
}
.ficon-pdf { background: #F5B3B0; }
.ficon-img { background: #A9C8F2; }
.ficon-doc, .ficon-docx, .ficon-odt { background: #C2C1F5; }
.ficon-ppt, .ficon-pptx { background: #F6B9D2; }
.ficon-xls, .ficon-xlsx { background: #BCBF7E; }
.ficon-link { background: #F3EBA2; }
.ficon-text { background: #F6F3C1; }
.ficon-test { background: var(--ink); color: #fff; }
.m-card { padding: 16px 20px; }
.m-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.m-top .grow { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.m-meta { color: var(--ink-soft); font-size: 14px; margin: 8px 0 0 68px; word-break: break-all; }
.m-text { margin: 12px 0 0 68px; line-height: 1.6; }
.m-img { display: block; max-width: min(100%, 520px); max-height: 360px; border-radius: 14px; margin: 12px 0 0 68px; }
.m-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 0 68px; padding-top: 10px;
  border-top: 1px solid #F1F0F9; font-size: 13px; color: var(--ink-soft);
}

/* добавление материала */
.add-material { margin-top: 18px; }
.add-material h3 { margin-bottom: 12px; }
.seg { display: inline-flex; background: #F1F0FA; border-radius: 13px; padding: 4px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 650; padding: 8px 16px; border-radius: 10px; cursor: pointer; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 4px 10px -6px rgba(45,42,74,.4); }
.drop {
  display: block; text-align: center; padding: 28px 16px; border: 2px dashed #D6D4F0; border-radius: 16px;
  background: #FAFAFE; cursor: pointer; font-weight: 400; margin-bottom: 8px; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { background: #F1F0FC; border-color: var(--accent-strong); }
#picked { font-size: 14px; margin-bottom: 8px; }
.audience { margin: 14px 0 6px; }
.radio { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 8px 0; font-weight: 600; cursor: pointer; }
.radio input { width: auto; margin: 0; accent-color: var(--ink); }
textarea { resize: vertical; line-height: 1.5; }
label textarea { margin-top: 6px; font-weight: 400; }
.modal.wide { max-width: 720px; }
.modal textarea { margin: 10px 0 0; }
.hint-box summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); margin: 8px 0; }
.hint-box pre { white-space: pre-wrap; background: #F6F5FC; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; margin: 0; }

/* редактор теста */
.title-input {
  font-size: clamp(22px, 4vw, 30px); font-weight: 800; letter-spacing: -.02em; background: transparent;
  border-color: transparent; padding: 6px 8px; flex: 1; min-width: 240px;
}
.title-input:hover { border-color: rgba(45,42,74,.15); background: rgba(255,255,255,.5); }
.title-input:focus { background: #fff; }
.settings { margin-bottom: 10px; }
.set-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 44px; height: 26px; border-radius: 99px; background: #DDDBEF; position: relative; transition: background .2s; flex: none; }
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--olive); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.inline input { width: auto; margin: 0; }
.check.plain { background: none; padding: 0; margin: 4px 0 12px; font-weight: 500; }
.results { padding: 8px 12px; }
.res-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 10px 8px; border-radius: 10px; text-decoration: none; }
.res-row:hover { background: #F6F5FC; }
.res-row + .res-row { border-top: 1px solid #F1F0F9; }
.q-edit { margin-bottom: 14px; }
.q-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.q-top select { width: auto; }
.q-num { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 11px; background: var(--accent); font-weight: 800; }
.pts { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.pts input { width: 70px; margin: 0; }
.q-top .tools button { background: #F1F0FA; }
.q-top .tools button:disabled { opacity: .35; cursor: default; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.save-bar {
  position: sticky; bottom: 14px; z-index: 5; margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 18px; padding: 12px 14px 12px 20px; box-shadow: var(--shadow);
}
.save-bar.dirty { box-shadow: 0 0 0 2px var(--pink), var(--shadow); }

/* прохождение теста */
.q-card { margin-bottom: 14px; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.q-prompt { font-size: 17px; line-height: 1.55; margin-bottom: 14px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; margin: 0 0 6px;
  font-weight: 400; cursor: pointer; background: #FAFAFE;
}
.opt:hover { background: #F1F0FC; }
.opt input { width: auto; margin: 4px 0 0; accent-color: var(--ink); flex: none; }
.opt span { font-weight: 700; }
.ans { max-width: 360px; font-size: 17px; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; background: #FAFAFE; border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; }
.match p { margin: 6px 0; }
.match.small { font-size: 14px; }
.match-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.match-pick label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; }
.match-pick select { width: 64px; margin: 0; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.photo {
  position: relative; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 12px; overflow: hidden;
  background: #EFEEF8; font-weight: 800; text-decoration: none;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 8px; border: 0; background: rgba(255,255,255,.9); cursor: pointer; }
.photo-btn { cursor: pointer; margin: 0; }
.result-sum { display: flex; align-items: center; gap: 22px; margin: 14px 0 20px; flex-wrap: wrap; }
.result-sum .big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.result-sum .big small { font-size: 20px; color: var(--ink-soft); font-weight: 600; }
.result-sum.done { box-shadow: 0 0 0 2px var(--olive), var(--shadow); }
.result-sum.checking { box-shadow: 0 0 0 2px var(--pink), var(--shadow); }
.q-card[class*="res-"] { border-left: 6px solid #E4E3F0; }
.q-card.res-ok { border-left-color: var(--olive); }
.q-card.res-half { border-left-color: #E9DC7A; }
.q-card.res-bad { border-left-color: #F5B3B0; }
.q-card.res-wait { border-left-color: var(--pink); }
.q-card.res-essay { border-left-color: var(--lav); }
.score-pill { font-weight: 700; font-size: 14px; background: #F1F0FA; padding: 4px 10px; border-radius: 99px; }
.ans-row { margin: 6px 0; }
.ans-row.ok { color: #5F6233; font-weight: 600; }
.opts-ro { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.opts-ro p { margin: 3px 0; }
.essay-ans { background: #FAFAFE; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.essay-ans small { display: block; color: var(--ink-soft); font-weight: 600; }
.criteria { background: var(--yel); border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }

/* домашнее задание */
.ficon-hw { background: var(--yel); }
.ficon.small { width: 40px; height: 40px; border-radius: 11px; font-size: 9px; }
.hw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.hw-pane h3 { margin-bottom: 10px; }
.hw-pane textarea { min-height: 240px; }
.hw-files { display: grid; gap: 8px; margin-bottom: 10px; }
.hwf { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: #FAFAFE; }
.hwf .grow a { text-decoration: none; font-weight: 600; word-break: break-word; }
.hwf .grow a:hover { text-decoration: underline; }
.hwf-thumb { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex: none; }
.hwf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.small-note { font-size: 14px; margin-bottom: 10px; }
.drop.small { padding: 18px 12px; }
.drop.busy { opacity: .55; pointer-events: none; }
.hw-task { margin: 8px 0 14px; }
.hw-task h3 { margin: 14px 0 10px; }
.hw-text { line-height: 1.6; white-space: normal; }
.hw-status { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.hw-status.ok { box-shadow: 0 0 0 2px var(--olive), var(--shadow); }
.hw-status.back { box-shadow: 0 0 0 2px var(--pink), var(--shadow); }
.hw-status.wait { box-shadow: 0 0 0 2px var(--lav), var(--shadow); }
.hw-answer { margin-bottom: 14px; }
.hw-answer.st-submitted { box-shadow: 0 0 0 2px var(--pink), var(--shadow); }
.hw-answer-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hw-answer .hw-grid { margin-bottom: 10px; }
.hw-answer .hw-pane { background: #FAFAFE; border-radius: 14px; padding: 12px 14px; }
.hw-answer .hwf { background: #fff; }
.hw-grade { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hw-grade input { flex: 1; min-width: 200px; }
.hw-grade select { width: auto; margin: 0; }

@media (max-width: 760px) {
  .hw-grid { grid-template-columns: 1fr; }
  .m-meta, .m-text, .m-img, .m-foot { margin-left: 0; }
  .two, .match { grid-template-columns: 1fr; }
  .res-row { grid-template-columns: 1fr auto; }
  .res-row small { grid-column: 1 / -1; }
  .badges { margin-left: 0; display: flex; margin-top: 4px; }
}

/* ---------- общее для новых разделов ---------- */
.field-title { font-weight: 600; font-size: 14px; margin-top: 6px; }
.muted.small, .small { font-size: 13px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); margin: 0; }
label.inline input, label.inline select { width: auto; padding: 6px 10px; }

/* курсы и предметы */
.course-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.course-bar #courseTitle { flex: 1; min-width: 200px; font-weight: 700; font-size: 17px; }
.subj-list { display: grid; gap: 10px; margin: 14px 0; }
.subj-row, .subj-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subj-row input, .subj-add input { flex: 1; min-width: 160px; }
.subj-add { padding-top: 12px; border-top: 1px solid var(--line); }

/* заявки преподавателей */
.t-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; }
.t-row .grow { flex: 1; min-width: 240px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.t-row .grow > b { display: inline; }
.t-about { font-size: 14px; background: #F7F6FD; border-radius: 10px; padding: 6px 10px; white-space: pre-wrap; }
.t-row input[type=number] { width: 100px; }

/* папки */
.crumbs { margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.folder { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; }
.folder .chip { font-size: 12px; padding: 1px 8px; }
.folder .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.folder .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder:hover { box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 14px 30px -14px rgba(45,42,74,.4); }
.f-icon { width: 38px; height: 30px; border-radius: 6px 8px 8px 8px; background: var(--accent); position: relative; flex: none; }
.f-icon::before { content: ''; position: absolute; left: 0; top: -5px; width: 16px; height: 8px; border-radius: 4px 4px 0 0; background: var(--accent); }
.files { margin-bottom: 16px; }
.file-row .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-row .grow b { overflow-wrap: anywhere; }

/* пробники */
.mk-card { padding: 16px; margin-bottom: 18px; }
.mk-card h3 { margin: 0 0 10px; }
.mk-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mk-head .mk-title { flex: 1; min-width: 200px; font-weight: 700; font-size: 17px; }
.mk-head select { width: auto; }
.mk-palette { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 14px; position: sticky; top: 8px; z-index: 5; }
.mk-sw { width: 28px; height: 28px; border-radius: 8px; border: 2px solid rgba(45,42,74,.15); cursor: pointer; padding: 0; }
.mk-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.mk { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.mk th, .mk td { border: 1px solid #D9C4CB; padding: 0; height: 30px; text-align: center; }
.mk th { background: #FBF7F8; font-weight: 600; min-width: 54px; }
.mk th.mk-label { text-align: left; padding: 0 8px; min-width: 190px; position: sticky; left: 0; z-index: 1; color: #2E4B9C; }
.mk td { min-width: 54px; background: #fff; }
.mk input { border: 0; background: transparent; width: 100%; height: 30px; padding: 0 4px; text-align: center; border-radius: 0; font-size: 14px; }
.mk input:focus { box-shadow: none; background: rgba(194,193,245,.25); }
.mk input.mk-row { text-align: left; padding: 0; color: #2E4B9C; font-weight: 600; }
.mk th[data-col] { position: relative; }
.mk-x, .mk-tools button { border: 0; background: #fff; border-radius: 6px; cursor: pointer; font-size: 11px; padding: 1px 5px; color: var(--ink-soft); box-shadow: 0 0 0 1px var(--line); }
.mk-x { position: absolute; top: -8px; right: -6px; display: none; z-index: 2; }
.mk th[data-col]:hover .mk-x { display: block; }
.mk th.mk-label[data-row] { position: sticky; }
.mk th.mk-label[data-row] { display: table-cell; }
.mk-tools { display: none; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); gap: 3px; }
.mk th.mk-label[data-row]:hover .mk-tools { display: inline-flex; }
.mk-add { border: 0 !important; background: transparent !important; padding-left: 6px !important; }
.mk td.sel { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
.mk tr.mk-subtotal th, .mk tr.mk-subtotal td, .mk tr.mk-total th, .mk tr.mk-total td { background: #FBF3D9; font-weight: 700; }
.mk tr.mk-result th, .mk tr.mk-result td { background: #F6E27A; font-weight: 800; }
.mk tr.mk-subtotal input, .mk tr.mk-total input, .mk tr.mk-result input { font-weight: 700; }
.mk td.mk-sum { color: var(--ink); }
.mk td.mk-orange { background: #FFC58A; } .mk td.mk-yellow { background: #F6EE9C; } .mk td.mk-green { background: #CFE3A3; }
.mk td.mk-red { background: #F5B3B0; } .mk td.mk-blue { background: #BFD6F5; } .mk td.mk-violet { background: #D6D5FA; }

/* приложение */
.app-state { padding: 14px 18px; margin-bottom: 16px; font-weight: 600; }
.app-state.pink { background: #FCE3EC; } .app-state.olive { background: #EEF1D8; }
.app-card { padding: 22px; }
.btn.big { font-size: 17px; padding: 14px 22px; }
.app-notes { margin: 16px 0 0; background: #F7F6FD; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.app-steps { margin: 18px 0 8px; padding-left: 22px; line-height: 1.6; }
