:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #d9e0ea;
  --text: #18202c;
  --muted: #617083;
  --primary: #178a58;
  --primary-dark: #126c46;
  --green: #178a58;
  --red: #c2413b;
  --amber: #b7791f;
  --violet: #6d4fc2;
  --shadow: 0 12px 28px rgba(25, 34, 51, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary {
  background: #e7edf5;
  color: var(--text);
}

button.secondary:hover {
  background: #dbe5f1;
}

button.link-button {
  min-height: auto;
  justify-self: start;
  background: transparent;
  color: var(--primary);
  padding: 0;
}

button.link-button:hover {
  background: transparent;
  color: var(--primary-dark);
  text-decoration: underline;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  background: #e7edf5;
  color: var(--text);
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.button-link:hover {
  background: #dbe5f1;
}

button.ghost {
  background: transparent;
  color: var(--primary);
}

button.ghost:hover {
  background: #e8efff;
}

button.danger {
  background: var(--red);
}

.scroll-top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: inline-grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.scroll-top-button:hover {
  background: #1d4ed8;
}

.scroll-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.rich-text-source {
  display: none;
}

.rich-text-wrap {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  padding: 6px;
}

.rich-text-toolbar select {
  width: auto;
  min-height: 32px;
  border-radius: 6px;
  padding: 4px 8px;
}

.rich-text-toolbar .rich-text-color,
.rich-text-toolbar .rich-text-highlight {
  max-width: 112px;
}

.rich-text-button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid #c8d1df;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  padding: 0 8px;
}

.rich-text-button:hover {
  background: #e7edf5;
}

.rich-text-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.rich-text-image-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: #4b5563;
  font-size: 12px;
}

.rich-text-image-size input {
  width: 110px;
  padding: 0;
}

.rich-text-editable {
  min-height: 180px;
  padding: 12px;
  color: var(--text);
  line-height: 1.6;
  outline: none;
  cursor: text;
}

.rich-text-editable :where(p, div, span, mark, strong, b, em, i, u, code, pre, blockquote, ul, ol, li, h3, h4, a) {
  cursor: text;
}

.rich-text-editable code,
.text-block code {
  border-radius: 5px;
  background: #eef8f0;
  color: #111827;
  padding: 1px 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.16em;
  font-weight: 700;
}

.rich-text-editable mark,
.text-block mark {
  border-radius: 5px;
  padding: 1px 5px;
  color: inherit;
}

.rich-text-editable:focus {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.rich-text-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.rich-text-crop-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

.rich-text-crop-head,
.rich-text-crop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.rich-text-crop-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.rich-text-crop-preview {
  display: block;
  max-width: calc(100% - 28px);
  margin: 14px auto;
  border: 1px solid #c8d1df;
  border-radius: 6px;
  background: #f8fafc;
}

.rich-text-crop-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 0 14px 14px;
}

.rich-text-crop-controls label {
  color: #374151;
  font-size: 13px;
}

.rich-text-crop-controls input {
  width: 100%;
  padding: 0;
}

.rich-text-image-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
}

.rich-text-image-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

.rich-text-image-head,
.rich-text-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.rich-text-image-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.rich-text-image-preview-wrap {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin: 14px;
  border: 1px solid #c8d1df;
  border-radius: 6px;
  background: #f8fafc;
  padding: 14px;
}

.rich-text-image-preview-wrap img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  height: auto;
  object-fit: contain;
}

.rich-text-image-control {
  padding: 0 14px 14px;
}

.rich-text-image-control span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #374151;
  font-size: 13px;
}

.rich-text-image-control input {
  width: 100%;
  padding: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow: auto;
}

.loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
}

.login-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  grid-template-rows: 56px 1fr;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -8%, rgba(49, 139, 255, 0.24), rgba(0, 0, 0, 0) 30%),
    linear-gradient(180deg, #050619 0%, #080b20 48%, #050719 100%),
    #020617;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 56px 0 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(80, 178, 255, 0.17), rgba(0, 0, 0, 0) 28%),
    radial-gradient(circle at 18% 72%, rgba(18, 167, 225, 0.1), rgba(0, 0, 0, 0) 32%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.48), rgba(2, 6, 23, 0.06) 46%, rgba(2, 6, 23, 0.48)),
    linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.46));
}

.login-ascii-canvas {
  position: absolute;
  inset: 56px 0 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: calc(100% - 56px);
  pointer-events: none;
}

.login-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #202020;
  color: #ffffff;
  padding: 0 28px;
  border-bottom: 1px solid #3b3b3b;
}

.login-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  color: #74f4ff;
  font-family: "Courier New", Consolas, monospace;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.login-marquee::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0) 4px,
      rgba(255, 255, 255, 0.09) 5px
    ),
    linear-gradient(90deg, #202020 0%, rgba(32, 32, 32, 0) 9%, rgba(32, 32, 32, 0) 91%, #202020 100%);
}

.login-marquee-track {
  display: inline-block;
  min-width: max-content;
  padding-left: 100%;
  animation: login-marquee-scroll 17s linear infinite;
}

.login-marquee-track span {
  display: inline-block;
  text-shadow:
    0 0 4px rgba(116, 244, 255, 0.95),
    0 0 14px rgba(25, 187, 255, 0.72),
    0 0 26px rgba(25, 187, 255, 0.38);
}

@keyframes login-marquee-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

.site-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.site-logo img {
  display: block;
  width: auto;
  height: 44px;
  object-fit: contain;
}

.login-layout {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
  padding: 16px 18px;
}

.login-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 430px);
  padding: 22px 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
}

.brand {
  display: grid;
  gap: 5px;
  justify-items: center;
  text-align: center;
}

.login-brand-logo {
  display: block;
  width: min(190px, 52vw);
  height: auto;
  margin-bottom: 2px;
}

.login-eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  max-width: 360px;
  font-size: 28px;
  line-height: 1.1;
}

.demo-accounts {
  display: grid;
  gap: 8px;
  padding-top: 0;
}

.demo-accounts-head {
  display: grid;
  gap: 2px;
}

.demo-accounts-head strong {
  font-size: 14px;
}

.demo-accounts-head span {
  color: var(--muted);
  font-size: 13px;
}

.demo-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-access-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.demo-account-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.demo-account-button {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.demo-account-button:hover {
  border-color: var(--primary);
  background: #eef5ff;
}

.demo-account-button span {
  font-weight: 700;
}

.demo-account-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label,
.demo-access-form label {
  gap: 4px;
  font-size: 13px;
}

.login-form input,
.demo-access-form input {
  padding: 8px 10px;
}

.login-form button[type="submit"] {
  min-height: 36px;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title img {
  display: block;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: radial-gradient(circle, #ffffff 0%, #f2fbff 64%, rgba(129, 220, 255, 0.95) 100%);
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 0 0 1px rgba(23, 138, 88, 0.18), 0 8px 18px rgba(15, 23, 42, 0.22);
}

.topbar-title h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 69px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 18px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-button {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nav-button.active {
  background: #e8f8ec;
  color: #176229;
}

.content {
  min-width: 0;
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.item {
  padding: 14px;
}

.panel h3,
.item h3 {
  margin: 0 0 10px;
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-card {
  padding: 0;
}

.universal-group-card {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.group-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  color: var(--text);
  list-style: none;
}

.group-summary::-webkit-details-marker {
  display: none;
}

.group-summary::before {
  content: "▶";
  color: var(--muted);
  font-size: 12px;
}

.group-card[open] .group-summary::before {
  content: "▼";
}

.group-summary h3 {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-summary .pill,
.group-summary > span {
  flex: 0 0 auto;
}

.group-card-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.universal-group-note {
  display: grid;
  gap: 4px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 12px 14px;
  line-height: 1.35;
}

.universal-group-note strong {
  color: #0f172a;
}

.extra-group-tools {
  display: grid;
  grid-template-columns: auto minmax(170px, auto) minmax(280px, 1fr);
  gap: 10px;
  align-items: end;
}

.deleteGroupForm {
  display: grid;
  gap: 7px;
  align-items: end;
}

.danger-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9f1239;
  font-size: 12px;
  line-height: 1.2;
}

.danger-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
}

.group-student-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.credentials-list {
  display: grid;
  gap: 0;
}

.credential-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.2fr)
    minmax(130px, 0.7fr)
    minmax(140px, 0.75fr)
    minmax(120px, 0.65fr)
    minmax(170px, 0.9fr)
    minmax(150px, max-content);
  gap: 6px 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  line-height: 1.25;
}

.credential-row > * {
  min-width: 0;
}

.credential-row span {
  overflow-wrap: anywhere;
}

.credential-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.student-action-form {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.student-action-form select {
  width: auto;
  min-width: 150px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 6px;
}

.credential-row button {
  min-height: 26px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
}

.credential-row > .student-edit-details {
  display: grid;
  grid-column: 1 / -1;
  justify-items: end;
  width: 100%;
}

.student-edit-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  background: #e7edf5;
  color: var(--text);
  padding: 0 8px;
  list-style: none;
  font-size: 11px;
}

.student-edit-details > summary::-webkit-details-marker {
  display: none;
}

.credential-row > .student-edit-details[open] {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.credential-row > .student-edit-details[open] > summary {
  justify-self: start;
}

.credential-row .editStudentForm {
  width: 100%;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-full {
  grid-column: 1 / -1;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 3px 9px;
  font-size: 13px;
}

.pill.ok {
  background: #def7e9;
  color: var(--green);
}

.pill.warn {
  background: #fff3d7;
  color: var(--amber);
}

.pill.bad {
  background: #ffe4e2;
  color: var(--red);
}

.pill.info {
  background: #ebe8ff;
  color: var(--violet);
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #e8efff;
  color: var(--primary-dark);
}

.flash.error {
  background: #ffe4e2;
  color: var(--red);
}

.student-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-button {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.task-button.active {
  border-color: var(--green);
  background: #e8f8ec;
}

.task-button strong,
.task-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepik-student-shell {
  min-height: 100vh;
  background: #f0f1f4;
  color: #111827;
}

.stepik-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid #3a3a3a;
  background: #232323;
  color: #ffffff;
}

.stepik-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 25px;
  line-height: 1;
  min-width: 0;
  text-decoration: none;
}

.stepik-brand img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: radial-gradient(circle, #ffffff 0%, #f2fbff 64%, rgba(129, 220, 255, 0.95) 100%);
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 0 0 1px rgba(101, 211, 110, 0.24), 0 0 16px rgba(101, 211, 255, 0.34);
}

.stepik-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-height: 26px;
  border-radius: 999px;
  background: #ffffff;
  color: #232323;
  font-size: 16px;
  font-weight: 700;
}

.stepik-topbar-spacer {
  min-width: 0;
}

.stepik-progress-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 28px;
  scrollbar-width: none;
}

.stepik-progress-strip::-webkit-scrollbar {
  display: none;
}

.stepik-user {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 18px;
  color: #d1d5db;
  white-space: nowrap;
}

.stepik-user button {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 12px;
}

.stepik-user .robot-open-button {
  border-color: #91d6a0;
  background: #e8f8ec;
  color: #176229;
  font-weight: 700;
}

.stepik-user .robot-open-button:hover {
  background: #d8f3df;
}

.teacher-mode-tabs {
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #65d36e #232323;
}

.teacher-mode-tabs::-webkit-scrollbar {
  display: block;
  height: 6px;
}

.teacher-mode-tabs::-webkit-scrollbar-track {
  background: #232323;
}

.teacher-mode-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #65d36e;
}

.teacher-mode-button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: #3b3b3b;
  color: #e5e7eb;
  padding: 0 12px;
}

