/* Ступени / Дворец творчества на Стопани.
   Brand layer; rich lesson, quiz and administration components live in styles.css. */
:root {
  /* Radix-inspired Sage + Teal system: neutral green-gray surfaces with accessible teal accents. */
  --sage-1: #fbfdfc;
  --sage-2: #f7f9f8;
  --sage-3: #eef1f0;
  --sage-4: #e6e9e8;
  --sage-5: #dfe2e0;
  --sage-6: #d7dad9;
  --sage-7: #cbcfcd;
  --sage-8: #b8bcba;
  --sage-9: #868e8b;
  --sage-10: #7c8481;
  --sage-11: #5f6563;
  --sage-12: #1a211e;
  --teal-1: #fafefd;
  --teal-2: #f3fbf9;
  --teal-3: #e0f8f3;
  --teal-4: #ccf3ea;
  --teal-5: #b8eae0;
  --teal-6: #a1ded2;
  --teal-7: #83cdc1;
  --teal-8: #53b9ab;
  --teal-9: #12a594;
  --teal-10: #0e9888;
  --teal-11: #067a6f;
  --teal-12: #10302b;

  --bg: var(--sage-2);
  --surface: #fff;
  --surface-soft: var(--sage-3);
  --line: var(--sage-6);
  --text: var(--sage-12);
  --muted: var(--sage-11);
  --primary: var(--teal-11);
  --primary-dark: var(--teal-12);
  --primary-soft: var(--teal-3);
  --success: #2a7e57;
  --success-soft: #e9f6ee;
  --warning: #765b18;
  --warning-soft: #fff4d6;
  --danger: #a33a3a;
  --danger-soft: #fff0ee;
  --sidebar: #fff;
  --sidebar-muted: var(--sage-11);
  --shadow: 0 14px 36px rgba(26, 33, 30, .07);
  --radius-lg: 20px;
  --radius-md: 14px;
  --topbar-height: 88px;
  --teal: var(--teal-8);
  --coral: #eab393;
  --yellow: #f3dda0;
}
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
html, body { font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif; font-size: 16px; line-height: 1.5; }
body { overflow-x: clip; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
button, .btn, .nav-item, .lesson-link { touch-action: manipulation; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 19px; height: 19px; flex: 0 0 auto; }
a { text-underline-offset: 3px; }
.ui-icon { width: 21px; height: 21px; display: block; flex: 0 0 auto; vertical-align: middle; fill: currentColor; overflow: visible; pointer-events: none; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 2000; padding: 12px 20px; background: var(--primary); color: #fff; border-radius: 10px; }
.skip-link:focus { top: 14px; }
.small { font-size: 14px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }
.btn { min-height: 46px; padding: 11px 19px; border-radius: 12px; font-size: 15px; font-weight: 650; line-height: 1.4; text-decoration: none; }
.btn:hover { transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 0 rgba(25, 86, 82, .10); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--sage-3); color: var(--teal-12); border: 1px solid var(--sage-6); }
.btn-secondary:hover { background: var(--sage-4); }
.btn-danger:hover { background: #fbe0da; }
.btn-success { background: #e4f1e7; color: #2c7255; }
.btn-small { min-height: 40px; padding: 8px 13px; font-size: 14px; }
.btn-block { min-height: 54px; gap: 20px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: #f0f4ee; color: var(--primary); }
.btn-icon:hover { background: var(--primary-soft); }
.field { gap: 9px; margin-bottom: 21px; }
.field label { font-size: 14px; font-weight: 650; color: var(--text); }
.input, .select, .textarea { min-height: 48px; border-color: #d7dfd4; border-radius: 12px; padding: 12px 15px; font-size: 16px; }
.input::placeholder, .textarea::placeholder { color: var(--sage-11); opacity: 1; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #e0f0e9; }

/* Entry screen: supplied identity and a quiet, spacious form. */
.login-page { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; background: var(--bg); }
.login-panel { display: grid; grid-template-columns: .92fr 1.08fr; width: min(980px, 100%); padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 24px 70px rgba(50, 69, 50, .08); align-items: stretch; }
.login-identity { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 44px 34px; background: #edf5ec; border-right: 1px solid #e0e9db; text-align: center; }
.stopani-logo { width: 210px; height: auto; mix-blend-mode: multiply; }
.login-identity-copy h1 { margin: 4px 0 12px; font-size: 44px; line-height: 1.15; letter-spacing: -.035em; font-weight: 750; }
.login-identity-copy p { margin: 0; color: #546c60; font-size: 18px; line-height: 1.65; }
.login-identity-copy .eyebrow { font-size: 11px; }
.login-card { width: 100%; padding: 64px 46px 46px; border: 0; border-radius: 0; box-shadow: none; display: block; align-self: center; }
.login-card h2 { margin: 12px 0 12px; font-size: clamp(26px, 2.5vw, 32px); line-height: 1.18; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 30px; line-height: 1.65; font-size: 16px; }
.login-card > .login-help { margin: 24px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.75; }
.password-control { position: relative; }
.password-control .input { padding-right: 52px; }
.password-toggle { position: absolute; right: 5px; top: 3px; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); }
.login-footer { padding-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }

/* Main platform: horizontal navigation, matching the supplied reference. */
.login-panel { min-height: 0; }
.import-dropzone { background: #eef7f1; border-color: #a5c8b3; }
.shell { min-height: 100svh; display: flex; flex-direction: column; }
.platform-header { position: sticky; top: 0; z-index: 40; display: flex; gap: clamp(14px, 2.3vw, 36px); align-items: center; min-height: var(--topbar-height); padding: 10px max(24px, calc((100vw - 1432px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.platform-home { flex: 0 0 auto; text-decoration: none; border-radius: 10px; }
.brand-mark { font-size: 18px; gap: 11px; color: var(--text); }
.brand-logo { display: block; width: 48px; height: 48px; padding: 3px; object-fit: contain; border: 1px solid #e2e8dd; border-radius: 12px; background: #fff; }
.brand-wordmark { display: grid; gap: 2px; }
.brand-wordmark strong { font-size: 17px; font-weight: 800; letter-spacing: .12em; line-height: 1.3; }
.brand-wordmark small { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.sidebar { position: static; display: block; height: auto; width: auto; padding: 0; background: transparent; color: var(--text); z-index: auto; transform: none; box-shadow: none; flex: 1; }
.nav { display: flex; align-items: center; justify-content: center; gap: 4px; }
.nav-item { width: auto; min-height: 46px; padding: 11px 13px; gap: 8px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.nav-item:hover { background: #f0f4ee; color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-icon { width: 19px; height: 19px; }
.mobile-brand, .sidebar-footer, .sidebar-backdrop, .mobile-menu { display: none; }
.topbar { position: static; display: flex; flex: 0 1 auto; gap: 9px; height: auto; padding: 0; border: 0; background: transparent; backdrop-filter: none; z-index: auto; min-width: 0; }
.user-chip { border: 0; background: transparent; padding: 0; gap: 11px; min-width: 0; border-radius: 0; }
.avatar { width: 43px; height: 43px; flex: 0 0 auto; border-radius: 50%; background: #dceee4; color: #365d4b; font-size: 14px; font-weight: 700; }
.user-meta { min-width: 0; line-height: 1.35; max-width: 175px; }
.user-name { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 12px; margin-top: 2px; }
.main { flex: 1; width: 100%; display: flex; flex-direction: column; }
.content { width: min(1440px, 100%); max-width: 1440px; margin: 0 auto; padding: 38px 28px 48px; flex: 1; }
.platform-footer { display: flex; justify-content: space-between; gap: 18px; width: min(1384px, calc(100% - 56px)); margin: auto auto 0; padding: 22px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.platform-footer > span:first-child { font-weight: 700; color: #486052; }
.hero { align-items: center; gap: 24px; margin-bottom: 30px; }
.hero h1 { font-size: clamp(28px, 2.8vw, 36px); letter-spacing: -.035em; line-height: 1.2; margin-bottom: 10px; }
.hero p { font-size: 16px; line-height: 1.65; }
.hero > .btn { flex-shrink: 0; }
.card { border-radius: 18px; box-shadow: none; }
.card-head { padding: 24px 24px 0; }
.card-title { font-size: 18px; font-weight: 700; }
.card-body { padding: 22px 24px 24px; }
.metrics { gap: 16px; margin-bottom: 28px; }
.metric { padding: 22px 24px; border-radius: 16px; background: #e5f1e9; border-color: #d9e6db; }
.metric:nth-child(4n + 2) { background: #e5f3f1; border-color: #d3e7e1; }
.metric:nth-child(4n + 3) { background: #fbf0db; border-color: #eee2c5; }
.metric:nth-child(4n + 4) { background: #f8e9e0; border-color: #efded2; }
.metric:nth-child(4n + 5) { background: #edf0e2; border-color: #e2e6d2; }
.metric-label { font-size: 14px; font-weight: 500; color: #53665a; margin-bottom: 12px; }
.metric-value { font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -.045em; }
.continue-learning { background: #e6f3ef; border-color: #cfe5db; border-radius: 20px; padding: 30px; box-shadow: none; }
.continue-copy h2 { font-size: 27px; line-height: 1.25; margin: 9px 0 12px; }
.continue-copy p { color: #526e61; }
.continue-learning > .btn { flex-shrink: 0; }
.progress-track { height: 8px; background: #e2e9df; }
.continue-learning .progress-track { background: #cadfd3; }
.progress-fill { background: var(--primary); }
.badge { font-size: 12px; font-weight: 650; padding: 6px 10px; gap: 5px; }
.badge.gray { background: #edf0e9; color: #626d62; }

/* Courses and results. */
.course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.course-card { overflow: hidden; border-radius: 18px; padding: 0; display: flex; flex-direction: column; gap: 0; min-height: 340px; transition: box-shadow .18s, border-color .18s; }
.course-card:hover { transform: none; border-color: #a7c8b7; box-shadow: var(--shadow); }
.course-cover { padding: 22px 24px; background: #e6f2ec; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 90px; }
.course-card:nth-child(3n + 2) .course-cover { background: #fcf0d9; }
.course-card:nth-child(3n + 3) .course-cover { background: #f8e6db; }
.course-cover > .ui-icon { width: 34px; height: 34px; color: #527463; }
.course-cover .badge { background: rgba(255, 255, 255, .75); color: #466253; }
.course-card-body { padding: 24px 24px 16px; flex: 1; }
.course-card h3 { margin: 0 0 12px; font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.course-card p { font-size: 15px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-card-footer { padding: 6px 24px 24px; }
.course-card-footer > .btn { width: 100%; margin-top: 20px; justify-content: space-between; }
.course-meta { gap: 16px; font-size: 13px; margin-top: 16px; }
.course-progress-line strong { font-size: 14px; color: var(--primary); }
.course-search { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; }
.course-search .input { width: min(460px, 100%); }
.course-search > span { margin-left: auto; white-space: nowrap; font-size: 14px; color: var(--muted); }
.course-grid > .empty { grid-column: 1 / -1; background: #fff; border: 1px dashed #cbdac9; border-radius: 18px; }
.empty { padding: 48px 24px; font-size: 15px; line-height: 1.7; }
.empty strong { font-size: 21px; font-weight: 650; margin-bottom: 10px; }
table { font-size: 15px; }
th { background: #f0f3ec; color: #5d6d5f; font-size: 12px; font-weight: 650; padding: 15px 18px; }
td { padding: 18px; font-size: 15px; line-height: 1.5; }
tbody tr:hover { background: #f8faf5; }
.toolbar .input { background: #fff; }
.action-menu-popover { border-radius: 12px; border-color: var(--line); padding: 6px; }
.action-menu-popover button { font-size: 14px; min-height: 42px; }
.action-menu-popover button:hover { background: var(--primary-soft); }
.certificate-card { background: #fff; border-color: var(--line); border-radius: 18px; box-shadow: none; padding: 26px; gap: 22px; }
.certificate-card-mark { width: 62px; height: 70px; background: #fcf0d5; color: #8a6928; border-radius: 14px; box-shadow: none; }
.certificate-card-copy h3 { font-size: 21px; }
.certificate-link-preview { background: #f3f6f0; border-color: var(--line); font-size: 13px; color: var(--muted); }

/* Lesson reading, practice and assessment. */
.course-window-topbar { min-height: 80px; height: auto; padding: 14px max(28px, calc((100vw - 1460px) / 2)); background: #fff; backdrop-filter: none; }
.course-window-topbar .brand-logo { width: 45px; height: 45px; }
.standalone-course-content { width: min(1500px, 100%); padding: 28px 28px 48px; }
.course-shell { grid-template-columns: 290px minmax(0, 1040px); gap: 26px; }
.course-nav { border-radius: 16px; padding: 18px 14px; top: 106px; }
.standalone-course-content .course-nav { top: 106px; }
.course-nav h3 { font-size: 17px; margin: 4px 8px 18px; line-height: 1.4; }
.course-module summary { font-size: 14px; padding: 13px 8px; }
.module-label { font-size: 12px; }
.lesson-link { min-height: 46px; padding: 11px 10px; font-size: 14px; color: #5a6a60; border-radius: 9px; line-height: 1.5; }
.lesson-link:hover { background: #f0f4ec; }
.lesson-link.active { background: #e3f0e8; color: #245a43; font-weight: 650; }
.lesson-state { width: 20px; height: 20px; display: grid; place-items: center; font-size: 14px; }
.lesson-state .ui-icon { width: 16px; height: 16px; }
.reader-head { padding: 30px 34px; border-radius: 18px; background: #e9f2e8; border-color: #dbe6d5; }
.reader-head h1 { font-size: clamp(26px, 2.3vw, 34px); color: var(--text); line-height: 1.25; }
.reader-head p { color: #5b6c5e; }
.lesson-card { padding: 34px; border-radius: 18px; box-shadow: none; }
.lesson-card h2 { font-size: 28px; color: var(--text); line-height: 1.3; }
.content-block { font-size: 17px; line-height: 1.8; color: #344c40; }
.text-small, .text-muted { font-size: 15px; }
.text-lead, .markdown-lead { color: #3b5848; font-size: 19px; }
.learning-outcomes { background: #f0f5eb; border-color: #dde8d5; }
.learning-outcomes > strong { color: #375640; }
.learning-outcomes li { color: #53674e; }
.callout, .callout.info, .callout.example { background: #eaf4f1; border-color: #74b7aa; }
.callout.note { background: #f5f1e2; border-color: #c2b07b; }
.callout.warning { background: #fff4dc; border-color: #dec271; }
.practice { background: #fdf9f0; border: 1px solid #eadfc5; border-left: 4px solid #d9b572; padding: 24px; }
.practice .badge { background: #f7eac9; color: #806226; }
.practice h3 { font-size: 21px; line-height: 1.35; }
.quiz { background: #f0f7f3; border-color: #cfe2d4; padding: 24px; border-radius: 16px; }
.quiz h3 { font-size: 22px; }
.question { padding: 20px; background: #fff; border-color: #dfe7db; }
.question-title { font-size: 17px; line-height: 1.7; }
.question-number, .question-instruction { font-size: 13px; }
.option { padding: 13px 15px; min-height: 48px; border-color: #dde5d8; border-radius: 10px; font-size: 16px; }
.option:hover { background: #eff7ed; border-color: #a9c8b0; }
.option:has(input:checked) { border-color: #639a7b; background: #eaf4e9; }
.quiz-answer-review > span, .quiz-feedback-explanation > span { font-size: 12px; }
.quiz-result, .practice-result { font-size: 15px; }
.download-block { background: #f3f6ef; border-color: #dde6d8; }
.download-icon { background: #e0efe1; color: #47774e; }
.download-copy > strong { color: var(--text); }
.lesson-footer-nav { padding: 20px; border-radius: 16px; }
.course-complete-banner { background: #e8f4e9; border-color: #c8dec9; }
.content-image img { box-shadow: none; }
.code-snippet-stage { background: #e9efe5; padding: 22px; border-radius: 14px; }
.code-snippet-stage::before, .code-snippet-stage::after { display: none; }
.code-window { background: #fcfdf9; border: 1px solid #d6dfcf; box-shadow: 0 8px 20px rgba(53, 75, 41, .06); }
.code-window-bar { background: #eef3e8; border-bottom-color: #dbe4d3; }
.code-window-language { color: #657558; background: transparent; }
.code-copy { background: #e0ebd9; border-color: #c9d9bc; color: #38552c; min-height: 36px; font-size: 12px; }
.code-copy:hover, .code-copy.copied { background: #cce3c5; color: #31552a; border-color: #9ab98e; }
.code-editor, .code-snippet-pre { background: #fcfdf9; color: #3b4e39; }
.code-line-numbers { background: #f4f7ef; color: var(--sage-11); border-right-color: #e2e9da; }
.code-caption, .code-title { color: #637456; }
.token-comment { color: var(--sage-11); }
.token-string { color: #386827; }
.token-property { color: #246f6b; }
.token-keyword { color: #875337; }
.token-number, .token-literal { color: #99533b; }
.inline-code { background: #edf3e8; border-color: #dbe6d1; color: #536b41; }

/* Dialogs, import and credentials. */
.modal-backdrop { background: rgba(29, 53, 41, .35); backdrop-filter: blur(3px); }
.modal { border-radius: 22px; box-shadow: 0 28px 70px rgba(27, 54, 35, .18); }
.modal-head { padding: 22px 26px; }
.modal-body { padding: 26px; }
.modal-head h2, .modal-head h3 { font-size: 22px; }
.import-drop { background: #eef7f1; border-color: #a5c8b3; }
.import-drop-icon { background: var(--primary); border-radius: 13px; }
.import-preview-head .eyebrow { font-size: 12px; }
.import-meta-grid span, .import-stat-grid span { font-size: 12px; }
.import-meta-grid strong, .import-status, .import-warning-list, .import-warning, .confirm-check { font-size: 14px; }
.credential-card { background: #f5f8f0; border-color: #d8e4cb; }
.credential-row code, .admin-login-code { background: #eaf1e3; color: #3b5735; border-color: #d1dfc5; font-size: 15px; }
.access-item:hover { background: #f2f7ee; }
.access-item { font-size: 15px; padding: 14px; }
.access-item small { font-size: 13px; }
.toast { border-radius: 13px; font-size: 15px; }
.load-error { background: #fff; border-color: var(--line); }

@media (max-width: 1250px) {
  .platform-header { gap: 18px; padding-inline: 24px; }
  .platform-header .user-meta { display: none; }
  .nav-item { padding-inline: 12px; }
}
@media (max-width: 1000px) {
  .brand-wordmark small { display: none; }
  .brand-logo { width: 43px; height: 43px; }
  .platform-header { gap: 12px; padding-inline: 18px; }
  .nav-item { font-size: 14px; padding-inline: 10px; }
  .nav-item .nav-icon { display: none; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-shell { grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
  .lesson-card, .reader-head { padding: 26px; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --topbar-height: 76px; }
  .platform-header { min-height: 76px; padding: 12px 18px; gap: 12px; }
  .platform-home { margin-right: auto; }
  .brand-wordmark strong { font-size: 16px; }
  .brand-wordmark small { display: block; font-size: 10px; }
  .topbar { gap: 7px; }
  .topbar .user-chip { display: none; }
  .mobile-menu { display: inline-flex; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 330px); height: 100svh; display: flex; flex-direction: column; padding: 24px 18px; background: #fff; z-index: 61; transform: translateX(-110%); transition: transform .18s; box-shadow: 12px 0 44px rgba(33, 66, 39, .12); }
  .sidebar.open { transform: translateX(0); }
  .mobile-brand { display: block; padding: 4px 8px 30px; }
  .sidebar .brand-mark { padding: 0; }
  .sidebar .brand-logo { width: 44px; height: 44px; }
  .nav { display: grid; gap: 8px; }
  .nav-item { font-size: 16px; min-height: 52px; padding: 14px; width: 100%; }
  .nav-item .nav-icon { display: block; width: 21px; height: 21px; }
  .sidebar-footer { display: block; margin-top: auto; border-top: 1px solid var(--line); color: var(--muted); padding: 20px 8px 0; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(29, 53, 41, .35); opacity: 0; pointer-events: none; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .content { padding: 26px 18px 36px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 25px; }
  .hero h1 { font-size: 29px; }
  .hero > .btn { width: 100%; }
  .hero p { font-size: 15px; }
  .metrics, .metrics.metrics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .metric { padding: 19px 17px; }
  .metric-value { font-size: 30px; }
  .metric-label { font-size: 13px; }
  .continue-learning { padding: 24px; }
  .continue-copy h2 { font-size: 24px; }
  .continue-learning > .btn { width: 100%; }
  .course-grid { gap: 16px; }
  .course-card-body, .course-cover { padding: 21px; }
  .course-card-footer { padding: 4px 21px 21px; }
  .course-search { flex-wrap: wrap; }
  .course-search .input { width: 100%; }
  .course-search > span { margin-left: 0; }
  .course-shell { grid-template-columns: minmax(0, 1fr); }
  .course-nav { display: none; }
  .standalone-course-content { padding: 18px 14px 32px; }
  .course-window-topbar { padding: 12px 18px; }
  .course-window-topbar .brand-wordmark small { display: none; }
  .reader-head, .lesson-card { padding: 24px; }
  .lesson-card h2 { font-size: 25px; }
  .practice, .quiz { padding: 20px 16px; }
  .question { padding: 16px 13px; }
  .lesson-footer-nav { padding: 18px; }
  .lesson-complete-side { flex-wrap: wrap; gap: 12px; }
  .lesson-complete-side .btn { flex: 1 1 auto; }
  .card-head { padding: 21px 20px 0; }
  .card-body { padding: 20px; }
  .platform-footer { width: calc(100% - 36px); font-size: 11px; }
  .login-page { padding: 24px 16px; justify-content: flex-start; }
  .login-panel { grid-template-columns: 1fr; max-width: 500px; border-radius: 22px; }
  .login-identity { flex-direction: row; gap: 22px; padding: 24px; border-right: 0; border-bottom: 1px solid #e0e9db; text-align: left; }
  .stopani-logo { width: 95px; }
  .login-identity-copy h1 { font-size: 32px; margin: 5px 0; }
  .login-identity-copy p { font-size: 14px; }
  .login-identity-copy .eyebrow { font-size: 10px; letter-spacing: .08em; }
  .login-card { padding: 30px 28px; }
  .login-card h2 { font-size: 29px; }
  .login-card > p { margin-bottom: 24px; }
  .modal-backdrop { padding: 14px; }
  .modal-head, .modal-body { padding: 21px; }
}
@media (min-width: 761px) and (max-width: 860px) {
  .sidebar { transform: none; display: block; width: auto; height: auto; box-shadow: none; }
  .sidebar-backdrop, .mobile-menu { display: none; }
  .brand-wordmark small { display: none; }
  .platform-header .user-chip { display: none; }
}
@media (max-width: 560px) {
  .course-grid { grid-template-columns: minmax(0, 1fr); }
  .course-card { min-height: 0; }
  .course-cover { min-height: 80px; }
  .certificate-card { padding: 22px; }
  .content-block { font-size: 16px; }
  .reader-head, .lesson-card { padding: 23px 19px; }
  .course-complete-actions .btn { width: 100%; }
  .code-snippet-stage { padding: 10px; }
  .code-snippet-pre { font-size: 13px; }
  .platform-footer { flex-direction: column; gap: 4px; }
}
@media (max-width: 380px) {
  .brand-wordmark small { display: none; }
  .login-identity { gap: 16px; padding: 22px 18px; }
  .stopani-logo { width: 76px; }
  .login-card { padding: 28px 22px; }
  .metrics, .metrics.metrics-4 { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Course Player v3 — learning-first presentation layer. */
.course-nav-kicker {
  margin: 4px 8px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.course-nav-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.course-nav-progress-head strong { color: var(--primary); font-size: 13px; }
.course-nav-progress-copy { margin: 7px 8px 16px; }

/* The lesson is an open reading surface; cards are reserved for activities. */
.reader-head {
  margin-bottom: 6px;
  color: var(--text);
  padding: 12px 4px 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.reader-head .eyebrow { color: var(--muted); }
.reader-head h1 {
  max-width: 850px;
  margin: 8px 0 10px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.12;
  letter-spacing: -.035em;
}
.lesson-context {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sage-11);
  font-size: 12px;
  font-weight: 750;
}
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.lesson-meta > span {
  padding: 5px 9px;
  border: 1px solid #dce6da;
  border-radius: 999px;
  background: #f6f8f3;
  color: var(--teal-12);
  font-size: 12px;
  font-weight: 700;
}
.reader-head .lesson-description {
  max-width: 760px;
  margin-top: 16px;
  color: var(--sage-11);
  font-size: 16px;
  line-height: 1.65;
}
.learning-outcomes.lesson-outcomes {
  max-width: 760px;
  margin-top: 16px;
  padding: 0;
  border: 1px solid #dfe7d9;
  border-radius: 12px;
  background: #f8faf6;
}
.lesson-outcomes > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  color: var(--teal-12);
  font-size: 13px;
  font-weight: 750;
  list-style: none;
}
.lesson-outcomes > summary::-webkit-details-marker { display: none; }
.lesson-outcomes > summary > span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e8f0e4;
  font-size: 11px;
}
.lesson-outcomes ul { margin: 0; padding: 0 34px 14px; }
.lesson-outcomes li { margin-top: 7px; color: var(--sage-12); line-height: 1.55; }

.lesson-card.lesson-flow {
  padding: 12px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.lesson-card.lesson-flow > .content-block:first-child { margin-top: 6px; }

/* Course TOC is structural navigation, not another card hierarchy. */
.course-nav {
  border-color: #e1e7dc;
  box-shadow: none;
}
.course-module { margin-top: 10px; padding-top: 10px; }
.lesson-link { border: 1px solid transparent; }
.lesson-link.active {
  border-color: #cadfcd;
  background: #edf5eb;
  box-shadow: inset 3px 0 0 #5e8f6f;
}
.lesson-link.active .lesson-state { color: #2f6b4c; }

/* Lesson TOC is intentionally lighter than the course navigation. */
.lesson-section-nav {
  top: 94px;
  margin: 8px 0 22px;
  padding: 7px 2px;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(246,247,243,.96);
  box-shadow: none;
}
.lesson-section-nav-label { padding-left: 2px; font-size: 10px; letter-spacing: .075em; }
/* Keep the lesson TOC horizontally usable without showing a distracting top scrollbar. */
.lesson-section-nav-links {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lesson-section-nav-links::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.lesson-section-nav a {
  position: relative;
  padding: 8px 9px 9px;
  border-radius: 7px;
  background: transparent;
}
.lesson-section-nav a:hover { background: #eef3ea; color: var(--text); }
.lesson-section-nav a.active { background: transparent; color: #315e45; }
.lesson-section-nav a.active::after {
  content: '';
  position: absolute;
  right: 9px;
  bottom: -8px;
  left: 9px;
  height: 2px;
  border-radius: 2px;
  background: #5f8b70;
}

/* Semantic section grammar: small signals, not large tinted containers. */
.lesson-section {
  position: relative;
  margin-bottom: 42px;
  padding: 0 0 34px;
  border-bottom: 1px solid #e3e8de;
  background: transparent;
}
.lesson-section-head { align-items: center; margin-bottom: 22px; }
.lesson-section-head > div { min-width: 0; }
.lesson-section-head h2 { font-size: clamp(23px, 2vw, 29px); letter-spacing: -.025em; }
.lesson-section-head > div::before {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--sage-11);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.section-theory .lesson-section-head > div::before { content: 'Теория'; }
.section-practice .lesson-section-head > div::before { content: 'Практика'; color: #765b18; }
.section-assessment .lesson-section-head > div::before { content: 'Проверка знаний'; color: #216645; }
.section-media .lesson-section-head > div::before { content: 'Медиа'; color: var(--teal-11); }
.section-reference .lesson-section-head > div::before { content: 'Справочный материал'; color: var(--sage-11); }
.section-default .lesson-section-head > div::before { content: 'Раздел'; }
.section-reference,
.section-assessment,
.section-media {
  padding: 0 0 34px;
  border: 0;
  border-bottom: 1px solid #e3e8de;
  border-radius: 0;
  background: transparent;
}
.section-reference { opacity: 1; }
.section-reference .lesson-section-content { padding-left: 16px; border-left: 2px solid #d9e0d6; }
.section-assessment .lesson-section-content { padding-left: 16px; border-left: 3px solid #89a795; }
.section-media .lesson-section-content { padding-left: 16px; border-left: 2px solid #a8c3ba; }
.section-top-link { border: 0; background: transparent; }
.section-top-link:hover { background: #eef3ea; color: #315e45; }

/* Activities get the visual containment removed from passive reading. */
.practice {
  margin: 26px 0;
  padding: 24px 24px 22px;
  border: 1px solid #e1d5b8;
  border-left: 4px solid #c89f55;
  border-radius: 14px;
  background: #fffaf0;
}
.practice .badge { letter-spacing: .025em; text-transform: uppercase; }
.practice .practice-solution { border-color: #cbe2d2; background: #f3faf5; }
.quiz {
  margin: 28px 0;
  padding: 26px;
  border: 1px solid #d5e1d6;
  border-top: 4px solid #71947d;
  border-radius: 14px;
  background: #f8fbf7;
}
.quiz > .row-wrap:first-child { margin-bottom: 10px; }
.question {
  margin-top: 22px;
  padding: 22px 0 0;
  border: 0;
  border-top: 1px solid #dfe6dd;
  border-radius: 0;
  background: transparent;
}
.question:first-of-type { padding-top: 4px; }
.option {
  min-height: 52px;
  margin: 8px 0;
  padding: 13px 15px;
  border-color: #d9e2d8;
  border-radius: 10px;
  background: #fff;
}
.option:hover { border-color: #9ebca7; background: #f5faf4; }
.option:has(input:checked) { border-color: #5f8d70; background: #ebf5eb; box-shadow: 0 0 0 2px rgba(95,141,112,.08); }
.quiz-feedback-explanation { padding-top: 2px; border-top: 1px solid #dfe7dd; }

/* Reference is intentionally quiet until the learner asks for it. */
.content-collapsible {
  border-color: #e0e5dc;
  border-radius: 10px;
  background: #fafbf8;
}
.content-collapsible > summary { padding: 12px 14px; font-size: 13px; }
.collapsible-source,
.collapsible-reference { background: #fafbf8; }
.collapsible-source > summary::before,
.collapsible-transcript > summary::before { opacity: .75; }

.course-mobile-context { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.course-mobile-context > span:last-child { display: grid; min-width: 0; }
.course-mobile-context strong { font-size: 12px; }
.course-mobile-context small {
  max-width: min(62vw, 420px);
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.course-mobile-progress { flex: 0 0 auto; color: var(--primary); font-size: 13px; font-weight: 800; }

@media (max-width: 1000px) {
  .reader-head { padding: 10px 2px 22px; }
  .lesson-card.lesson-flow { padding: 8px 0 0; }
}
@media (max-width: 760px) {
  .reader-head,
  .lesson-card,
  .lesson-card.lesson-flow { padding-right: 0; padding-left: 0; }
  .reader-head h1 { font-size: clamp(28px, 8vw, 36px); }
  .lesson-section-nav { top: 76px; margin-inline: -2px; }
  .lesson-section { margin-bottom: 34px; padding-bottom: 28px; }
  .section-reference .lesson-section-content,
  .section-assessment .lesson-section-content,
  .section-media .lesson-section-content { padding-left: 10px; }
  .practice, .quiz { padding: 20px 16px; }
  .course-mobile-toc { position: sticky; top: 76px; z-index: 19; }
}
@media (max-width: 560px) {
  .reader-head,
  .lesson-card,
  .lesson-card.lesson-flow { padding-right: 0; padding-left: 0; }
  .lesson-meta { gap: 6px; }
  .lesson-meta > span { font-size: 11px; }
  .course-mobile-context small { max-width: 54vw; }
}

/* Course Player v3.1 — scroll-aware navigation and contrast audit. */
.course-scroll-header {
  will-change: transform;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.course-scroll-header.is-scroll-hidden { transform: translateY(-105%); }
html.course-header-hidden { --course-sticky-top: 12px; }
html:not(.course-header-hidden) { --course-sticky-top: 94px; }
.lesson-section-nav { top: var(--course-sticky-top, 94px); transition: top 180ms ease; }
.standalone-course-content .course-nav { transition: top 180ms ease; }
html.course-header-hidden .standalone-course-content .course-nav { top: 20px; }

/* Мелкие подписи проходят AA на светлых поверхностях без снижения визуальной иерархии. */
.course-reader .muted,
.course-reader .small.muted,
.course-nav .muted,
.lesson-context,
.lesson-section-head > div::before,
.section-reference .lesson-section-head > div::before,
.course-mobile-context small,
.code-caption,
.code-title { color: #58675f; }
.section-reference { opacity: 1; }
.code-line-numbers { color: #65745f; }
.token-comment { color: #5f7157; }

@media (max-width: 760px) {
  html:not(.course-header-hidden) { --course-sticky-top: 76px; }
  html.course-header-hidden { --course-sticky-top: 8px; }
  .course-mobile-toc { top: var(--course-sticky-top, 76px); transition: top 180ms ease; }
  .lesson-section-nav { top: calc(var(--course-sticky-top, 76px) + 54px); }
}

@media (prefers-reduced-motion: reduce) {
  .course-scroll-header,
  .lesson-section-nav,
  .standalone-course-content .course-nav,
  .course-mobile-toc { transition: none !important; }
}

/* Дополнительные правки контрастности для мелкого текста на светлых поверхностях. */
.input::placeholder,
.textarea::placeholder,
.badge.gray,
del,
.download-copy p,
.audio-copy p,
.video-copy p { color: #59675f; }

/* Course Player v3.3: Radix Sage/Teal contrast system and compact admin preview. */
body,
.content,
.standalone-course-content,
.course-reader,
.course-nav,
.lesson-card,
.reader-head,
.question,
.practice,
.quiz,
.learning-outcomes,
.collapsible-block,
.media-group,
.download-block {
  color: var(--text);
}

/* Secondary copy always uses a text token intended for light surfaces. */
.muted,
.small.muted,
.course-nav-kicker,
.course-nav-progress-head,
.course-nav-progress-copy,
.lesson-context,
.reader-head .lesson-description,
.lesson-section-nav-label,
.content-caption,
.image-caption,
.audio-copy p,
.video-copy p,
.download-copy p,
.code-caption,
.code-title {
  color: var(--muted);
}

/* Never inherit legacy white text into the light Course Player surfaces. */
.course-nav h1,
.course-nav h2,
.course-nav h3,
.course-nav h4,
.reader-head h1,
.reader-head h2,
.reader-head h3,
.lesson-card h1,
.lesson-card h2,
.lesson-card h3,
.question,
.option,
.practice,
.quiz {
  color: var(--text);
}

.course-exit-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 36px;
  margin: 0 4px 18px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--teal-11);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}
.course-exit-action:hover { background: var(--teal-2); color: var(--teal-12); }
.course-exit-action:focus-visible { outline-color: var(--teal-11); }

.course-nav-header {
  margin: 0 4px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--sage-5);
}
.course-nav-header .course-nav-kicker {
  margin: 0 0 6px;
  color: var(--sage-11);
}
.course-nav-header h3 {
  margin: 0;
  color: var(--sage-12);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.28;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}

.admin-preview-note {
  display: grid;
  gap: 10px;
  margin: 0 4px 18px;
  padding: 13px 14px 14px;
  border: 1px solid var(--teal-6);
  border-radius: 12px;
  background: var(--teal-2);
  color: var(--sage-12);
  box-shadow: none;
}
.admin-preview-note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.admin-preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--teal-7);
  border-radius: 999px;
  background: var(--teal-3);
  color: var(--teal-12);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
}
.admin-preview-note strong {
  color: var(--teal-12);
  font-size: 13px;
  line-height: 1.3;
}
.admin-preview-note p {
  margin: 0;
  color: var(--sage-11);
  font-size: 12.5px;
  line-height: 1.5;
}


.admin-preview-edit {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
}
/* Contrast-safe light controls. */
.lesson-link { color: var(--sage-11); }
.lesson-link:hover { color: var(--teal-12); }
.lesson-link.active { color: var(--teal-12); background: var(--teal-2); border-color: var(--teal-6); }
.lesson-section-nav a { color: var(--sage-11); }
.lesson-section-nav a:hover,
.lesson-section-nav a.active { color: var(--teal-12); }
.lesson-meta > span { color: var(--teal-12); background: var(--sage-2); border-color: var(--sage-6); }
.option { color: var(--sage-12); background: #fff; border-color: var(--sage-6); }
.option:hover { color: var(--sage-12); background: var(--teal-1); border-color: var(--teal-7); }
.option:has(input:checked) { color: var(--teal-12); background: var(--teal-2); border-color: var(--teal-8); }
.input::placeholder,
.textarea::placeholder { color: var(--sage-11); opacity: 1; }

/* Small code/UI annotations need AA-level contrast too. */
.code-window-language,
.code-line-numbers,
.token-comment { color: var(--sage-11); }
.code-title,
.code-caption { color: var(--sage-11); }

@media (max-width: 1180px) and (min-width: 1001px) {
  .course-shell { grid-template-columns: 260px minmax(0, 1fr); }
  .course-nav-header h3 { font-size: 17px; }
  .admin-preview-note { padding: 12px; }
}

/* v0.14.6 — unified icon alignment */
.btn > .ui-icon, .btn-icon > .ui-icon, .nav-item > .ui-icon { align-self: center; }
.action-menu-popover button, .action-menu-popover .action-menu-link { display: flex; align-items: center; gap: 10px; }
.action-menu-popover .ui-icon { width: 17px; height: 17px; }
.course-mobile-context > .ui-icon { width: 20px; height: 20px; }
.course-exit-action > .ui-icon { width: 17px; height: 17px; }

