/* sheber.education сайтының түстері (primary #4301FF, gray-900/500/200, фон #FAFAFC, Onest). Мәзір мен футер — /site/site.css. */
:root {
  --brand: #4301ff;
  --brand-dark: #3500d1;
  --brand-soft: #eee8ff;
  --ink: #101828;
  --text: #364153;
  --muted: #6a7282;
  --line: #e5e7eb;
  --bg: #fafafc;
  --card: #ffffff;
  --danger: #c62828;
  --ok: #1b8a4b;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Onest", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { color: var(--ink); margin: 0; }

.top { max-width: 1040px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand); text-decoration: none; font-size: 18px; }
.brand-logo { width: 38px; height: 38px; flex: none; display: block; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.demo-badge { display: block; width: max-content; margin: 14px auto 0; position: relative; z-index: 2; font-size: 13px; background: #fff4d6; color: #7a5200; padding: 6px 12px; border-radius: 999px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h1 em { color: var(--brand); font-style: italic; }
.lead { max-width: 640px; margin: 14px 0 26px; font-size: 17px; }

.kgroup { margin: 6px 0 18px; }
.kgroup-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.kgroup-head h2 { font-size: 20px; color: var(--ink); }
.kgroup-head p { margin: 0; font-size: 14px; color: var(--muted); }
#kinds2 { margin-top: 28px; }
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kind { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; font: inherit; color: inherit; transition: border-color .2s, box-shadow .2s, transform .2s; }
.kind:hover { border-color: color-mix(in srgb, var(--tint) 35%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23, 23, 47, .07); }
.kind[aria-selected="true"] { border-color: var(--tint); box-shadow: 0 10px 26px color-mix(in srgb, var(--tint) 16%, transparent); }
.kind-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tint-bg); color: var(--tint); margin-bottom: 4px; transition: transform .25s; }
.kind:hover .kind-ic, .kind[aria-selected="true"] .kind-ic { transform: scale(1.06); }
.kind-ic svg, .howto svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kind b { color: var(--ink); font-size: 17px; line-height: 1.25; }
.kind-desc { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.kind-meta { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--tint); }
.kind .new { position: absolute; top: 14px; right: 14px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--tint); padding: 2px 9px; border-radius: 999px; }
.kind-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .2s; }
.kind-check::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.kind[aria-selected="true"] .kind-check { opacity: 1; transform: scale(1); }
.kind[aria-selected="true"] .new { display: none; }
.kind:focus-visible, .seg button:focus-visible, .btn:focus-visible, .hint-btn:focus-visible { outline: 3px solid #b8a8ff; outline-offset: 2px; }

/* Бағдар: үш қадам */
.howto { list-style: none; margin: -6px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: how; }
.howto li { counter-increment: how; position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.howto .hi { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); position: relative; }
.howto .hi::after { content: counter(how); position: absolute; right: -4px; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.howto b { color: var(--ink); font-size: 15px; }
.howto small { color: var(--muted); font-size: 13px; }
.howto li:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 8px; height: 8px; border: solid #c9bfff; border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); z-index: 1; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.form { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; position: relative; min-width: 0; }
.label { font-weight: 600; color: var(--ink); font-size: 15px; }
.label i { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
input, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.hint-btn { justify-self: start; background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 14px; cursor: pointer; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { font: inherit; font-size: 15px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 4px; background: none; border: 0; border-radius: 14px; cursor: pointer; font: inherit; color: var(--text); }
.sw:hover .sw-chip { border-color: #b8a8ff; }
.sw-chip { width: 64px; height: 42px; border-radius: 11px; border: 1.5px solid var(--line); display: flex; align-items: flex-end; gap: 4px; padding: 7px; }
.sw-chip i { display: block; width: 12px; height: 12px; border-radius: 50%; }
.sw.on .sw-chip { outline: 3px solid var(--brand); outline-offset: 2px; }
.sw.on .sw-name { color: var(--ink); font-weight: 700; }
.sw-name { font-size: 12px; line-height: 1.1; }
.sw-auto .sw-chip { align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; background: conic-gradient(from 200deg, #4a1fff, #ff7a59, #12a594, #f7d774, #4a1fff); }
.sw:focus-visible { outline: 3px solid #b8a8ff; }
.palbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; padding: 12px 16px; }

.submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; padding: 13px 22px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.muted { color: var(--muted); font-size: 14px; }
.error { margin: 0; color: var(--danger); font-size: 14px; }

.recent { margin-top: 32px; }
.recent h2 { font-size: 20px; margin-bottom: 10px; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent a { display: flex; gap: 12px; align-items: baseline; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.recent a:hover { border-color: #c9bfff; }
.recent .tag { flex: none; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; }
.recent .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.back { display: inline-block; margin: 6px 0 16px; text-decoration: none; font-weight: 600; }

/* Күту */
.wait { text-align: center; padding: 36px 22px; }
.wait h2 { font-size: 22px; margin: 16px 0 6px; }
.spinner { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; margin: 22px auto 0; padding: 0; max-width: 380px; text-align: left; display: grid; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.steps li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { border-color: var(--brand); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 9px var(--brand); }
.steps li.past { color: var(--text); }
.steps li.past::before { border-color: var(--ok); background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Нәтиже */
.bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding: 14px 16px; }
.bar p { flex: 1; min-width: 180px; margin: 0; font-weight: 600; color: var(--ink); }
.bar .btn { padding: 10px 18px; font-size: 15px; }
.note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 5vw, 56px); font: 16px/1.6 "Times New Roman", Times, serif; color: #111; overflow-wrap: anywhere; }
.paper .udk { margin: 0 0 8px; }
.paper .title { text-align: center; font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.paper .author { text-align: center; font-weight: 700; margin: 0 0 18px; }
.paper h3 { text-align: center; font: inherit; font-weight: 700; color: #111; margin: 22px 0 8px; }
.paper p { margin: 0 0 8px; text-align: justify; text-indent: 1.25cm; }
.paper p.plain { text-indent: 0; }
.paper .tbl { overflow-x: auto; margin: 8px 0 14px; }
.paper table { border-collapse: collapse; width: 100%; font-size: 15px; }
.paper th, .paper td { border: 1px solid #000; padding: 6px 8px; text-align: left; vertical-align: top; }
.paper th { text-align: center; }
.paper ol { margin: 0; padding-left: 1.6em; }
.paper ol li { margin-bottom: 6px; }

.deck { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.frame > .slide { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

.foot { max-width: 1040px; margin: 0 auto; padding: 0 16px 28px; font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  .kinds { grid-template-columns: 1fr !important; }
  .kind { padding: 12px 14px; }
  .row { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .deck { grid-template-columns: 1fr; }
  .bar { position: static; }
  .btn.primary { width: 100%; }
}

.warn { margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: #fff4d6; color: #7a5200; font-size: 14px; }

/* Мұғалім аватары */
.kind b em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); padding: 2px 8px; border-radius: 999px; vertical-align: 3px; margin-left: 4px; }
.av-stage { margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #efe5d3; aspect-ratio: 16 / 9; }
.av-stage canvas { display: block; width: 100%; height: 100%; }
.av-wrap { flex-wrap: wrap; }
.av-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.av-tags > span { display: contents; }
.av-tag { font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.av-tag:hover { border-color: var(--brand); color: var(--brand); }
.av-ai { background: linear-gradient(135deg, #4a1fff, #8a5cff); border-color: transparent; color: #fff; }
.av-ai:hover { color: #fff; filter: brightness(1.08); }
.av-ai:disabled { opacity: .6; cursor: default; }
.av-stop { border-color: #ffa8a8; color: var(--danger); }
.av-name { background: var(--brand-soft); border-color: #d6ccff; color: var(--brand); }
.av-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.av-meta .over { color: var(--danger); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; align-self: end; padding-bottom: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.av-status { font-size: 14px; color: var(--muted); }
.av-status.wait { color: var(--brand); font-weight: 600; }
.av-status.ok { color: var(--ok); }
.av-status.err { color: var(--danger); }

/* ҚМЖ */
.lesson-fields { display: grid; gap: 18px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.warn ul { margin: 6px 0; padding-left: 18px; }
.warn small { color: #9a7a2e; }
.paper.kmj { font-size: 14px; line-height: 1.45; padding: clamp(14px, 3vw, 36px); }
.paper .kmj-approve { text-align: right; margin-bottom: 10px; }
.paper .kmj-subj { text-align: center; margin-bottom: 12px; }
.paper .kmj-h { font-weight: 700; margin: 18px 0 8px; }
.paper.kmj table { font-size: 14px; }
.kmj-info th { width: 30%; text-align: left; background: #fafafa; }
.kmj-flow { min-width: 860px; }
.kmj-flow thead th { background: #ededed; }
.kmj-flow td { width: 17%; }
.kmj-flow td:nth-child(2) { width: 33%; }
.kmj-flow td.st { width: 13%; }
.kmj-flow td p { margin: 0 0 6px; text-indent: 0; text-align: left; }
.kmj-ic { display: block; margin: 0 auto 6px; width: 44px; height: 44px; }
.kmj-flow td.st .kmj-ic { margin-top: 6px; }
.paper .mini { margin: 4px 0 8px; font-size: 13px; }
.paper .mini th { background: #ededed; }

/* Материал мен тілектер: бір жолақ (мәтін + «+» арқылы файл) */
.compose { display: grid; gap: 8px; padding: 10px 12px 8px; border: 1.5px solid var(--line); border-radius: 20px; background: #fff; cursor: text; transition: border-color .15s, background .15s, box-shadow .15s; }
.compose:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.compose.over { border-color: var(--brand); border-style: dashed; background: #faf9ff; }
.compose textarea { border: 0; padding: 4px 2px; min-height: 52px; resize: vertical; background: transparent; box-shadow: none; outline: none; }
.compose textarea:focus { border: 0; box-shadow: none; outline: none; }
.compose-bar { display: flex; align-items: center; gap: 12px; cursor: default; }
.compose-add { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.compose-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.compose-add:focus-within { outline: 3px solid #b8a8ff; outline-offset: 2px; }
.compose-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.compose-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.compose-note { font-size: 13px; color: var(--muted); }
.compose .files { display: flex; flex-wrap: wrap; gap: 8px; }
.compose .files li { padding: 5px 6px 5px 5px; gap: 8px; max-width: 260px; border-radius: 12px; background: #faf9ff; }
.compose .files img, .compose .files .ext { width: 38px; height: 38px; }
.compose .files button { width: 28px; height: 28px; font-size: 17px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.files:empty { display: none; }
.files li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.files img, .files .ext { flex: none; width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.files .ext { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12px; }
.files .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 14px; }
.files .fn small { display: block; color: var(--muted); font-size: 12px; }
.files button { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.files button:hover { border-color: var(--danger); color: var(--danger); }
.material { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; }
.wait .material { display: inline-block; margin: 8px 0 0; }

/* Форма қадамдарының нөмірі (жасырын өрістер есептелмейді) */
.form { counter-reset: step; }
.label.step { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; }
.label.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.label.step i { margin-left: 0; }

/* Анимациялар */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes swap { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin2 { to { transform: rotate(360deg); } }
.rise { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
h1.rise { animation-delay: .02s; } .lead.rise { animation-delay: .08s; } .howto.rise { animation-delay: .14s; }
.kinds .kind { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.kinds .kind:nth-child(1) { animation-delay: .18s; } .kinds .kind:nth-child(2) { animation-delay: .23s; } .kinds .kind:nth-child(3) { animation-delay: .28s; }
.kinds .kind:nth-child(4) { animation-delay: .33s; } .kinds .kind:nth-child(5) { animation-delay: .38s; }
.kinds.ready .kind { animation: none; }
#form { animation: rise .55s .4s cubic-bezier(.2, .7, .2, 1) both; }
#form.swap { animation: swap .35s ease both; }
.btn.primary { transition: background .2s, transform .15s, box-shadow .2s; }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(74, 31, 255, .25); }
.btn.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin2 .8s linear infinite; }
.files li { animation: rise .3s ease both; }
.wait, .bar, .paper, .deck, .av-stage { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 720px) {
  .howto { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
  .howto li { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 6px; padding: 10px 6px; }
  .howto .hi { grid-row: auto; width: 34px; height: 34px; }
  .howto b { font-size: 12.5px; line-height: 1.25; }
  .howto small { display: none; }
  .howto li:not(:last-child)::after { right: -6px; width: 6px; height: 6px; }
  .kinds { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .kinds .kind:last-child { grid-column: 1 / -1; }
  .kind { padding: 12px; gap: 4px; }
  .kind-ic { width: 36px; height: 36px; border-radius: 10px; }
  .kind-ic svg { width: 20px; height: 20px; }
  .kind b { font-size: 15px; }
  .kind-desc { display: none; }
  .kind-meta { padding-top: 2px; }
  .kind-check, .kind .new { top: 10px; right: 10px; }
}

/* Курстық жұмыс пен реферат өрістері */
.long-fields { display: grid; gap: 14px; }
.long-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#cwOnly { display: grid; gap: 10px; }
#cwOnly[hidden] { display: none; }
@media (max-width: 640px) { .long-grid { grid-template-columns: 1fr; } }