.teacher-mode-button.active,
.teacher-mode-button:hover {
  background: #65d36e;
  color: #123117;
}

.stepik-student-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 39px);
}

.teacher-course-shell .stepik-student-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.teacher-course-shell .stepik-student-layout.teacher-preview-main-layout {
  grid-template-columns: minmax(0, 1fr);
}

.teacher-course-shell .stepik-topbar {
  grid-template-columns: 320px minmax(0, 1fr) auto;
}

.stepik-course-sidebar {
  position: sticky;
  top: 39px;
  align-self: start;
  height: calc(100vh - 39px);
  min-width: 0;
  background: #242424;
  color: #ffffff;
  overflow-y: auto;
}

.stepik-course-summary {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  row-gap: 8px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid #3b3b3b;
}

.stepik-sidebar-logo {
  display: inline-grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: radial-gradient(circle, #ffffff 0%, #f2fbff 64%, rgba(129, 220, 255, 0.95) 100%);
  box-shadow: 0 0 0 1px rgba(101, 211, 110, 0.28), 0 0 22px rgba(101, 211, 255, 0.38);
  text-decoration: none;
}

.stepik-sidebar-logo img {
  display: block;
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.student-course-summary {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 14px 14px 16px;
}

.student-course-summary .stepik-course-summary-text {
  justify-items: center;
  text-align: center;
  width: 100%;
}

.student-course-summary .stepik-sidebar-logo {
  width: 94px;
  height: 94px;
}

.student-course-summary .stepik-sidebar-logo img {
  width: 80px;
  height: 80px;
}

.student-course-summary .stepik-course-progress {
  grid-column: 1;
  width: 100%;
}

.stepik-course-summary-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stepik-course-summary h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.stepik-course-summary p,
.stepik-course-summary span {
  margin: 0;
  color: #e5e7eb;
  font-size: 12px;
}

.stepik-course-progress {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: #8b8b8b;
  overflow: hidden;
}

.stepik-course-progress span {
  display: block;
  height: 100%;
  background: #65d36e;
}

.teacher-topic-form {
  display: grid;
  gap: 8px;
  padding: 12px 10px;
  border-bottom: 1px solid #3b3b3b;
}

.teacher-topic-form input {
  min-height: 32px;
  border: 1px solid #585858;
  border-radius: 4px;
  background: #ffffff;
  padding: 0 8px;
}

.teacher-topic-form button {
  min-height: 32px;
  border-radius: 4px;
  background: #65d36e;
  color: #123117;
  padding: 0 8px;
}

.stepik-topic-nav {
  display: grid;
  gap: 6px;
  padding: 12px 8px 28px;
}

.stepik-topic-section {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.teacher-topic-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-height: 42px;
}

.teacher-subtopic-list,
.student-subtopic-list {
  display: grid;
  gap: 1px;
}

.teacher-subtopic-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding-left: 16px;
}

.teacher-direct-topic-row {
  grid-template-columns: minmax(0, 1fr);
}

.teacher-drag-handle {
  display: inline-grid;
  place-items: center;
  align-self: stretch;
  min-height: 30px;
  border-radius: 4px;
  color: #8da19a;
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
}

.teacher-topic-row:hover .teacher-drag-handle,
.teacher-subtopic-row:hover .teacher-drag-handle {
  color: #d7f0d5;
  background: rgba(255, 255, 255, 0.08);
}

.course-native-dragging {
  opacity: 0.48;
}

.course-native-dragging .teacher-drag-handle {
  cursor: grabbing;
}

.course-native-over-before,
.course-native-over-after {
  position: relative;
}

.course-native-over-before::before,
.course-native-over-after::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  border-radius: 999px;
  background: #65d36e;
  box-shadow: 0 0 0 2px rgba(101, 211, 110, 0.2);
}

.course-native-over-before::before {
  top: -2px;
}

.course-native-over-after::after {
  bottom: -2px;
}

.teacher-subtopic-link,
.student-subtopic-link {
  min-height: 32px;
  padding-left: 18px;
  color: #e8f5e6;
}

.teacher-topic-heading,
.student-topic-heading {
  display: block;
  padding: 11px 10px 6px;
  color: #ffffff;
  line-height: 1.25;
}

.topic-collapse-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.topic-collapse-toggle:hover,
.topic-collapse-toggle.active {
  background: rgba(255, 255, 255, 0.08);
}

.student-topic-heading.complete,
.topic-collapse-toggle.complete {
  background: rgba(101, 211, 110, 0.18);
}

.topic-collapse-toggle.complete.active,
.topic-collapse-toggle.complete:hover {
  background: rgba(101, 211, 110, 0.28);
}

.topic-collapse-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  border-radius: 4px;
}

.topic-collapse-icon {
  color: #d7f0d5;
  font-size: 15px;
  line-height: 17px;
  text-align: center;
}

.teacher-topic-heading em,
.student-topic-heading em {
  display: block;
  margin-top: 2px;
  color: #d7f0d5;
  font-size: 12px;
  font-style: normal;
}

.teacher-topic-heading strong,
.student-topic-heading strong {
  display: block;
  overflow: hidden;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-subtopic-link strong,
.student-subtopic-link strong {
  font-size: 12px;
  font-weight: 650;
}

.student-subtopic-link {
  padding-left: 30px;
}

.teacher-subtopic-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  gap: 4px;
  padding: 6px 0 4px 18px;
}

.teacher-subtopic-form input,
.teacher-subtopic-edit-form input {
  min-height: 30px;
  border: 1px solid #52616f;
  border-radius: 4px;
  background: #ffffff;
  color: #111827;
  padding: 0 8px;
  font-size: 12px;
}

.teacher-subtopic-form button {
  min-height: 30px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #0f172a;
  padding: 0;
}

.teacher-subtopic-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  padding: 4px 0 4px 18px;
}

.teacher-topic-row .stepik-topic-link.active::after,
.teacher-subtopic-row .stepik-topic-link.active::after {
  display: none;
}

.teacher-topic-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 24px;
  gap: 2px;
  opacity: 0.72;
  transition: opacity 0.15s ease;
}

.teacher-subtopic-actions {
  grid-auto-columns: 22px;
  opacity: 0.58;
}

.teacher-topic-row:hover .teacher-topic-actions,
.teacher-topic-row:focus-within .teacher-topic-actions,
.teacher-subtopic-row:hover .teacher-topic-actions,
.teacher-subtopic-row:focus-within .teacher-topic-actions {
  opacity: 1;
}

.teacher-topic-move,
.teacher-topic-add,
.teacher-topic-edit,
.teacher-topic-delete {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-height: 28px;
  border-radius: 4px;
  background: transparent;
  color: #cbd5e1;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.teacher-subtopic-actions .teacher-topic-move,
.teacher-subtopic-actions .teacher-topic-edit,
.teacher-subtopic-actions .teacher-topic-delete {
  width: 22px;
  min-height: 26px;
  font-size: 13px;
}

.teacher-topic-add {
  background: rgba(101, 211, 110, 0.18);
  color: #bbf7d0;
}

.teacher-topic-add:hover {
  background: #65d36e;
  color: #123117;
}

.teacher-topic-move:hover:not(:disabled) {
  background: #374151;
  color: #ffffff;
}

.teacher-topic-move:disabled {
  color: #5f6b7a;
  cursor: not-allowed;
  opacity: 0.55;
}

.teacher-topic-edit:hover {
  background: #1f6feb;
  color: #ffffff;
}

.teacher-topic-delete:hover {
  background: #7f1d1d;
  color: #ffffff;
}

.teacher-topic-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 0 6px;
}

.teacher-topic-edit-form input {
  min-height: 36px;
  border: 1px solid #65d36e;
  border-radius: 4px;
  background: #ffffff;
  color: #111827;
  padding: 0 8px;
}

.teacher-topic-edit-actions {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
}

.teacher-topic-edit-actions button {
  min-width: 34px;
  min-height: 36px;
  border-radius: 4px;
  padding: 0 8px;
}

.stepik-topic-section h3 {
  margin: 12px 8px 5px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.35;
}

.stepik-topic-link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 38px;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  padding: 7px 16px 7px 10px;
  text-align: left;
  white-space: normal;
}

.teacher-topic-row .stepik-topic-link,
.teacher-subtopic-row .stepik-topic-link {
  border-radius: 4px;
  padding-right: 8px;
}

.stepik-topic-link:hover,
.stepik-topic-link.active {
  background: #4c8d48;
}

.stepik-course-sidebar .stepik-topic-link.active,
.stepik-course-sidebar .student-topic-heading.active {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #4c8d48;
  box-shadow: inset 4px 0 0 #86efac;
}

.stepik-topic-link.complete {
  background: rgba(101, 211, 110, 0.18);
}

.stepik-topic-link.complete:hover,
.stepik-topic-link.complete.active {
  background: #4c8d48;
}

.stepik-topic-link.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #ffffff;
  transform: translateY(-50%);
}

.stepik-topic-link span,
.stepik-topic-link strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepik-topic-link span {
  color: #d7f0d5;
  font-size: 12px;
}

.stepik-topic-link strong {
  font-size: 13px;
  font-weight: 700;
}

.stepik-content {
  min-width: 0;
  background: #f0f1f4;
}

.stepik-content .flash {
  margin: 14px 28px 0;
}

.stepik-empty {
  margin: 28px;
  color: var(--muted);
}

.stepik-lesson {
  min-height: calc(100vh - 39px);
}

.stepik-lesson-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  border-bottom: 1px solid #d7dbe2;
  background: #ffffff;
  padding: 7px clamp(14px, 3vw, 28px);
}

.stepik-lesson-header h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.stepik-lesson-header p {
  margin: 2px 0 0;
  color: #6b7280;
  font-size: 12px;
}

.stepik-lesson-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #8a94a6;
  font-size: 12px;
}

.topic-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topic-section-heading > div {
  min-width: 0;
}

.topic-section-heading h2 {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-section-heading p {
  margin: 4px 0 0;
  overflow: hidden;
  color: #64748b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-assignment-form {
  display: grid;
  grid-template-columns: minmax(110px, 150px) max-content;
  align-items: end;
  gap: 8px 10px;
  justify-content: end;
  min-width: min(310px, 100%);
}

.topic-assignment-form .assignment-recipient-picker,
.topic-assignment-form .assignment-recipient-list {
  width: 100%;
  max-width: 150px;
}

.topic-assignment-form .topic-assignment-recipient-list {
  max-height: 42px;
  min-height: 42px;
}

.topic-assignment-form > button {
  min-height: 40px;
  white-space: nowrap;
}

.topic-assignment-form .assigned-groups-note {
  grid-column: 1 / -1;
  max-width: 310px;
}

.topic-intro-editor-panel,
.topic-intro-display,
.topic-tasks-section {
  margin: 10px clamp(12px, 2vw, 16px) 0;
}

.topic-intro-editor-panel,
.topic-intro-display {
  border: 1px solid #d7dde7;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.topic-intro-editor-panel > .topic-section-heading,
.topic-intro-display {
  padding: 18px 22px;
}

.topic-intro-editor-panel .topicIntroForm {
  padding: 0 22px 22px;
}

.topic-level-intro {
  display: grid;
  gap: 14px;
}

.topic-level-intro .task-infographic {
  width: 50%;
  max-width: 560px;
  margin-inline: auto;
}

.topic-level-intro .text-block {
  max-width: none;
}

.topic-intro-display .lesson-step-title {
  margin-bottom: 10px;
}

.topic-intro-display h5 {
  margin: 0;
  font-size: 15px;
}

.student-topic-content {
  display: grid;
  align-items: stretch;
  gap: 10px;
  padding: 8px 0 24px;
}

.teacher-topic-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 18px;
  align-items: start;
  padding: 16px 0 36px;
}

.teacher-topic-detail {
  min-width: 0;
}

.teacher-task-list-panel {
  position: sticky;
  top: 60px;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  max-height: calc(100vh - 84px);
  overflow: auto;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.teacher-task-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #111827;
  font-size: 14px;
}

.teacher-task-list {
  display: grid;
  gap: 8px;
}

.teacher-course-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
}

.teacher-course-item-row .teacher-task-list-item {
  min-width: 0;
}

.teacher-course-item-order {
  display: grid;
  gap: 4px;
}

.teacher-course-item-order .teacher-topic-move {
  border: 1px solid #d7dbe2;
  background: #ffffff;
  color: #334155;
  opacity: 1;
}

.teacher-course-item-order .teacher-topic-move:hover:not(:disabled) {
  background: #eaf7ea;
  color: #1f5b28;
}

.teacher-course-item-order .teacher-topic-move:disabled {
  color: #cbd5e1;
  opacity: 0.75;
}

.teacher-task-list-group {
  margin-bottom: 4px;
}

.teacher-task-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #d7dbe2;
  border-radius: 6px;
  background: #f8fafc;
  color: #111827;
  padding: 9px 10px;
  text-align: left;
}

.teacher-task-list-item:hover,
.teacher-task-list-item.active {
  border-color: #4c8d48;
  background: #eaf7ea;
}

.teacher-task-list-item.create {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 32px;
  background: #4caf50;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.15;
  padding: 5px 10px;
}

.teacher-task-list-item.intro-create {
  background: #2563eb;
}

.teacher-task-list-item.create.active,
.teacher-task-list-item.create:hover {
  background: #459c49;
}

.teacher-task-list-item.intro-create.active,
.teacher-task-list-item.intro-create:hover {
  background: #1d4ed8;
}

.teacher-task-list-item.intro-item {
  border-color: #b7dfc1;
  background: #f4fbf6;
}

.teacher-task-list-item.intro-item:hover,
.teacher-task-list-item.intro-item.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.teacher-task-list-item span {
  min-width: 0;
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-task-list-item.create span {
  color: inherit;
}

.teacher-task-list-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 981px) {
  .teacher-course-shell {
    height: 100vh;
    overflow: hidden;
  }

  .teacher-course-shell .stepik-student-layout {
    height: calc(100vh - 39px);
    min-height: 0;
    overflow: hidden;
  }

  .teacher-course-shell .stepik-content {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .teacher-course-shell .stepik-content.teacher-topic-content {
    overflow: hidden;
  }

  .teacher-course-shell .teacher-topic-workspace {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .teacher-course-shell .topic-tasks-section {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    margin-top: 12px;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 16px;
  }

  .teacher-course-shell .topic-section-heading h2 {
    font-size: 17px;
  }

  .teacher-course-shell .topic-section-heading p {
    margin-top: 2px;
    font-size: 12px;
  }

  .teacher-course-shell .teacher-topic-board {
    align-items: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
  }

  .teacher-course-shell .teacher-topic-detail {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-bottom: 20px;
  }

  .teacher-course-shell .teacher-task-list-panel {
    position: static;
    align-self: stretch;
    height: 100%;
    max-height: none;
    min-height: 0;
    overscroll-behavior: contain;
  }
}

.student-topic-task {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.topic-intro-card {
  border-color: #98d9a4;
  box-shadow: 0 0 0 1px rgba(101, 211, 110, 0.22);
}

.topic-intro-card .intro-card-head {
  background: #f0fbf2;
}

.topic-intro-card-body {
  padding: 14px clamp(18px, 4vw, 36px) 16px;
}

.topic-intro-card-body .text-block {
  max-width: none;
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.topic-intro-card-body .task-infographic {
  margin-bottom: 14px;
}

.student-topic-empty {
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  color: #6b7280;
}

.teacher-create-task {
  display: grid;
}

.teacher-create-summary {
  cursor: pointer;
  border-bottom: 1px solid #d7dbe2;
  background: #eef3f8;
  color: #111827;
  padding: 14px clamp(18px, 4vw, 36px);
  font-weight: 700;
  list-style: none;
}

.teacher-create-summary::-webkit-details-marker {
  display: none;
}

.teacher-inline-form {
  padding: 16px clamp(18px, 4vw, 36px);
}

.small-code-editor {
  min-height: 150px;
}

.python-code-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  background: #ffffff;
}

.python-code-wrap:focus-within {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.python-highlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  background: #ffffff;
  color: #000000;
  padding: 10px 12px;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.5;
  tab-size: 4;
}

.python-highlight code {
  display: block;
  min-height: 100%;
  font: inherit;
}

.python-code-wrap .code-editor {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: #000000;
  -webkit-text-fill-color: transparent;
}

.python-code-wrap .code-editor::selection {
  background: rgba(37, 99, 235, 0.22);
}

.python-code-wrap .code-editor[readonly] {
  caret-color: transparent;
}

.py-keyword {
  color: #ff7700;
  font-weight: 700;
}

.py-builtin {
  color: #900090;
}

.py-string {
  color: #00aa00;
}

.py-comment {
  color: #dd0000;
}

.py-number {
  color: #0000ff;
}

.py-definition {
  color: #0000cc;
  font-weight: 700;
}

.py-decorator {
  color: #805000;
}

.kmr-keyword {
  color: #0b56c5;
  font-weight: 700;
}

.kmr-command {
  color: #7c2d12;
  font-weight: 700;
}

.kmr-condition {
  color: #047857;
  font-weight: 600;
}

.kmr-comment {
  color: #64748b;
  font-style: italic;
}

.kmr-number {
  color: #1d4ed8;
}

.teacher-task-tools {
  display: grid;
  gap: 8px;
  border-top: 1px solid #d7dbe2;
  background: #f7f9fc;
  padding: 10px clamp(12px, 3vw, 24px);
}

.teacher-planning-link-panel {
  display: grid;
  gap: 8px;
  border: 1px solid #cfe1f8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.teacher-planning-link-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.teacher-planning-link-head strong {
  color: #0f172a;
}

.teacher-planning-link-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.planning-material-link-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(260px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
}

.planning-material-link-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #334155;
  font-size: 13px;
}

.planning-material-link-form select {
  min-width: 0;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 7px 9px;
}

.planning-material-link-form button {
  min-height: 36px;
}

.planning-material-link-form .small {
  align-self: center;
}

.teacher-edit-panel {
  display: grid;
  gap: 14px;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.compact-task-editor {
  gap: 8px;
  padding: 10px 12px;
}

.teacher-edit-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e9f0;
  padding-bottom: 12px;
}

.compact-task-editor .teacher-edit-panel-head {
  align-items: center;
  padding-bottom: 8px;
}

.teacher-edit-panel-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.teacher-edit-panel-head p {
  margin: 4px 0 0;
  color: #617083;
  font-size: 13px;
}

.compact-task-edit-form {
  gap: 8px 12px;
}

.compact-task-edit-form.form-grid.two {
  grid-template-columns: minmax(220px, 1.15fr) minmax(170px, 0.85fr) minmax(190px, 1fr);
}

.compact-task-edit-form label {
  gap: 4px;
  font-size: 13px;
}

.compact-task-edit-form input,
.compact-task-edit-form select {
  min-height: 36px;
  padding: 7px 10px;
}

.compact-task-edit-form .task-type-hint.span-full {
  grid-column: auto;
  align-self: end;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  font-size: 12px;
}

.teacher-preview-details {
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.teacher-preview-details[open] {
  display: grid;
  gap: 12px;
}

.teacher-preview-details .stepik-lesson-body {
  padding: 0;
}

.teacher-student-preview {
  border-top: 1px solid #d7dbe2;
}

.teacher-preview-control-panel {
  width: min(100%, 1000px);
  margin-bottom: 10px;
  padding: 8px 10px;
}

.teacher-preview-section-head {
  margin-bottom: 10px;
}

.teacher-preview-section-head > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.teacher-preview-section-head h2 {
  font-size: 22px;
}

.teacher-preview-section-head p {
  margin: 0;
}

#teacherPreviewForm {
  grid-template-columns: minmax(280px, 1fr) minmax(112px, 140px) max-content;
  align-items: center;
  gap: 10px;
}

.teacher-preview-group-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

#teacherPreviewForm select,
#teacherPreviewForm button {
  min-height: 38px;
}

#teacherPreviewForm select {
  padding: 8px 10px;
}

.teacher-preview-inline-summary {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.teacher-real-preview {
  display: grid;
  gap: 16px;
}

.teacher-real-preview-layout {
  min-height: 720px;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #f0f1f4;
  grid-template-columns: 230px minmax(0, 1fr) !important;
  height: auto !important;
  overflow: visible !important;
}

.teacher-real-preview-layout .stepik-course-sidebar {
  top: 52px;
  height: calc(100vh - 80px);
}

.teacher-real-preview-content {
  min-height: 0;
  overflow: visible !important;
}

.teacher-student-preview .student-topic-task {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.teacher-preview-readonly-note {
  background: #eef6ff;
  border: 1px solid #c9ddf5;
  border-radius: 8px;
  color: #25527d;
  font-size: 14px;
  margin: 14px 18px 18px;
  padding: 10px 12px;
}

.teacher-preview-code {
  background: #0f172a;
  border-radius: 8px;
  color: #e5edf7;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.teacher-task-tools .task-edit-details > summary {
  min-height: 36px;
}

.assigned-groups-note {
  color: #617083;
  font-size: 13px;
}

.assignment-recipient-form {
  align-items: start;
}

.assignment-recipient-picker {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 0;
  width: min(360px, 100%);
}

.assignment-recipient-picker legend {
  color: #41506a;
  font-size: 13px;
  margin: 0 0 2px;
}

.assignment-recipient-selected {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-recipient-chip {
  background: #6f7e8a;
  border: 0;
  border-radius: 8px;
  color: #17212b;
  font-size: 14px;
  font-weight: 700;
  min-height: 39px;
  padding: 0 14px;
}

.assignment-recipient-chip:hover,
.assignment-recipient-chip:focus-visible {
  background: #5f6e7a;
  color: #ffffff;
}

.assignment-recipient-search {
  display: flex;
  max-width: 240px;
}

.assignment-recipient-search input {
  background: #ffffff;
  border: 1px solid #d5dde7;
  border-radius: 6px;
  color: #243447;
  min-height: 40px;
  width: 100%;
}

.assignment-recipient-list {
  background: #ffffff;
  border: 1px solid #d5dde7;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  max-height: 180px;
  max-width: 240px;
  overflow: auto;
  padding: 6px;
  width: 100%;
}

.assignment-recipient-list-option {
  min-width: 0;
}

.assignment-recipient-option-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #243447;
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
  white-space: normal;
  width: 100%;
}

.assignment-recipient-option-button:hover,
.assignment-recipient-option-button:focus-visible {
  background: #eef3f8;
}

.assignment-recipient-list-option.selected .assignment-recipient-option-button {
  background: #dfe7ee;
  font-weight: 700;
}

.assignment-recipient-option-button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.assignment-recipient-option-button em {
  color: #7a8797;
  font-size: 12px;
  font-style: normal;
  margin-left: auto;
}

.assignment-recipient-list-option.disabled .assignment-recipient-option-button {
  color: #7a8797;
  cursor: default;
}

.assignment-recipient-list-option.disabled .assignment-recipient-option-button:hover {
  background: transparent;
}

.assignment-recipient-empty {
  color: #7a8797;
  font-size: 13px;
  padding: 8px 9px;
}

.teacher-unified-panel {
  padding: 24px clamp(18px, 4vw, 42px);
}

.student-topic-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d7dbe2;
  padding: 8px clamp(12px, 2vw, 20px);
}

.student-topic-task-head > div {
  min-width: 0;
}

.student-topic-task-head h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-topic-task-head p {
  margin: 4px 0 0;
  overflow: hidden;
  color: #6b7280;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-attempt-rules {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid #d7dbe2;
  background: #f4fbf6;
  padding: 5px clamp(12px, 2vw, 20px);
  color: #285530;
  font-size: 12px;
}

.task-attempt-rules span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(101, 211, 110, 0.4);
  border-radius: 4px;
  background: #ffffff;
  padding: 2px 7px;
}

.task-attempt-rules.locked {
  background: #fff8e6;
  color: #6f4a00;
}

.task-attempt-rules.locked span {
  border-color: rgba(183, 121, 31, 0.35);
}

.student-lesson-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  padding: 0;
}

.student-lesson-pages {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: thin;
}

.student-lesson-pages button {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  border: 1px solid rgba(31, 41, 55, 0.35);
  border-radius: 4px;
  background: #4a4a4a;
  color: #e5e7eb;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 700;
}

.student-lesson-pages button.done {
  border-color: #65d36e;
  background: #65d36e;
  color: #123117;
}

.student-lesson-pages button.intro {
  border-color: rgba(31, 41, 55, 0.35);
  background: #4a4a4a;
  color: #e5e7eb;
  font-family: Georgia, serif;
  font-style: italic;
}

.student-lesson-pages button.intro.viewed {
  border-color: #65d36e;
  background: #65d36e;
  color: #123117;
}

.student-lesson-pages button.active {
  border-color: #176229;
  background: #e8f8ec;
  color: #123117;
  box-shadow: 0 0 0 2px rgba(23, 98, 41, 0.35);
}

.student-lesson-pages button.done.active,
.student-lesson-pages button.intro.viewed.active {
  border-color: #176229;
  background: #65d36e;
  color: #123117;
}

.student-lesson-pages .student-lesson-next {
  min-width: 58px;
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
}

.student-lesson-pages .student-lesson-next:hover:not(:disabled) {
  background: #126c46;
}

.stepik-lesson-body {
  border-bottom: 1px solid #d7dbe2;
  background: #ffffff;
  padding: 9px clamp(12px, 2vw, 20px) 10px;
}

.stepik-lesson-body .lesson-flow {
  max-width: 900px;
  margin: 0 auto;
}

.stepik-lesson-body .lesson-step {
  border: 0;
  background: transparent;
  padding: 0 0 6px;
}

.stepik-lesson-body .lesson-step:last-child {
  padding-bottom: 0;
}

.stepik-lesson-body .lesson-step.theory-step,
.stepik-lesson-body .lesson-step.check-step {
  background: transparent;
}

.stepik-lesson-body .lesson-step-marker span {
  background: #1f2937;
}

.stepik-lesson-body .lesson-step-title h5 {
  font-size: 14px;
}

.stepik-lesson-body .text-block {
  font-size: 13px;
  line-height: 1.4;
}

.stepik-lesson-body .lesson-flow.plain {
  gap: 5px;
  max-width: none;
}

.stepik-lesson-body .lesson-flow.plain .lesson-step {
  display: block;
  padding: 0;
}

.stepik-lesson-body .lesson-flow.plain .lesson-step + .lesson-step {
  padding-top: 5px;
  border-top: 1px solid #eef1f5;
}

.stepik-lesson-body .lesson-flow.plain .lesson-step-marker {
  display: none;
}

.stepik-lesson-body .lesson-flow.plain .lesson-step-title h5 {
  margin: 0 0 3px;
  font-size: 13px;
}

.stepik-lesson-body .lesson-flow.plain .text-block p {
  margin: 0 0 4px;
}

.stepik-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 36px);
}

.turtle-student-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.44fr) minmax(460px, 1fr);
  gap: 8px;
  border-top: 1px solid #d7dbe2;
  background: #eeeeee;
  padding: 8px;
}

.turtle-student-board,
.turtle-student-editor {
  min-width: 0;
  border: 1px solid #cfd4dc;
  background: #ffffff;
}

.turtle-student-board {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto auto;
  align-content: stretch;
}

.turtle-task-head {
  display: grid;
}

.turtle-task-strip {
  min-height: 31px;
  border-bottom: 1px solid #d7d1a6;
  background: #fffbd1;
  color: #1f2937;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1.35;
}

.turtle-task-strip .text-block {
  font-size: inherit;
  line-height: inherit;
}

.turtle-task-strip .text-block p {
  margin: 0;
}

.turtle-sample-panel {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #d7dbe2;
  background: #ffffff;
  padding: 8px;
}

.turtle-sample-panel > strong {
  color: #166534;
  font-size: 13px;
}

.turtle-sample-panel .task-images {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  margin: 0;
}

.turtle-sample-panel .task-images figure {
  border-radius: 4px;
}

.turtle-sample-panel .task-images img {
  max-height: 180px;
}

.turtle-student-board .turtle-wrap {
  min-height: 360px;
  padding: 0;
}

.turtle-student-board .turtle-toolbar {
  display: none;
}

.turtle-student-board .turtle-canvas {
  min-height: 360px;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.turtle-command-empty {
  margin: 0;
  border-top: 1px solid #d7dbe2;
  background: #f8fafc;
  padding: 6px 12px;
  color: #64748b;
  font-size: 12px;
}

.turtle-command-log {
  display: grid;
  gap: 3px;
  max-height: 104px;
  overflow: auto;
  margin: 0;
  border-top: 1px solid #d7dbe2;
  background: #f8fafc;
  padding: 7px 12px 8px 34px;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.25;
}

.turtle-command-log li {
  border-radius: 4px;
  padding: 2px 5px;
}

.turtle-command-log li.active {
  background: #dcfce7;
  color: #14532d;
  font-weight: 800;
}

.turtle-run-button {
  min-width: 110px;
  background: #087fda;
  color: #ffffff;
  font-weight: 700;
}

.turtle-submit-button {
  margin: 0;
}

.turtle-student-editor {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
}

.turtle-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border-bottom: 1px solid #d7dbe2;
  background: #f4f6f8;
  padding: 4px 8px;
}

.turtle-editor-bar > span {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turtle-editor-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.turtle-editor-actions button {
  min-height: 32px;
  border-radius: 2px;
  padding: 0 9px;
}

.turtle-editor-grid {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 420px;
  background: #ffffff;
}

.turtle-editor-grid .python-code-wrap {
  min-width: 0;
  min-height: 100%;
}

.turtle-editor-grid .turtle-code-editor,
.turtle-editor-grid .python-highlight {
  min-height: 100%;
  border: 0;
  padding: 8px 12px;
  font-size: 20px;
  line-height: 1.35;
}

.turtle-line-numbers {
  border-right: 1px solid #d8dde6;
  background: #f0f0f0;
  color: #1f2937;
  padding: 8px 10px;
  font-size: 18px;
  line-height: 1.35;
}

.turtle-status-line {
  border-top: 1px solid #d7dbe2;
  background: #ffffff;
  padding: 6px 8px;
}

.stepik-code-panel {
  display: grid;
  gap: 0;
  border: 1px solid #b8c4d5;
  background: #ffffff;
  overflow: hidden;
}

.stepik-code-panel .code-editor {
  min-height: 360px;
}

.stepik-code-panel .terminal {
  min-height: 210px;
}

.judge-workbench {
  display: grid;
  gap: 12px;
  border-top: 1px solid #d7dbe2;
  background: #f6edf4;
  padding: 16px clamp(18px, 4vw, 36px);
}

.judge-prompt h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.judge-feedback {
  display: grid;
  gap: 8px;
}

.judge-status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}

.judge-status-line.ok {
  color: #047857;
}

.judge-status-line.info {
  color: #2563eb;
}

.judge-status-line.bad {
  color: #991b1b;
}

.judge-status-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: currentColor;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.judge-console {
  min-height: 190px;
  max-height: 420px;
  overflow: auto;
  border-radius: 4px;
  background: #2f2f2f;
  color: #ffffff;
  padding: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.judge-resource-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.judge-resource-bar p {
  margin: 0 0 6px;
  font-size: 14px;
}

.judge-language {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #c8d1df;
  border-radius: 4px;
  background: #f4f5f7;
  color: #7b8494;
  padding: 0 26px 0 10px;
  font-size: 12px;
}

.judge-editor-wrap {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  border: 1px solid #c8d1df;
  background: #ffffff;
}

.code-line-numbers {
  margin: 0;
  border-right: 1px solid #d8dde6;
  background: #f8fafc;
  color: #8b95a5;
  padding: 8px 7px;
  text-align: right;
  user-select: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.judge-editor-wrap .judge-editor {
  min-height: 112px;
  padding: 8px 10px;
  resize: vertical;
  font-size: 13px;
}

.judge-editor-wrap .python-code-wrap {
  min-width: 0;
}

.judge-editor-wrap .python-highlight {
  padding: 8px 10px;
  font-size: 13px;
}

.judge-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.judge-actions-left {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.judge-actions button {
  min-height: 34px;
  border-radius: 4px;
  padding: 0 20px;
}

.judge-run-button {
  background: #050505;
  color: #ffffff;
}

.judge-run-button:hover {
  background: #1f2937;
}

.judge-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #111827;
  font-size: 13px;
}

.robot-world-block {
  display: grid;
  gap: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 14px;
}

.robot-world-block[hidden] {
  display: none;
}

.robot-builder-head,
.robot-builder-tools,
.robot-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.robot-builder-head h4 {
  margin: 0 0 4px;
}

.robot-builder-size,
.robot-builder-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.robot-builder-size input {
  width: 86px;
}

.robot-canvas {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f7f3e8;
}

.robot-editor-canvas {
  cursor: crosshair;
}

.robot-legend {
  justify-content: flex-start;
  color: #475569;
  font-size: 13px;
}

.robot-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.robot-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #94a3b8;
}

.robot-start {
  background: #2563eb;
}

.robot-initial {
  background: #ffd166;
}

.robot-goal {
  background: #bbf7d0;
  border-color: #16a34a;
}

.robot-finish {
  background: #ffffff;
  border: 3px solid #16a34a;
}

.robot-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
  border-top: 1px solid #d7dbe2;
  background: #eef2f7;
  padding: 16px clamp(18px, 4vw, 36px);
}

.robot-code-editor {
  min-height: 360px;
}

.robot-view-wrap,
.robot-result-box {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.robot-result-panel .runtime-strip {
  flex-wrap: wrap;
}

.robot-log {
  max-height: 220px;
}

.student-check-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.turtle-current-check {
  border-top: 1px solid #d7dbe2;
  background: #f8fafc;
  padding: 8px 10px;
}

.student-check-message {
  width: 100%;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.student-check-message.ok {
  color: var(--green);
}

.student-check-message.bad {
  color: var(--red);
}

.student-check-message.info {
  color: var(--primary);
}

.stepik-lesson-footer {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.5fr) auto;
  gap: 18px;
  align-items: center;
  border-top: 1px solid #d7dbe2;
  background: #f5f6f8;
  padding: 16px clamp(20px, 7vw, 72px) 28px;
}

.stepik-reactions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.stepik-reactions span {
  display: grid;
  justify-items: center;
  color: #111827;
  font-size: 14px;
}

.stepik-reactions small {
  color: #111827;
  font-size: 10px;
}

.stepik-lesson-footer p {
  margin: 0;
  color: #111827;
  font-size: 14px;
}

.stepik-footer-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.stepik-footer-actions button[data-action="next-task"] {
  background: #4caf50;
}

.stepik-footer-actions button[data-action="next-task"]:hover {
  background: #459c49;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
}

.python-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.code-window {
  border-color: #b8c4d5;
  background: #ffffff;
  padding: 0;
  overflow: hidden;
}

.python-editor-panel,
.python-runtime-panel {
  display: grid;
  gap: 0;
}

.code-titlebar,
.ide-actions,
.editor-top-actions,
.runtime-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.code-titlebar {
  min-height: 36px;
  border-bottom: 1px solid #c8d1df;
  background: #eef3f8;
  padding: 6px 10px;
}

.editor-top-actions {
  justify-content: flex-end;
}

.editor-top-actions button {
  min-height: 32px;
  padding: 0 11px;
}

.code-titlebar h3,
.runtime-block h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-actions {
  justify-content: flex-start;
  border-top: 1px solid #c8d1df;
  background: #f7f7f7;
  padding: 10px;
}

.code-editor {
  min-height: 460px;
  border: 0;
  border-radius: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.5;
  tab-size: 4;
  background: #ffffff;
  color: #000000;
}

.code-editor[readonly] {
  cursor: default;
}

.console-input {
  min-height: 76px;
  font-family: Consolas, "Courier New", monospace;
  background: #ffffff;
}

.runtime-block {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.runtime-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hint {
  border-radius: 8px;
  padding: 10px 12px;
  background: #e8efff;
  color: var(--primary-dark);
  line-height: 1.45;
}

.hint.bad {
  background: #ffe4e2;
  color: var(--red);
}

.hint.warn {
  background: #fff3d7;
  color: var(--amber);
}

.terminal-grid {
  display: grid;
  gap: 12px;
}

.terminal,
.output {
  min-height: 260px;
  border: 1px solid #9aa8ba;
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  padding: 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.45;
}

.input-block {
  border-bottom: 1px solid #c8d1df;
  background: #f7f7f7;
}

.terminal.stderr,
.error-terminal {
  min-height: 92px;
  color: #7f1d1d;
  background: #fff7f7;
}

.task-description {
  line-height: 1.55;
  white-space: pre-wrap;
}

.text-block {
  line-height: 1.6;
}

.text-block p,
.text-block ul,
.text-block ol,
.text-block blockquote,
.text-block pre,
.rich-text-editable p,
.rich-text-editable ul,
.rich-text-editable ol,
.rich-text-editable blockquote,
.rich-text-editable pre {
  margin: 0 0 12px;
}

.text-block > :last-child,
.rich-text-editable > :last-child {
  margin-bottom: 0;
}

.text-block ul,
.text-block ol,
.rich-text-editable ul,
.rich-text-editable ol {
  padding-left: 24px;
}

.text-block blockquote,
.rich-text-editable blockquote {
  border-left: 3px solid #9ca3af;
  color: #4b5563;
  padding-left: 12px;
}

.text-block pre,
.rich-text-editable pre {
  overflow: auto;
  border: 1px solid #d7dbe2;
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.text-block img,
.rich-text-editable img {
  display: block;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  margin: 12px auto;
}

.student-topic-task .text-block img {
  max-width: min(100%, 300px);
  max-height: 300px;
}

.task-infographic {
  position: relative;
  width: 50%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #c8d5ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.task-infographic img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #ffffff;
  cursor: zoom-in;
}

.task-infographic-open {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.task-infographic-open:hover,
.task-infographic-open:focus-visible {
  background: rgba(37, 99, 235, 0.92);
}

.task-infographic-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: #030712;
}

.task-infographic-modal:fullscreen {
  width: 100vw;
  height: 100vh;
}

.task-infographic-viewer-open {
  overflow: hidden;
}

.teacher-task-preview-open {
  overflow: hidden;
}

.teacher-task-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.teacher-task-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #eef2f7;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.teacher-task-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 14px 18px;
}

.teacher-task-preview-head h3 {
  margin: 0;
  font-size: 20px;
}

.teacher-task-preview-head p {
  margin: 4px 0 0;
}

.teacher-task-preview-close {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 6px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.teacher-task-preview-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.teacher-task-preview-stack {
  display: grid;
  gap: 14px;
}

.teacher-task-preview-section,
.teacher-task-preview-edit {
  overflow: hidden;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #ffffff;
}

.teacher-task-preview-section h4 {
  margin: 0;
  border-bottom: 1px solid #d7dbe2;
  padding: 11px 14px;
  font-size: 16px;
}

.teacher-task-preview-edit > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
}

.teacher-task-preview-edit > summary::-webkit-details-marker {
  display: none;
}

.teacher-task-preview-edit > summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  color: #15803d;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.teacher-task-preview-edit[open] > summary {
  border-bottom: 1px solid #d7dbe2;
}

.teacher-task-preview-edit[open] > summary::before {
  transform: rotate(90deg);
}

.teacher-task-preview-edit .editTaskForm {
  padding: 14px;
}

.teacher-task-preview-message {
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 10px 12px;
  font-weight: 700;
}

.teacher-task-preview-message.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.teacher-task-preview-message.bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.teacher-task-preview-body .teacher-student-preview {
  max-width: none;
}

.task-infographic-dialog {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: clamp(8px, 1.6vmin, 20px);
}

.task-infographic-dialog img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 0;
  background: #ffffff;
}

.task-infographic-close {
  position: fixed;
  right: 0;
  top: 0;
  z-index: 3;
  width: 96px;
  height: 96px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  box-shadow: none;
  opacity: 0;
  cursor: pointer;
}

.task-infographic-close:hover,
.task-infographic-close:focus-visible {
  background: transparent;
  opacity: 0;
}

.task-infographic-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: -8px;
}

.rich-text-editable img {
  cursor: pointer;
}

.rich-text-editable img.rich-text-image-selected {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.theory-editor {
  min-height: 150px;
}

.task-infographic-editor {
  display: grid;
  gap: 10px;
  border: 1px solid #c8d5ea;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.task-infographic-editor h4 {
  margin: 0 0 4px;
}

.task-infographic-editor-preview {
  position: relative;
  margin: 0;
  overflow: hidden;
  max-width: 520px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
}

.task-infographic-editor-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  cursor: zoom-in;
}

.task-infographic-upload {
  max-width: 520px;
}

.lesson-flow {
  display: grid;
  gap: 12px;
}

.lesson-flow.compact {
  gap: 10px;
}

.lesson-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.lesson-step.theory-step {
  border-color: #bdd7c8;
  background: #f5fbf7;
}

.lesson-step.infographic-step {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.lesson-step.practice-step {
  border-color: #c8d5ea;
}

.lesson-step.check-step {
  border-color: #e6d2a5;
  background: #fffaf0;
}

.lesson-step-marker {
  display: grid;
  justify-items: center;
}

.lesson-step-marker span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.lesson-step-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.lesson-step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-step-title h5 {
  margin: 0;
  font-size: 15px;
}

.review-context {
  margin: 12px 0;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.review-sidebar {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  position: sticky;
  top: 86px;
}

.review-nav-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.review-nav-summary {
  align-items: center;
  background: #f6f8fb;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.review-nav-summary::-webkit-details-marker,
.review-nav-student summary::-webkit-details-marker {
  display: none;
}

.review-nav-summary::before {
  color: #64748b;
  content: ">";
  flex: 0 0 auto;
  font-size: 14px;
  transition: transform 0.16s ease;
}

.review-nav-group[open] .review-nav-summary::before {
  transform: rotate(90deg);
}

.review-nav-summary > div,
.review-nav-student summary > div {
  min-width: 0;
}

.review-nav-summary h4 {
  margin: 0 0 2px;
  font-size: 15px;
}

.review-nav-students {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.review-nav-student {
  border: 1px solid #e1e7ef;
  border-radius: 7px;
  background: #ffffff;
}

.review-nav-student summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 9px;
}

.review-nav-student summary strong,
.review-nav-student summary span {
  display: block;
}

.review-nav-student summary span {
  color: #64748b;
  font-size: 12px;
}

.review-nav-tasks {
  display: grid;
  gap: 4px;
  padding: 0 8px 8px;
}

.review-task-nav {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #1f2937;
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 42px;
  padding: 7px 9px;
  text-align: left;
  white-space: normal;
}

.review-task-nav:hover,
.review-task-nav:focus-visible {
  background: #eef3f8;
  border-color: #cbd6e2;
}

.review-task-nav.active {
  background: #e8f8ec;
  border-color: #71d487;
}

.review-task-nav span,
.review-task-nav small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-task-nav small {
  color: #64748b;
  font-size: 12px;
}

.review-detail {
  min-width: 0;
}

.review-empty-detail {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: #64748b;
  padding: 24px;
  text-align: center;
}

.review-submission-card {
  display: grid;
  gap: 12px;
}

.review-submission-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-submission-head h3 {
  margin-bottom: 4px;
}

.review-submission-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review-task-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.review-code-panel {
  display: grid;
  gap: 10px;
}

.review-code-panel h4 {
  margin: 0;
  font-size: 16px;
}

.task-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}

.task-images figure {
  width: min(100%, 300px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.task-images img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: white;
}

.task-type-python_robot .text-block img,
.teacher-topic-task.task-type-python_robot .rich-text-editable img {
  max-width: min(100%, 300px);
  max-height: 300px;
}

.task-type-python_robot .task-images {
  grid-template-columns: repeat(auto-fit, minmax(126px, 300px));
}

.task-type-python_robot .task-images figure {
  width: min(100%, 300px);
}

.task-type-python_robot .task-images img {
  max-height: 224px;
}

.task-images figcaption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px;
}

.tests {
  display: grid;
  gap: 8px;
}

.test-case {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.task-class-grid {
  display: grid;
  gap: 14px;
}

.class-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.class-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(280px, 70vw);
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 0 12px;
}

.class-tab > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-tab:hover,
.class-tab.active {
  border-color: #b8c7ff;
  background: #e8efff;
  color: var(--primary-dark);
}

.class-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.class-tab.active .class-tab-count {
  background: white;
  color: var(--primary-dark);
}

.task-class-section {
  display: grid;
  gap: 12px;
}

.assignment-list-panel {
  display: grid;
  gap: 12px;
}

.template-manager-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
}

.template-manager-layout > *,
.template-list-panel,
.template-detail-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.template-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.template-list-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 11px;
  text-align: left;
  white-space: normal;
}

.template-list-item:hover,
.template-list-item:focus-visible,
.template-list-item.active {
  border-color: var(--primary);
  background: #eef8f0;
}

.template-list-item strong,
.template-list-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.template-list-item span {
  color: var(--muted);
  font-size: 13px;
}

.template-add-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.template-add-grid > *,
.template-add-grid label,
.template-add-grid select,
.template-add-grid .form-grid {
  min-width: 0;
  max-width: 100%;
}

.template-add-grid .form-grid {
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.planning-manager-layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.planning-manager-layout > *,
.planning-template-panel,
.planning-detail-panel {
  min-width: 0;
}

.planning-template-panel,
.planning-detail-panel,
.planning-template-list {
  display: grid;
  gap: 10px;
}

.planning-plan-create-form,
.planning-plan-title-form,
.planning-topic-add-form,
.planning-group-bind-form,
.planning-title-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.planning-plan-create-form input,
.planning-plan-title-form input,
.planning-topic-add-form input,
.planning-group-bind-form select {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
}

.planning-plan-create-form button,
.planning-plan-title-form button,
.planning-topic-add-form button,
.planning-group-bind-form button,
.planning-title-form button,
.planning-actions-cell button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.planning-template-item {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  white-space: normal;
}

.planning-template-item:hover,
.planning-template-item:focus-visible,
.planning-template-item.active {
  border-color: var(--primary);
  background: #eef8f0;
}

.planning-template-item strong,
.planning-template-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.planning-template-item span {
  color: var(--muted);
  font-size: 12px;
}

.planning-detail-head h3,
.planning-bindings h4 {
  margin: 0 0 3px;
}

.planning-detail-head p,
.planning-bindings p {
  margin: 0;
}

.planning-bindings {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.planning-bindings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.planning-bound-groups {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.planning-bound-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid #b8d8c1;
  border-radius: 999px;
  background: #eef8f0;
  padding: 3px 4px 3px 10px;
  font-size: 12px;
}

.planning-bound-group strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-bound-group form,
.planning-task-link-chip form {
  display: inline-flex;
  margin: 0;
}

.planning-bound-group button,
.planning-task-unlink {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0;
}

.planning-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.planning-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.planning-table th,
.planning-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.planning-table th:last-child,
.planning-table td:last-child {
  border-right: 0;
}

.planning-table tbody tr:last-child td {
  border-bottom: 0;
}

.planning-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
}

.planning-table th:nth-child(1) {
  width: 48px;
}

.planning-table th:nth-child(2) {
  width: 30%;
}

.planning-table th:nth-child(4) {
  width: 116px;
}

.planning-order-cell {
  color: var(--muted);
  text-align: center !important;
  font-weight: 700;
}

.planning-title-form {
  align-items: stretch;
}

.planning-title-form textarea {
  min-width: 0;
  min-height: 62px;
  padding: 8px;
  resize: vertical;
}

.planning-task-links {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.planning-material-group {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #d7e1db;
  border-radius: 7px;
  background: #f8fbf9;
  padding: 7px;
}

.planning-theory-group {
  border-color: #a5b4fc;
  background: #f1f3ff;
}

.planning-material-label {
  color: #31523d;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.planning-theory-group .planning-material-label {
  color: #3730a3;
}

.planning-material-chips {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.planning-material-missing {
  color: #92400e;
  border-color: #f3cf86;
  background: #fff8e8;
  font-size: 12px;
}

.planning-task-link-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
}

.planning-task-link-chip em {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-top: 1px solid #b8d8c1;
  border-bottom: 1px solid #b8d8c1;
  background: #eef8f0;
  color: #3b5d48;
  padding: 4px 7px;
  font-size: 11px;
  font-style: normal;
}

.planning-intro-link-chip .planning-task-open {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.planning-intro-link-chip em {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4f46e5;
}

.planning-task-open {
  min-width: 0;
  min-height: 28px;
  max-width: 280px;
  border: 1px solid #b8d8c1;
  border-radius: 6px 0 0 6px;
  background: #eef8f0;
  color: #174b29;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-task-open:hover {
  background: #dff2e4;
}

.planning-task-unlink {
  min-height: 28px;
  border-radius: 0 6px 6px 0;
}

.planning-empty-cell {
  color: var(--muted);
  padding: 24px !important;
  text-align: center !important;
}

.assignment-group-sections {
  display: grid;
  gap: 8px;
}

.assignment-group-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.assignment-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
}

.assignment-group-summary::-webkit-details-marker {
  display: none;
}

.assignment-group-summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 13px;
}

.assignment-group-section[open] .assignment-group-summary::before {
  content: "▾";
}

.assignment-group-summary > div {
  flex: 1 1 auto;
  min-width: 0;
}

.assignment-group-summary h4,
.assignment-group-body h5 {
  margin: 0;
}

.assignment-group-summary h4,
.assignment-group-summary p,
.assignment-group-body h5 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-group-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.assignment-group-body section {
  display: grid;
  gap: 8px;
}

.assignment-bulk-form {
  justify-self: start;
}

.assignment-bulk-form button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.assignment-course-map {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.assignment-course-topic {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.assignment-course-topic:first-child {
  padding-top: 0;
  border-top: 0;
}

.assignment-course-topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assignment-course-topic-head h5 {
  margin: 0;
  min-width: 0;
}

.assignment-course-topic-scopes {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.assignment-topic-delete-form {
  margin: 0;
}

.assignment-topic-delete {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.assignment-course-scope {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.assignment-course-scope-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.assignment-course-scope-head h5 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-card-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.assignment-card-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}

.assignment-card-chip[data-card-title]:hover::after,
.assignment-card-chip[data-card-title]:focus-within::after {
  content: attr(data-card-title);
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  z-index: 90;
  width: max-content;
  max-width: min(420px, calc(100vw - 48px));
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
  padding: 8px 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  pointer-events: none;
}

.assignment-card-move,
.assignment-card-number,
.assignment-card-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0 8px;
}

.assignment-card-move,
.assignment-card-delete {
  min-width: 28px;
  color: #ffffff;
  background: #3f4650;
}

.assignment-card-chip .assignment-card-number,
.assignment-card-chip.intro .assignment-card-number {
  border-color: #65d36e;
  color: #123117;
  background: #65d36e;
}

.assignment-card-chip .assignment-card-number:hover,
.assignment-card-chip .assignment-card-number:focus-visible {
  border-color: #176229;
  color: #123117;
  background: #65d36e;
  box-shadow: 0 0 0 2px rgba(23, 98, 41, 0.28);
}

.assignment-card-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.assignment-card-delete-form {
  display: inline-flex;
  margin: 0;
}

.assignment-card-delete {
  border-color: #c83d3d;
  background: #c83d3d;
}

.gradebook-group {
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.gradebook-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.gradebook-summary::-webkit-details-marker {
  display: none;
}

.gradebook-summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 13px;
}

.gradebook-summary > div {
  flex: 1 1 auto;
  min-width: 0;
}

.gradebook-summary h3,
.gradebook-summary p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gradebook-group[open] .gradebook-summary {
  margin-bottom: 12px;
}

.gradebook-group[open] .gradebook-summary::before {
  content: "▾";
}

.gradebook-group[open] .gradebook-summary .pill {
  background: #def7e9;
  color: var(--green);
}

.gradebook-group[open] .gradebook-summary .pill::before {
  content: "Скрыть";
  font-size: 13px;
}

.gradebook-group[open] .gradebook-summary .pill {
  font-size: 0;
}

.gradebook-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overscroll-behavior-inline: contain;
}

.gradebook-task-pager {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.gradebook-task-pager > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gradebook-task-pager button {
  min-height: 32px;
  padding: 5px 10px;
}

.gradebook-page-number {
  min-width: 48px;
  text-align: center;
  color: var(--text);
  font-weight: 700;
}

.gradebook-table {
  min-width: 312px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.gradebook-col-name {
  width: 180px;
}

.gradebook-col-class {
  width: 110px;
}

.gradebook-col-login {
  width: 100px;
}

.gradebook-col-task {
  width: 82px;
}

.gradebook-table th,
.gradebook-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  max-width: 220px;
  overflow: hidden;
  padding: 6px;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.gradebook-table th:last-child,
.gradebook-table td:last-child {
  border-right: 0;
}

.gradebook-table tr:last-child th,
.gradebook-table tr:last-child td {
  border-bottom: 0;
}

.gradebook-table thead th {
  background: #eef3f8;
  min-width: 0;
}

.gradebook-table thead th:first-child,
.gradebook-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
}

.gradebook-table thead th:first-child {
  z-index: 2;
  background: #eef3f8;
}

.gradebook-table thead th:nth-child(2),
.gradebook-table .gradebook-login-cell {
  position: sticky;
  left: 180px;
  z-index: 1;
}

.gradebook-table thead th:nth-child(2) {
  z-index: 2;
  background: #eef3f8;
}

.gradebook-table .gradebook-login-cell {
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.gradebook-table th span,
.gradebook-table th small,
.gradebook-cell {
  display: grid;
  gap: 4px;
}

.gradebook-table th small {
  color: var(--muted);
  font-weight: 400;
}

.gradebook-task-head {
  height: 62px;
  white-space: normal !important;
}

.gradebook-task-title {
  display: -webkit-box !important;
  overflow: hidden;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gradebook-task-topic {
  display: block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gradebook-table thead th:not(:first-child),
.gradebook-table td {
  text-align: center;
}

.gradebook-cell {
  min-width: 0;
  justify-items: center;
}

.task-class-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-class-head h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-task-list {
  display: grid;
  gap: 8px;
}

.compact-task-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.compact-task-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.compact-task-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.compact-task-title strong,
.compact-task-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-task-meta,
.compact-task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-task-actions {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.task-view-details,
.task-edit-details {
  flex: 0 0 auto;
}

.task-view-details[open],
.task-edit-details[open] {
  flex: 1 1 100%;
}

.task-view-details > summary,
.task-edit-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: #e7edf5;
  color: var(--text);
  padding: 0 14px;
  list-style: none;
}

.task-view-details > summary::-webkit-details-marker,
.task-edit-details > summary::-webkit-details-marker {
  display: none;
}

.task-view-details[open] > summary,
.task-edit-details[open] > summary {
  margin-bottom: 12px;
  background: #dbe5f1;
}

.task-full-view {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.task-full-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.task-full-head > div:first-child {
  min-width: 0;
}

.task-full-view h4,
.task-full-view h5 {
  margin: 0;
}

.task-full-head h4,
.task-full-head p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-full-view h5 {
  font-size: 14px;
}

.task-full-view section {
  display: grid;
  gap: 8px;
}

.auto-check-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.task-type-hint {
  margin: -4px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 14px;
}

.test-builder-title,
.test-data-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.test-builder-title h4 {
  margin: 0;
  font-size: 16px;
}

.test-builder-title p {
  margin: 4px 0 0;
}

.task-tests-list,
.test-data-table {
  display: grid;
  gap: 10px;
}

.task-test-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) minmax(180px, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.task-test-row.file-test-mode {
  grid-template-columns: 34px minmax(0, 1.4fr) minmax(180px, 0.8fr) minmax(120px, auto);
}

.task-test-row.turtle-test-mode {
  grid-template-columns: 34px minmax(180px, 1fr) minmax(240px, 1.2fr) minmax(120px, auto);
}

.task-test-row.turtle-test-mode .test-builder-textarea {
  min-height: 150px;
}

.file-test-fields {
  display: none;
  gap: 10px;
}

.task-test-row.file-test-mode [data-standard-test-input] {
  display: none;
}

.task-test-row.file-test-mode .file-test-fields {
  display: grid;
}

.file-test-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.file-test-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.file-test-panel-head,
.file-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.file-test-list,
.file-output-list {
  display: grid;
  gap: 8px;
}

.file-test-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.5fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.file-test-row label {
  gap: 4px;
}

.file-test-row .test-builder-textarea {
  min-height: 74px;
}

.file-test-remove {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 13px;
}

.file-stdin-details {
  color: var(--muted);
  font-size: 13px;
}

.file-stdin-details summary {
  cursor: pointer;
  width: fit-content;
}

.file-stdin-details textarea {
  margin-top: 8px;
  min-height: 64px;
  width: 100%;
}

.task-test-number,
.test-data-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.test-builder-textarea {
  min-height: 96px;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--text);
}

.check-line input {
  width: auto;
}

.test-row-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: stretch;
}

.test-row-actions .check-line {
  min-height: 34px;
  white-space: nowrap;
}

.test-row-actions .test-remove-button {
  width: 100%;
}

.test-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.test-data-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.test-data-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.test-data-row.result-row {
  grid-template-columns: 34px minmax(150px, 0.65fr) minmax(0, 1fr) minmax(0, 1fr);
}

.test-data-row.turtle-test-data-row {
  grid-template-columns: 34px minmax(180px, 0.65fr) minmax(0, 1.35fr) minmax(120px, auto);
}

.turtle-teacher-preview {
  display: grid;
  gap: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 12px;
}

.turtle-teacher-preview[hidden] {
  display: none;
}

.turtle-teacher-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.turtle-teacher-preview h4 {
  margin: 0 0 4px;
}

.teacher-turtle-canvas {
  width: 100%;
  max-height: 420px;
  background: white;
}

.run-compare-card {
  margin-top: 0;
  padding: 14px;
}

.run-compare-card.test-data-card {
  margin-top: 0;
}

.run-check-row {
  grid-template-columns: 34px minmax(140px, 0.55fr) minmax(0, 1fr) minmax(0, 1fr);
}

.test-data-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.test-io {
  min-height: 46px;
  border: 1px solid #c8d1df;
  border-radius: 6px;
  background: white;
  padding: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
}

.test-data-status {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.file-output-list {
  margin-top: 10px;
}

.file-output-card {
  display: grid;
  gap: 8px;
  border: 1px solid #c8d1df;
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.file-output-link {
  justify-self: start;
}

.student-check-card {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.span-result {
  grid-column: span 2;
  align-self: center;
}

.turtle-wrap {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.turtle-workbench {
  background: #eef2f7;
}

.turtle-result-panel {
  min-width: 0;
}

.kumir-answer-panel {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.kumir-answer-panel label {
  display: grid;
  gap: 6px;
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
}

.kumir-answer-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.kumir-answer-check-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.kumir-answer-check-block label {
  display: grid;
  gap: 6px;
  max-width: 320px;
}

.turtle-toolbar,
.turtle-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.turtle-zoom-controls {
  justify-content: flex-end;
}

.turtle-zoom-controls button {
  min-width: 38px;
  min-height: 30px;
  padding: 0 9px;
}

.turtle-canvas {
  width: 100%;
  height: auto;
  min-height: 360px;
  max-height: min(70vh, 720px);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}

.submission-code {
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

details {
  display: grid;
  gap: 10px;
}

summary {
  cursor: pointer;
  color: var(--primary);
}

@media (max-width: 980px) {
  .login-layout,
  .workspace,
  .student-layout,
  .editor-grid,
  .python-workbench,
  .robot-workbench,
  .stepik-student-layout,
  .teacher-course-shell .stepik-student-layout,
  .template-manager-layout,
  .planning-manager-layout,
  .template-add-grid,
  .stepik-workbench,
  .review-workspace,
  .turtle-student-workbench,
  .teacher-topic-board,
  .stepik-lesson-footer,
  .grid.two,
  .grid.three,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .compact-task-edit-form.form-grid.two {
    grid-template-columns: 1fr;
  }

  .compact-task-edit-form .task-type-hint.span-full {
    grid-column: 1 / -1;
  }

  .credential-row {
    grid-template-columns: 1fr;
  }

  .compact-task-main {
    grid-template-columns: 1fr;
  }

  .task-test-row,
  .task-test-row.file-test-mode,
  .file-test-grid,
  .file-test-row,
  .test-data-row,
  .test-data-row.result-row {
    grid-template-columns: 1fr;
  }

  .span-result {
    grid-column: auto;
  }

  .review-sidebar {
    max-height: none;
    position: static;
  }

  .student-action-form select {
    width: 100%;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stepik-topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 0;
  }

  .stepik-brand,
  .stepik-user {
    padding: 0 14px;
  }

  .stepik-brand img {
    width: auto;
    height: 34px;
  }

  .stepik-progress-strip {
    order: 3;
    padding: 0 14px;
  }

  .stepik-course-sidebar {
    max-height: 300px;
  }

  .stepik-lesson-header {
    display: grid;
  }

  .student-lesson-pager {
    align-items: center;
    justify-content: flex-start;
  }

  .student-lesson-pages {
    justify-content: flex-start;
  }

  .teacher-task-list-panel {
    position: static;
    max-height: none;
    order: -1;
  }

  .content {
    padding: 18px;
  }

  .panel {
    padding: 14px;
  }

  .class-tabs,
  .teacher-mode-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .class-tab,
  .teacher-mode-button {
    flex: 0 0 auto;
  }

  .credential-actions,
  .student-action-form {
    flex-wrap: wrap;
  }

  .extra-group-tools,
  .group-student-add-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  #teacherPreviewForm {
    grid-template-columns: 1fr;
  }

  .planning-plan-create-form,
  .planning-plan-title-form,
  .planning-topic-add-form,
  .planning-group-bind-form,
  .planning-title-form {
    grid-template-columns: 1fr;
  }

  .planning-material-link-form {
    grid-template-columns: 1fr;
  }

  .teacher-preview-section-head > div {
    display: grid;
    gap: 4px;
  }

  button,
  .button-link {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 7px;
  }

  .topbar,
  .section-head {
    display: grid;
    gap: 10px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .topbar-title {
    align-items: flex-start;
  }

  .topbar-title img {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .topbar-user,
  .row,
  .compact-task-actions,
  .compact-task-meta,
  .editor-top-actions,
  .runtime-strip,
  .judge-actions,
  .stepik-footer-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .topbar-user {
    gap: 6px;
  }

  .login-topbar {
    display: grid;
    gap: 2px;
    align-content: center;
    padding: 8px 18px;
  }

  .content,
  .login-panel,
  .login-info {
    padding: 12px;
  }

  .panel,
  .item {
    padding: 12px;
    border-radius: 7px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .panel h3,
  .item h3 {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    padding: 8px 10px;
  }

  .login-feature-grid {
    grid-template-columns: 1fr;
  }

  .demo-account-grid {
    grid-template-columns: 1fr;
  }

  .demo-access-form {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 28px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 12px;
  }

  .workspace {
    min-height: auto;
  }

  .group-summary,
  .assignment-group-summary,
  .gradebook-summary {
    padding: 10px 12px;
  }

  .group-card-body,
  .assignment-group-body {
    padding: 0 10px 10px;
  }

  .credential-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 8px 0;
  }

  .credential-actions,
  .student-action-form {
    align-items: stretch;
  }

  .student-action-form,
  .student-action-form select,
  .credential-row button,
  .student-edit-details > summary {
    width: 100%;
  }

  .student-edit-details {
    flex-basis: 100%;
  }

  .compact-task-item,
  .assignment-group-summary,
  .gradebook-summary,
  .teacher-task-list-head,
  .teacher-edit-panel-head,
  .robot-builder-head,
  .robot-builder-tools {
    display: grid;
  }

  .compact-task-main,
  .compact-task-actions {
    min-width: 0;
  }

  .compact-task-actions form,
  .compact-task-actions button,
  .assignment-bulk-form,
  .assignment-bulk-form button,
  .assignment-course-topic-head,
  .assignment-topic-delete-form,
  .assignment-topic-delete,
  .assignment-course-scope-head {
    display: grid;
    gap: 2px;
  }

  .assignment-card-buttons {
    gap: 5px;
  }

  .teacher-topic-form,
  .teacher-subtopic-form,
  .teacher-topic-edit-form,
  .teacher-subtopic-edit-form,
  .teacher-inline-form,
  .topic-assignment-form,
  .teacher-topic-board {
    grid-template-columns: 1fr;
  }

  .topic-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topic-assignment-form {
    justify-content: stretch;
    min-width: 0;
  }

  .topic-assignment-form .assignment-recipient-picker,
  .topic-assignment-form .assignment-recipient-list {
    max-width: none;
  }

  .teacher-topic-actions,
  .teacher-subtopic-actions {
    opacity: 1;
    position: static;
    justify-content: flex-start;
  }

  .stepik-topbar {
    position: sticky;
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 6px;
    padding: 6px 0;
  }

  .stepik-brand,
  .stepik-user {
    padding: 0 12px;
  }

  .stepik-user {
    justify-content: flex-start;
    white-space: normal;
  }

  .stepik-progress-strip {
    order: 2;
    padding: 0 12px 4px;
  }

  .teacher-mode-tabs {
    order: 3;
    padding: 0 12px 4px;
  }

  .stepik-student-layout {
    min-height: auto;
  }

  .stepik-course-sidebar {
    position: static;
    height: auto;
    max-height: 46vh;
  }

  .stepik-course-summary {
    padding: 12px;
  }

  .stepik-topic-section {
    padding: 10px;
  }

  .stepik-topic-link {
    min-height: 36px;
  }

  .stepik-lesson-header,
  .student-topic-task-head {
    display: grid;
    gap: 10px;
  }

  .stepik-lesson-body,
  .stepik-workbench,
  .robot-workbench,
  .stepik-lesson-footer,
  .judge-workbench {
    padding-left: 14px;
    padding-right: 14px;
  }

  .stepik-lesson-body .lesson-step {
    grid-template-columns: 1fr;
  }

  .stepik-lesson-footer {
    gap: 12px;
  }

  .stepik-code-panel .code-editor,
  .code-editor,
  .robot-code-editor {
    min-height: 260px;
    font-size: 14px;
  }

  .judge-editor-wrap {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .terminal,
  .output,
  .judge-console {
    min-height: 150px;
    font-size: 13px;
  }

  .judge-resource-bar,
  .judge-actions,
  .turtle-editor-bar,
  .judge-bottom {
    display: grid;
    align-items: stretch;
  }

  .judge-actions button,
  .editor-top-actions button,
  .stepik-footer-actions button {
    width: 100%;
  }

  .turtle-submit-button {
    margin: 0;
  }

  .robot-world-block {
    padding: 10px;
  }

  .robot-builder-size,
  .robot-builder-tools {
    align-items: stretch;
  }

  .robot-builder-size input {
    width: 100%;
  }

  .gradebook-scroll,
  .test-data-card,
  .file-test-list,
  .file-output-list {
    overflow-x: auto;
  }

  .rich-text-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .rich-text-editable {
    min-height: 180px;
  }

  .scroll-top-button {
    right: 12px;
    bottom: 12px;
  }
}
.teacher-solution {
  margin-top: 1rem;
  border: 1px solid #b8cee2;
  border-radius: 14px;
  background: #f4f8fc;
  overflow: hidden;
}

.teacher-solution > summary {
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 700;
  color: #174a75;
  background: #dcebf7;
}

.teacher-solution > p {
  margin: 0.8rem 1rem 0;
}

.teacher-solution pre {
  margin: 0.8rem 1rem 1rem;
  padding: 1rem;
  max-height: 34rem;
  overflow: auto;
  border-radius: 10px;
  background: #17212b;
  color: #eef6ff;
  line-height: 1.45;
  white-space: pre;
}

.oop-product,
.oop-student-advice,
.oop-module-note {
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
}

.oop-product {
  background: #fff0e6;
  border-left: 4px solid #e58a45;
}

.oop-student-advice,
.oop-module-note {
  background: #edf6fc;
  border-left: 4px solid #3b82b8;
}

.oop-topic-intro h3 {
  margin-top: 1rem;
  color: #174a75;
}
