/* ── Base styles (light theme default) ─────────────────────────────────────── */
/* Theme overrides live in /static/themes/*.css                               */
@import url("https://fonts.googleapis.com/css2?family=Exo+2:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3f5f8;
  --bg-2: #eef2f7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-muted: #f7f9fc;
  --surface-editor: #0f1724;
  --surface-editor-2: #131d2d;
  --border: rgba(15, 23, 36, 0.08);
  --border-strong: rgba(15, 23, 36, 0.14);
  --text: #162031;
  --text-soft: #5d6b82;
  --text-faint: #8b96a9;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --success: #0f9d76;
  --warning: #b7791f;
  --danger: #c2414b;
  --shadow-lg: 0 18px 40px rgba(17, 24, 39, 0.08);
  --shadow-sm: 0 6px 18px rgba(17, 24, 39, 0.05);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 26%), radial-gradient(circle at top right, rgba(15, 157, 118, 0.07), transparent 24%), linear-gradient(180deg, #f7f9fc 0%, #f1f4f8 48%, #eef2f7 100%);
}

body.modal-open {
  overflow: hidden;
}

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

.hidden {
  display: none !important;
}

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

.error-text {
  color: var(--danger);
}

.success-text {
  color: var(--success);
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 6px;
  min-height: 100vh;
  padding: 38px 20px 20px;
}

.sidebar,
.workspace-header,
.statement-pane,
.results-dock {
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 40px);
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 18px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(248, 250, 253, 0.92) 100%);
  box-shadow: var(--shadow-lg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-divider {
  height: 1px;
  margin: 2px 10px 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(15, 23, 36, 0.16) 14%, rgba(15, 23, 36, 0.22) 50%, rgba(15, 23, 36, 0.16) 86%, transparent 100%);
}

.brand {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 36, 0.06);
}

.brand-kicker,
.section-kicker,
.workspace-kicker,
.empty-kicker {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.brand-title {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-subtitle {
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-soft);
}

.auth-panel,
.catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catalog-panel {
  gap: 12px;
}

.catalog-panel .section-heading {
  align-items: center;
}

.catalog-nav-tabs {
  display: flex;
  background: rgba(15, 23, 36, 0.07);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-left: auto;
}

.catalog-nav-tab {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
  white-space: nowrap;
}

.catalog-nav-tab.active {
  background: #fff;
  color: var(--accent, #2563eb);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
}

.catalog-nav-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}

.catalog-filters {
  display: grid;
  gap: 8px;
  padding: 0;
  background: transparent;
  margin-bottom: 8px;
}

.catalog-filter-row {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px 32px;
}

.catalog-filter-row.catalog-filter-row-tags {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.catalog-filter-row.catalog-filter-row-tags .catalog-tag-filter-menu {
  left: 0;
  right: 0;
  width: auto;
  min-width: 0;
  max-width: none;
}

.catalog-filter-select {
  min-width: 0;
  height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 36, 0.14);
  outline: none;
  cursor: pointer;
}

.catalog-filter-select option {
  color: var(--text);
  background: #ffffff;
}

.module-catalog-filters {
  padding: 0;
}

.module-picker-select {
  width: 100%;
  display: block;
  height: 36px;
}

#moduleCatalogMessage {
  min-height: 0;
}

#moduleCatalogMessage:empty {
  display: none;
}

.catalog-filter-tag {
  grid-column: 1 / -1;
}

.catalog-tag-filter {
  position: relative;
}

.catalog-tag-filter-toggle {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 36, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.catalog-tag-filter-toggle:hover {
  border-color: rgba(37, 99, 235, 0.32);
}

.catalog-tag-filter-toggle::after {
  content: "▾";
  float: right;
  color: var(--text-faint);
  font-size: 12px;
}

.catalog-tag-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  transform: none;
  min-width: max(100%, 220px);
  width: max-content;
  max-width: min(320px, calc(100vw - 40px));
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(320px, calc(100vh - 180px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid rgba(15, 23, 36, 0.12);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.14);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.catalog-tag-filter-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#taskDifficultyFilterMenu {
  left: auto;
  right: 0;
  width: 220px;
  min-width: 220px;
  max-width: min(220px, calc(100vw - 40px));
}

.catalog-filter-tag .catalog-tag-filter-menu {
  left: 0;
  right: 0;
  width: auto;
  min-width: 0;
  max-width: none;
}

.catalog-tag-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.catalog-tag-filter-option:hover {
  background: rgba(37, 99, 235, 0.08);
}

.catalog-tag-filter-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.catalog-tag-filter-empty {
  padding: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.filter-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text-soft);
  transition: 160ms ease;
}

.filter-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.filter-icon-btn:hover {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.auth-panel {
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 36, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.account-dock {
  flex-shrink: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(248, 250, 253, 0.92) 100%);
  box-shadow: var(--shadow-lg);
}

.account-dock .section-heading {
  margin-bottom: 0;
  justify-content: space-between;
  align-items: center;
}

.account-dock .section-heading h2 {
  font-size: 13px;
  margin-top: 0;
}

.account-dock .account-card {
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 2px;
}

.account-dock .account-name {
  font-size: 14px;
  line-height: 1.15;
}

.account-dock .account-email {
  font-size: 10px;
  margin-top: 3px;
}

.account-dock .auth-submit {
  padding-top: 6px;
  padding-bottom: 6px;
}

.account-dock #authUserView .account-card {
  margin-bottom: 0;
}

.account-card-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-card-main {
  min-width: 0;
  flex: 1 1 auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.section-heading h2,
.dock-header h3,
.block-header h3 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.auth-switch,
.pane-tabs,
.meta-row,
.workspace-actions,
.editor-toolbar,
.editor-toolbar-left,
.catalog-legend,
.task-item-meta,
.block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-panel .section-heading {
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 2px;
}

.account-heading-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.auth-logout-corner {
  margin-left: auto;
  margin-right: 12px;
}

.app-theme-corner {
  position: fixed;
  top: 4px;
  right: 8px;
  z-index: 1300;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 36, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.06);
  text-decoration: none;
}

.app-brand-img {
  height: 24px;
  width: auto;
  display: block;
}

body[data-theme="matrix"] .app-brand {
  border-color: rgba(57, 126, 92, 0.62);
  background: rgba(6, 19, 13, 0.9);
}

body[data-theme="matrix"][data-matrix-variant="blue"] .app-brand {
  border-color: rgba(131, 165, 224, 0.42);
  background: rgba(8, 17, 33, 0.9);
}

body[data-theme="matrix"] .app-brand-img,
body[data-theme="matrix"][data-matrix-variant="blue"] .app-brand-img {
  filter: invert(1) brightness(1.12);
}

.auth-switch {
  flex-wrap: nowrap;
  gap: 6px;
  padding: 2px;
  border-radius: 999px;
  justify-content: flex-end;
  margin-left: auto;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

.theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 36, 0.28);
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.theme-dot:hover {
  transform: translateY(-1px);
}

.theme-dot.active {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.theme-dot-light {
  background: linear-gradient(135deg, #ffffff 0%, #dbe8ff 100%);
}

.theme-dot-nordic {
  background: linear-gradient(135deg, #ebf8ff 0%, #90cdf4 55%, #3182ce 100%);
}

.theme-dot-matrix {
  background: linear-gradient(135deg, #0d110f 0%, #173321 100%);
}

.theme-dot-matrix-blue {
  background: linear-gradient(135deg, #0a1222 0%, #1f4f9d 100%);
}

.auth-panel .section-heading h2 {
  margin-top: 0;
  font-size: 14px;
}

.auth-panel .section-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.chip-btn,
.ghost-btn,
.primary-btn,
.pane-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  transition: 160ms ease;
}

.chip-btn,
.ghost-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
  border-color: rgba(15, 23, 36, 0.08);
}

.chip-btn {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
}

.auth-panel .chip-btn {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  min-height: 30px;
}

.chip-btn.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.ghost-btn {
  padding: 11px 14px;
  font-weight: 600;
}

.ghost-btn-small {
  padding: 8px 12px;
  font-size: 13px;
}

.primary-btn {
  padding: 12px 18px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #2c6cff 0%, #1f5ae0 100%);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.ghost-btn:hover,
.chip-btn:hover,
.primary-btn:hover,
.pane-tab:hover {
  transform: translateY(-1px);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-panel .auth-form {
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.auth-panel .field-label {
  font-size: 12px;
}

.text-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.auth-panel .text-input {
  padding: 10px 12px;
  border-radius: 12px;
}

.text-input:focus {
  outline: 0;
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.auth-panel .auth-submit {
  margin-top: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.account-actions .auth-submit {
  margin-top: 0;
  flex: 1;
}

.account-actions .account-nav-btn {
  min-width: 0;
}

.admin-mini-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent);
  cursor: pointer;
  transition: 160ms ease;
}

.admin-mini-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(243, 248, 255, 0.98);
}

.admin-mini-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.auth-message {
  min-height: 38px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-panel .auth-message {
  min-height: 0;
  font-size: 12px;
  line-height: 1.4;
}

.legal-consent-wrap {
  margin-top: 4px;
}

.auth-form .legal-consent-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-soft);
}

.legal-consent-row input[type="checkbox"] {
  margin-top: 0;
}

.legal-consent-row span {
  white-space: nowrap;
}

.legal-consent-row a {
  color: var(--accent);
  text-decoration: underline;
}

.account-card,
.catalog-summary {
  padding: 16px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 249, 252, 0.86) 100%);
  box-shadow: var(--shadow-sm);
}

.auth-panel .account-card {
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 2px;
}

.account-label,
.summary-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.account-name,
.summary-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-panel .account-name {
  margin-top: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.account-email,
.summary-copy {
  margin-top: 6px;
  line-height: 1.5;
  color: var(--text-soft);
}

.auth-panel .account-email {
  margin-top: 4px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0;
}

.legend-pill,
.soft-pill,
.meta-pill,
.task-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.admin-nav {
  margin-bottom: 2px;
}

.admin-nav-btn {
  width: 100%;
}

.legend-pill,
.soft-pill,
.meta-pill {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 36, 0.08);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: 160ms ease;
}

.task-item:hover {
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(255, 255, 255, 0.96);
}

.task-item.active {
  border-color: rgba(37, 99, 235, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 255, 1) 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

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

.task-item-title {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

.task-premium-lock {
  font-size: 12px;
  margin-left: 5px;
  opacity: 0.7;
}

.task-item-locked {
  opacity: 0.65;
}

.task-item-slug {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

.task-item-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-item-meta .meta-pill {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
}

.task-progress-pill.task-progress-not_started {
  color: #5f6c80;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.28);
}

.task-progress-pill.task-progress-started {
  color: #7a5100;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(217, 119, 6, 0.34);
}

.meta-pill-success {
  color: #0a7c5c;
  background: rgba(15, 157, 118, 0.1);
  border-color: rgba(15, 157, 118, 0.22);
}

.task-progress-pill.task-progress-completed {
  color: #0f5f31;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(22, 163, 74, 0.34);
}

.task-item-tags {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.task-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
  color: #2f5d95;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: 140ms ease;
}

.task-type-pill {
  padding: 4px 9px;
  font-size: 11px;
}

.task-tag-chip:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.14);
}

.task-tag-chip.active {
  color: #1f4f84;
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.4);
}

.task-type-pill {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

#taskMeta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#taskMeta .task-type-pill,
#taskMeta .meta-pill,
#taskMeta .task-meta-pill {
  width: auto;
  height: auto;
  min-height: 24px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  justify-content: center;
  border-radius: 999px;
}

#taskMeta .task-type-pill {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.main-content {
  min-width: 0;
}

.admin-view,
.task-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 40px);
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(247, 249, 252, 0.9) 100%);
  box-shadow: var(--shadow-lg);
}

.empty-inner {
  max-width: 520px;
  text-align: center;
}

.empty-inner h1 {
  margin: 12px 0 10px;
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.empty-inner p {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-soft);
}

/* ── Main catalog view ────────────────────────────────────────────────────── */
.main-catalog-view {
  padding: 0 0 48px;
}

.main-catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  margin-bottom: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 249, 255, 0.97) 100%);
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05), 0 1px 3px rgba(17, 24, 39, 0.04);
  position: relative;
  overflow: hidden;
}

.main-catalog-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #2563eb, #60a5fa);
  border-radius: 20px 0 0 20px;
}

.main-catalog-header h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1;
}

.main-catalog-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(15, 23, 36, 0.07);
  padding: 5px 13px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Task cards ─────────────────────────────────────────────────────────── */
.main-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.main-task-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(245, 249, 255, 0.99) 100%);
  border: 1px solid rgba(15, 23, 36, 0.09);
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
  width: 100%;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05), 0 1px 2px rgba(17, 24, 39, 0.04);
}

.main-task-card:hover {
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.13), 0 2px 8px rgba(17, 24, 39, 0.06);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-4px);
}

.main-task-card-accent {
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
  flex-shrink: 0;
}

.main-task-card-accent.lang-python {
  background: linear-gradient(90deg, #0f9d76 0%, #34d399 100%);
}

.main-task-card-body {
  padding: 16px 18px 15px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.main-task-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.main-task-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

.main-task-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid rgba(15, 23, 36, 0.07);
}

.main-task-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  margin-top: 6px;
}

/* ── Module cards ───────────────────────────────────────────────────────── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.main-module-subheader {
  grid-column: 1 / -1;
  margin: -10px 0 -6px;
  padding: 2px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.main-module-subheader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text);
}

.main-module-subheader-meta strong {
  font-size: 17px;
  line-height: 1.25;
}

.main-module-back-btn {
  min-height: 34px;
  padding: 6px 12px;
}

.module-card {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(245, 249, 255, 0.99) 100%);
  border: 1px solid rgba(15, 23, 36, 0.09);
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05), 0 1px 2px rgba(17, 24, 39, 0.04);
}

.module-card:hover {
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.13), 0 2px 8px rgba(17, 24, 39, 0.06);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-4px);
}

.module-card-header {
  padding: 18px 20px 15px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(15, 157, 118, 0.04) 100%);
  border-bottom: 1px solid rgba(15, 23, 36, 0.07);
}

.module-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}

.module-card-body {
  padding: 14px 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-card-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.module-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 36, 0.07);
  margin-top: auto;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 249, 255, 0.97) 100%);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.workspace-title-group {
  min-width: 0;
  flex: 1;
}

.task-random-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: flex-start;
  justify-content: flex-end;
  min-width: max-content;
}

.task-random-nav .ghost-btn {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
}

.task-random-nav .task-random-nav-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-random-nav .task-random-nav-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-title-group h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-wrap: balance;
  font-family: "Exo 2", "Manrope", ui-sans-serif, system-ui, sans-serif;
  color: #0f172a;
}

#taskLead {
  display: none;
}

.workspace-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: auto;
}

.statement-pane,
.editor-shell,
.results-dock {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(248, 250, 253, 0.92) 100%);
  box-shadow: var(--shadow-lg);
}

.statement-pane {
  display: block;
  padding: 12px 20px;
}

.content-block {
  padding: 18px;
  border: 1px solid rgba(15, 23, 36, 0.06);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.description {
  margin: 0;
  white-space: normal;
  font-size: 16px;
  line-height: 1.65;
}

.description p,
.description ul,
.description h1,
.description h2,
.description h3,
.description h4 {
  margin: 0 0 10px;
}

.task-description-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.desc-block h4 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
}

.desc-block p {
  margin: 0;
}

.description ul {
  padding-left: 20px;
}

.description code {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.95em;
  background: rgba(15, 23, 36, 0.08);
  border-radius: 6px;
  padding: 1px 6px;
}

.public-tests {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-card,
.result-card {
  padding: 16px;
  border: 1px solid rgba(15, 23, 36, 0.06);
  border-radius: 18px;
  background: var(--surface-strong);
}

.test-title,
.result-title,
.dock-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.editor-pane {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.editor-actions {
  position: absolute;
  bottom: 12px;
  left: 28px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
}

#showReferenceBtn {
  order: 0;
  margin-right: auto;
}

#resetCodeBtn {
  order: 1;
}

#showSchemaBtn {
  order: 2;
}

#runPreviewBtn {
  order: 3;
}

#runBtn {
  order: 4;
}

.editor-actions .editor-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border-width: 1px;
  box-shadow: 0 2px 8px rgba(15, 23, 36, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.editor-actions .editor-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 23, 36, 0.16);
}

.editor-actions .editor-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 36, 0.1);
}

.editor-actions .editor-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.editor-actions .ghost-btn.editor-action-btn {
  color: #334f74;
  background: rgba(248, 251, 255, 0.9);
  border-color: #c9d5e6;
  backdrop-filter: blur(4px);
}

.editor-actions .ghost-btn.editor-action-btn svg {
  stroke: #4a6fa5;
}

.editor-actions .primary-btn.editor-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3f88d1 0%, #2d74bd 100%);
  border-color: #3a7fc5;
  box-shadow: 0 4px 14px rgba(45, 116, 189, 0.45);
}

.editor-actions .primary-btn.editor-action-btn svg {
  width: 18px;
  height: 18px;
}

.editor-actions .editor-action-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.editor-actions .editor-action-btn.is-active {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #93c5fd;
}

.editor-actions .editor-action-btn.is-active svg {
  stroke: #1d4ed8;
}

.editor-actions .editor-action-btn.is-loading {
  opacity: 0.55;
  cursor: wait;
}

.editor-actions .editor-action-btn.is-loading svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.editor-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 36, 0.1);
}

.editor-toolbar {
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(15, 23, 36, 0.1);
}

/* User-requested cleanup: hide header chips in statement/editor areas. */
.statement-pane>.block-header {
  display: none;
}

.editor-pane .editor-toolbar-left {
  display: none;
}

.editor-pane .editor-toolbar {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 4;
  justify-content: flex-end;
  padding: 0;
  border-bottom: 0;
}

.editor-badge,
.editor-user,
.editor-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.editor-badge {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.editor-user,
.editor-status {
  color: #475569;
  background: rgba(15, 23, 36, 0.04);
  border: 1px solid rgba(15, 23, 36, 0.1);
}

/* Submission status dot indicator */
#submissionStatusBadge {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #cbd5e1 !important;
  border: 2px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(15, 23, 36, 0.12) !important;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  font-size: 0;
  cursor: default;
}

#submissionStatusBadge.status-accepted {
  background: #22c55e !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4), 0 0 8px rgba(34, 197, 94, 0.35) !important;
}

#submissionStatusBadge.status-wrong_answer,
#submissionStatusBadge.status-runtime_error,
#submissionStatusBadge.status-syntax_error,
#submissionStatusBadge.status-timeout,
#submissionStatusBadge.status-memory_limit,
#submissionStatusBadge.status-failed_internal {
  background: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.4), 0 0 8px rgba(239, 68, 68, 0.3) !important;
}

#submissionStatusBadge.status-queued,
#submissionStatusBadge.status-running {
  background: #f59e0b !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4) !important;
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

.code-editor-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

#codeEditorMount {
  height: 400px;
}

#codeEditorMount .cm-editor {
  height: 100%;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
}

#codeEditorMount .cm-scroller {
  overflow: auto !important;
}

#codeEditorMount .cm-focused {
  outline: none !important;
}

#codeEditorMount .cm-gutters {
  padding-top: 0;
  padding-bottom: 0;
  background: #ffffff !important;
  border-right: 1px solid #eef2f7 !important;
  color: #b0bac9 !important;
  font-size: 14px;
  line-height: 1.65;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#codeEditorMount .cm-content,
#codeEditorMount .cm-line,
#codeEditorMount .cm-gutterElement {
  font-size: 14px;
  line-height: 1.65;
}

/* Matrix dark theme */
body[data-theme="matrix"] #codeEditorMount .cm-gutters {
  background: #0d1117;
  border-right-color: #30363d;
  color: #484f58;
}

body[data-theme="matrix"] .code-editor-stack {
  background: #0d1117;
}

.results-dock {
  padding: 18px 20px 20px;
}

#draftRunResult,
#dataSchemaResult {
  margin-top: 12px;
}

.schema-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.schema-col-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 253, 0.8);
  font-size: 12px;
}

.schema-col-name {
  font-weight: 600;
  color: var(--text);
}

.schema-col-type {
  color: var(--text-soft);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: lowercase;
}

.admin-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(248, 250, 253, 0.92) 100%);
  box-shadow: var(--shadow-lg);
}

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

.admin-panel-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-grid {
  display: grid;
  gap: 14px;
}

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

.admin-grid-four {
  grid-template-columns: 1fr 1fr 1fr 1.1fr;
}

.admin-grid-five {
  grid-template-columns: 1fr 1fr 1fr 1fr 1.1fr;
}

.admin-checkbox-wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.admin-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  resize: vertical;
}

.admin-textarea:focus {
  outline: 0;
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.admin-textarea-lg {
  min-height: 160px;
}

.rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rt-toolbar button {
  border: 1px solid rgba(15, 23, 36, 0.16);
  border-radius: 8px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.rt-toolbar button.active {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.rt-toolbar-fallback::after {
  content: "Базовый режим редактора";
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-soft);
  background: rgba(15, 23, 36, 0.06);
}

.rt-preview-wrap {
  margin-top: 10px;
}

.rt-preview {
  min-height: 110px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
  line-height: 1.6;
}

.rt-preview p,
.rt-preview h2,
.rt-preview h3,
.rt-preview ul,
.rt-preview ol,
.rt-preview blockquote,
.rt-preview pre {
  margin: 0 0 10px;
}

.rt-preview blockquote {
  margin-left: 0;
  padding-left: 12px;
  border-left: 3px solid rgba(37, 99, 235, 0.35);
}

.rt-preview code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(15, 23, 36, 0.08);
}

.admin-rich-editor {
  min-height: 180px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
}

.admin-rich-editor-lg {
  min-height: 240px;
}

.admin-rich-editor .ProseMirror {
  min-height: inherit;
  padding: 12px 14px;
  outline: none;
  line-height: 1.6;
}

.admin-rich-editor .ProseMirror p {
  margin: 0 0 10px;
}

.admin-rich-editor .ProseMirror h2,
.admin-rich-editor .ProseMirror h3 {
  margin: 0 0 10px;
  line-height: 1.3;
}

.admin-rich-editor .ProseMirror ul,
.admin-rich-editor .ProseMirror ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.admin-rich-editor .ProseMirror blockquote {
  margin: 0 0 10px;
  padding-left: 12px;
  border-left: 3px solid rgba(37, 99, 235, 0.35);
}

.admin-rich-editor .ProseMirror code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(15, 23, 36, 0.08);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-rich-editor .ProseMirror pre {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 36, 0.08);
  overflow-x: auto;
}

.admin-rich-editor .ProseMirror img,
.rt-preview img,
.task-description-rich img,
.task-description-sections img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 36, 0.12);
}

.task-description-rich p,
.task-description-rich h2,
.task-description-rich h3,
.task-description-rich ul,
.task-description-rich ol,
.task-description-rich blockquote,
.task-description-rich pre {
  margin: 0 0 10px;
}

.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #b91c1c;
}

.tag-editor {
  min-height: 48px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-editor:focus-within {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.tag-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 64, 175, 0.1);
  color: #1e3a8a;
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.tag-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
}

.tag-input {
  border: 0;
  background: transparent;
  min-width: 180px;
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.tag-input:focus {
  outline: 0;
}

.admin-md-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.admin-md-preview {
  min-height: 160px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
  overflow: auto;
}

.admin-codearea {
  min-height: 280px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-actions .auth-message {
  min-height: 0;
}

.admin-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 36, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.05);
}

.admin-task-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: radial-gradient(1200px 420px at -10% -30%, rgba(37, 99, 235, 0.08), transparent 65%), rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
}

.admin-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: rgba(245, 248, 255, 0.88);
  box-shadow: 0 6px 18px rgba(15, 23, 36, 0.05);
  width: fit-content;
}

.admin-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 140ms ease;
}

.admin-tab-btn:hover {
  color: var(--text);
  background: rgba(15, 23, 36, 0.05);
}

.admin-tab-btn.active {
  color: var(--blue);
  background: linear-gradient(180deg, rgba(217, 231, 255, 0.95), rgba(204, 222, 255, 0.92));
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.admin-list-head h3,
.builder-head h4 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.admin-catalog-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-catalog-bar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.catalog-dd {
  flex: 1;
  min-width: 0;
  position: relative;
}

.catalog-dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 36, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.catalog-dd-trigger:hover,
.catalog-dd-trigger--open {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.catalog-dd-arrow {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-faint);
  transition: transform 120ms ease;
}

.catalog-dd-trigger--open .catalog-dd-arrow {
  transform: rotate(180deg);
}

.catalog-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid rgba(15, 23, 36, 0.12);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(15, 23, 36, 0.10);
  overflow: hidden;
  min-width: 200px;
}

.catalog-dd-option {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 0;
}

.catalog-dd-option:hover {
  background: rgba(239, 245, 255, 0.6);
}

.catalog-dd-option--active {
  background: rgba(239, 245, 255, 0.85);
}

.catalog-dd-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  background: none;
  border: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.catalog-dd-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-dd-count {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-faint);
}

.catalog-dd-prefix {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--blue);
  opacity: 0.5;
  user-select: none;
}

.catalog-dd-level-1 {
  margin-left: 16px;
  border-left: 2px solid rgba(37, 99, 235, 0.18);
  padding-left: 8px;
}

.catalog-dd-level-2 {
  margin-left: 32px;
  border-left: 2px solid rgba(37, 99, 235, 0.18);
  padding-left: 8px;
}

.catalog-dd-level-3 {
  margin-left: 48px;
  border-left: 2px solid rgba(37, 99, 235, 0.18);
  padding-left: 8px;
}

.catalog-dd-level-4 {
  margin-left: 64px;
  border-left: 2px solid rgba(37, 99, 235, 0.18);
  padding-left: 8px;
}

.catalog-dd-level-5 {
  margin-left: 80px;
  border-left: 2px solid rgba(37, 99, 235, 0.18);
  padding-left: 8px;
}

.catalog-dd-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 120ms ease;
}

.catalog-dd-option:hover .catalog-dd-actions {
  opacity: 1;
}

.admin-catalog-create-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
}

.admin-catalog-create-panel .text-input {
  font-size: 13px;
  padding: 6px 10px;
  flex: 1 1 120px;
  min-width: 100px;
}

.catalog-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(15, 23, 36, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.catalog-action-btn:hover:not(:disabled) {
  background: rgba(239, 245, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--blue);
}

.catalog-action-btn.catalog-action-delete:hover:not(:disabled) {
  background: rgba(255, 242, 242, 0.95);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

.catalog-action-btn.catalog-action-confirm:hover:not(:disabled) {
  background: rgba(240, 253, 244, 0.95);
  border-color: rgba(22, 163, 74, 0.25);
  color: #16a34a;
}

.catalog-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.catalog-action-btn--active {
  background: rgba(239, 245, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--blue);
}

.catalog-rename-form {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 4px 6px;
  border: 1px solid rgba(37, 99, 235, 0.30);
  border-radius: 12px;
  background: rgba(239, 245, 255, 0.9);
}

.catalog-rename-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.admin-task-catalog-select {
  font-size: 13px;
}

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

.admin-task-board h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.admin-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

#adminTasksPanel,
#adminDatasetsPanel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#adminDatasetsPanel .admin-task-board-head {
  align-items: flex-end;
}

#adminDatasetsPanel .admin-task-board-head h3 {
  font-size: 24px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

#adminDatasetsPanel .section-kicker {
  letter-spacing: 0.08em;
}

#adminDatasetsPanel .primary-btn {
  background: linear-gradient(135deg, #5b7fbf 0%, #486daa 100%);
  box-shadow: 0 8px 18px rgba(72, 109, 170, 0.2);
}

#adminDatasetsPanel .primary-btn:hover {
  background: linear-gradient(135deg, #5477b6 0%, #43659f 100%);
}

#adminBoardMessage {
  margin-top: -4px;
  font-size: 15px;
  color: #5a6f8c;
}

#createAdminTaskBtn,
#createAdminMaterialBtn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #5b7fbf 0%, #486daa 100%);
  box-shadow: 0 8px 18px rgba(72, 109, 170, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#createAdminTaskBtn svg,
#createAdminMaterialBtn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#createAdminTaskBtn:hover,
#createAdminMaterialBtn:hover {
  background: linear-gradient(135deg, #5477b6 0%, #43659f 100%);
}

#adminTasksPanel .admin-task-list>.muted {
  padding: 22px 18px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.9), rgba(247, 250, 255, 0.82));
  color: #4b6280;
  font-size: 18px;
}

.admin-task-list-wide {
  gap: 12px;
}

.admin-task-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 18px;
  background: rgba(247, 249, 252, 0.92);
}

.admin-task-row:hover {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.98);
}

.admin-task-row-main {
  min-width: 0;
  flex: 1;
}

.builder-head,
.admin-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-task-row-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-task-row-slug {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.admin-task-row-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-task-row-meta .meta-pill {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
}

.admin-task-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 320px;
}

.admin-task-row-actions .text-input {
  width: 200px;
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.admin-task-edit-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.admin-task-edit-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.admin-material-edit-btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.publish-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 2px;
  border: 1px solid rgba(15, 23, 36, 0.14);
}

.publish-dot-on {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.publish-dot-off {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 36, 0.42);
  backdrop-filter: blur(2px);
}

.admin-modal {
  position: fixed;
  inset: 22px;
  z-index: 81;
  overflow: auto;
}

.admin-modal-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.admin-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#adminFormTitle {
  font-size: 34px;
  line-height: 1.15;
}

.admin-builder-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

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

.dataset-top-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.dataset-top-panel {
  padding: 10px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 252, 255, 0.8));
  box-shadow: 0 8px 20px rgba(15, 23, 36, 0.04);
}

.dataset-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.8fr) minmax(0, 0.95fr);
  gap: 8px;
  align-items: end;
}

.dataset-top-panel .field-label {
  margin-bottom: 3px;
  font-size: 12px;
}

.dataset-top-panel .text-input {
  min-height: 34px;
  padding: 6px 10px;
  width: 100%;
  font-size: 13px;
}

.dataset-top-panel .ghost-btn,
.dataset-top-panel .primary-btn {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

#adminDatasetsPanel .admin-grid {
  grid-template-columns: 1fr;
  max-width: 420px;
}

#adminDatasetsPanel .dataset-filter-grid {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dataset-browser-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 2.1fr);
  gap: 10px;
  align-items: start;
}

.dataset-browser-folders,
.dataset-browser-list {
  padding: 8px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.84));
}

.dataset-browser-folders .admin-task-list,
.dataset-browser-list .admin-task-list {
  margin-top: 4px;
}

.dataset-browser-folders .admin-task-row-actions {
  min-width: 0;
  gap: 6px;
}

.dataset-browser-folders .admin-task-row-actions .ghost-btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.dataset-folder-action-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dataset-folder-action-btn svg {
  width: 15px;
  height: 15px;
}

.dataset-folder-action-btn--danger {
  color: #b23b3b;
  border-color: rgba(178, 59, 59, 0.35) !important;
}

.dataset-folder-action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.08) !important;
}

.dataset-folder-row {
  padding: 6px 10px;
  border-radius: 10px;
}

.dataset-folder-row[data-folder-level="1"] {
  margin-left: 12px;
}

.dataset-folder-row[data-folder-level="2"] {
  margin-left: 24px;
}

.dataset-folder-row[data-folder-level="3"] {
  margin-left: 36px;
}

.dataset-folder-row[data-folder-level="4"] {
  margin-left: 48px;
}

.dataset-folder-row--active {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(235, 244, 255, 0.95) !important;
}

.dataset-group-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.dataset-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
}

.dataset-group-head h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  color: #324a6a;
}

.dataset-group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#adminDatasetsPanel .admin-task-list {
  gap: 6px;
}

#adminDatasetsPanel .admin-task-row {
  align-items: center;
  border-radius: 14px;
  background: rgba(248, 250, 255, 0.86);
}

#adminDatasetsPanel .admin-task-row-actions {
  min-width: 0;
  justify-content: flex-end;
}

#adminDatasetsPanel .admin-task-row-title {
  font-size: 15px;
  line-height: 1.2;
}

#adminDatasetsPanel .admin-task-row-slug {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-soft);
  line-height: 1.4;
}

#adminSeoPanel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#adminSeoPanel .admin-task-board-head {
  margin-top: -6px;
  margin-bottom: -2px;
}

#adminSeoMessage:empty {
  display: none;
}

#adminSeoPanel .admin-task-board-head h3 {
  font-size: 18px;
  line-height: 1.1;
}

.seo-sub-tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: rgba(245, 248, 255, 0.88);
  box-shadow: 0 6px 18px rgba(15, 23, 36, 0.05);
  width: fit-content;
}

.seo-sub-tabs .admin-tab-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

#adminSeoPanel .admin-builder-card {
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
}

#adminSeoPanel .builder-head {
  gap: 8px;
}

#adminSeoPanel .builder-head h4 {
  font-size: 14px;
  margin: 2px 0 0;
}

#adminSeoPanel .section-kicker {
  font-size: 10px;
}

#adminSeoPanel .admin-grid {
  gap: 8px;
}

#adminSeoPanel .field-label {
  font-size: 12px;
  margin-bottom: 3px;
}

#adminSeoPanel .text-input {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

#adminSeoPanel .admin-task-list {
  gap: 6px;
}

.admin-tests-builder {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-test-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 20px;
  background: rgba(247, 249, 252, 0.78);
}

.admin-test-card h4 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dock-status {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  background: rgba(15, 23, 36, 0.04);
  border: 1px solid rgba(15, 23, 36, 0.08);
}

.submission-info {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.submission-tests {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

pre {
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  background: #f5f7fb;
  color: #304058;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.status-accepted {
  color: var(--success);
}

.dock-status.status-accepted {
  color: #0f5f31;
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(22, 163, 74, 0.35);
}

.status-running,
.status-queued {
  color: var(--warning);
}

.dock-status.status-running,
.dock-status.status-queued {
  color: #7a5100;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(217, 119, 6, 0.35);
}

.status-wrong_answer,
.status-runtime_error,
.status-syntax_error,
.status-failed_internal,
.status-timeout,
.status-memory_limit,
.status-restricted_operation {
  color: var(--danger);
}

.dock-status.status-wrong_answer,
.dock-status.status-runtime_error,
.dock-status.status-syntax_error,
.dock-status.status-failed_internal,
.dock-status.status-timeout,
.dock-status.status-memory_limit,
.dock-status.status-restricted_operation {
  color: #8a1427;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(220, 38, 38, 0.35);
}

/* Dataset upload section */
.dataset-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dataset-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dataset-section-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dataset-card {
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(248, 250, 255, 0.6);
}

.dataset-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(37, 99, 235, 0.04);
  border-bottom: 1px solid rgba(15, 23, 36, 0.08);
}

.dataset-card-title {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dataset-card-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 400;
}

.dataset-varname-input {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: #fff;
  color: var(--blue);
  font-family: inherit;
  font-weight: 600;
  width: 120px;
}

.dataset-preview-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  overflow-x: auto;
  display: block;
}

.dataset-preview-table th {
  background: rgba(37, 99, 235, 0.06);
  color: var(--text-faint);
  font-weight: 600;
  text-align: left;
  padding: 4px 8px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(15, 23, 36, 0.08);
}

.dataset-preview-table td {
  padding: 3px 8px;
  border-bottom: 1px solid rgba(15, 23, 36, 0.05);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.dataset-preview-more {
  font-size: 11px;
  color: var(--text-faint);
  padding: 4px 8px;
  font-style: italic;
}

.dataset-json-toggle {
  font-size: 11px;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.7;
}

.dataset-json-toggle:hover {
  opacity: 1;
}

/* Expected / preview result section */
.expected-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expected-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-result-card {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(239, 245, 255, 0.4);
}

.preview-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(37, 99, 235, 0.06);
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

.preview-result-meta {
  font-size: 11px;
  color: var(--text-faint);
}

.preview-result-error {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--danger);
  font-family: monospace;
}

.preview-apply-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 120ms ease;
}

.preview-apply-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}

.run-preview-btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 7px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.06);
  color: var(--blue);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 120ms ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.run-preview-btn:hover {
  background: rgba(37, 99, 235, 0.14);
}

.run-preview-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 290px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .workspace-header {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .editor-pane {
    grid-template-rows: minmax(420px, auto) auto;
  }

  .admin-grid-two,
  .admin-grid-three,
  .admin-grid-four,
  .admin-grid-five,
  .dataset-top-panels,
  .dataset-top-grid,
  .dataset-browser-layout,
  .admin-md-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  #adminDatasetsPanel .dataset-filter-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-task-row {
    flex-direction: column;
  }

  .admin-task-row-actions {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .admin-task-row-actions .text-input {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 34px 14px 14px;
    gap: 14px;
  }

  .sidebar,
  .workspace-header,
  .statement-pane,
  .editor-shell,
  .results-dock,
  .empty-state {
    border-radius: 22px;
  }

  .workspace-title-group h1 {
    font-size: 24px;
  }

  .app-theme-corner {
    top: 2px;
    right: 6px;
  }

  .app-brand {
    padding: 6px 11px;
  }

  .app-brand-img {
    height: 22px;
  }
}

/* ── Admin Users Panel ──────────────────────────────────────────────────────── */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: rgba(247, 249, 252, 0.92);
  flex-wrap: wrap;
}

.admin-user-row:hover {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.98);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  flex: 1;
}

.admin-user-name {
  font-weight: 600;
  font-size: 14px;
}

.admin-user-email {
  font-size: 12px;
  opacity: 0.65;
}

.admin-user-role {
  min-width: 140px;
}

.text-input-sm {
  font-size: 13px;
  padding: 5px 10px;
  height: auto;
}

.user-paid-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-left: 4px;
}

.user-paid-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

.user-paid-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.user-paid-toggle:has(input:checked) .user-paid-label {
  color: #2563eb;
  font-weight: 600;
}

.user-badge-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-pioneer {
  background: rgba(250, 176, 5, 0.15);
  color: #b45309;
  border: 1px solid rgba(250, 176, 5, 0.4);
}

.badge-paid {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-tester {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge-active {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.account-badges .user-badge-pill {
  padding: 2px 8px;
  font-size: 10px;
}

.badge-role {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

/* ── Admin Error Log Panel ──────────────────────────────────────────────────── */
.admin-errors-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.admin-error-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: rgba(247, 249, 252, 0.92);
}

.admin-error-row:hover {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

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

.admin-error-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-error-footer {
  font-size: 11px;
  opacity: 0.6;
}

.admin-error-actions {
  display: flex;
  justify-content: flex-end;
}

.error-level-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.error-level-error {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.error-level-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.error-level-info {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.error-status-badge {
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.07);
  border-radius: 6px;
  padding: 1px 7px;
}

.error-type-badge {
  font-size: 12px;
  font-family: monospace;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.07);
  border-radius: 6px;
  padding: 1px 7px;
}

.error-method {
  font-size: 12px;
  font-weight: 600;
  font-family: monospace;
}

.error-path {
  font-size: 12px;
  font-family: monospace;
  word-break: break-all;
}

.error-ts {
  font-size: 12px;
}

.error-message {
  font-size: 13px;
  flex: 1;
  word-break: break-word;
}

.error-tb-toggle {
  flex-shrink: 0;
}

.error-traceback {
  width: 100%;
  font-size: 11px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 6px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.error-full-message {
  width: 100%;
  font-size: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Profile screen ─────────────────────────────────────────────────────────── */
.profile-header {
  display: grid;
  gap: 8px;
  padding: 0 4px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* Back button */
.profile-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: rgba(15, 23, 36, 0.5);
  padding: 0;
  margin-bottom: 4px;
  transition: color 0.15s;
}

.profile-back-btn:hover {
  color: rgba(15, 23, 36, 0.85);
}

.profile-back-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Identity block */
.profile-identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.profile-identity-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.profile-name-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-name {
  font-size: 30px;
  font-weight: 800;
  margin: 0;
  line-height: 1;
  letter-spacing: -0.02em;
}

.profile-change-password-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  color: rgba(37, 99, 235, 0.7);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
  line-height: 1;
}

.profile-change-password-link:hover {
  color: #2563eb;
}

.profile-email {
  font-size: 13px;
  color: rgba(15, 23, 36, 0.5);
  margin: 0;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

/* Level card */
.profile-level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0%, rgba(96, 165, 250, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 16px;
  padding: 12px 16px;
}

.profile-level-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.profile-level-icon {
  font-size: 28px;
  line-height: 1;
}

.profile-level-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent, #2563eb);
  letter-spacing: -0.02em;
}

.profile-level-sub {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 1px;
}

.profile-level-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Top row inside level-right: solved count + streak */
.profile-level-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-solved-count {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

.profile-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #6366f1);
}

.profile-points-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #6366f1);
}

.profile-solved-count span {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 15px;
}

/* Streak inline badge inside level card */
.profile-streak-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-end;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #f97316;
  line-height: 1.4;
}

.profile-streak-inline[data-level="hot"] {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.profile-streak-flame {
  font-size: 13px;
}

.profile-level-bar-wrap {
  height: 7px;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.profile-level-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(.4, 0, .2, 1);
}

.profile-level-bar-label {
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
}

/* Mid row: difficulty + progress side by side */
.profile-mid-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.profile-mid-row>* {
  flex: 1;
  min-width: 0;
}

/* Overall progress */
.profile-progress-wrap {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

.profile-progress-pct {
  font-weight: 700;
  color: var(--accent, #2563eb);
  font-size: 14px;
}

.profile-progress-track {
  height: 10px;
  background: rgba(15, 23, 36, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.profile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #34d399 100%);
  border-radius: 99px;
  transition: width 0.7s cubic-bezier(.4, 0, .2, 1);
}

/* Language cards */
.profile-lang-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-lang-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 36, 0.03);
  border: 1px solid rgba(15, 23, 36, 0.07);
}

.profile-lang-card[data-lang="python"] {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.12);
}

.profile-lang-card[data-lang="sql"] {
  background: rgba(8, 145, 178, 0.05);
  border-color: rgba(8, 145, 178, 0.14);
}

.profile-lang-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.profile-lang-card[data-lang="python"] .profile-lang-num {
  color: #2563eb;
}

.profile-lang-card[data-lang="sql"] .profile-lang-num {
  color: #0891b2;
}

.profile-lang-pill {
  flex-shrink: 0;
}

/* CTA block */
.profile-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(52, 211, 153, 0.07));
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-soft);
}

.profile-cta-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Difficulty breakdown */
.profile-difficulty-wrap {
  background: var(--card-bg, rgba(255, 255, 255, 0.6));
  border: 1px solid var(--border-soft, rgba(15, 23, 36, 0.08));
  border-radius: 12px;
  padding: 10px;
}

.profile-difficulty-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.profile-difficulty-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 8px;
}

.profile-difficulty-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.profile-difficulty-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(15, 23, 36, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.profile-difficulty-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

.diff-easy {
  background: #22c55e;
}

.diff-medium {
  background: #f59e0b;
}

.diff-hard {
  background: #ef4444;
}

.profile-difficulty-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8c98a4);
  text-transform: uppercase;
}

/* Lang + tag side by side */
.profile-insights-row {
  display: flex;
  gap: 10px;
}

.profile-insights-row>.profile-section-mini {
  flex: 1;
  min-width: 0;
}

/* Section mini (lang / tag blocks) */
.profile-section-mini {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
}

.profile-section-mini-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted, #8c98a4);
  margin-bottom: 14px;
}

/* Tag chips */
.profile-tag-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 36, 0.04);
  border: 1px solid rgba(15, 23, 36, 0.09);
  border-radius: 99px;
  padding: 4px 10px 4px 10px;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}

.profile-tag-chip:hover {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.06);
}

.profile-tag-name {
  color: var(--text);
  font-weight: 500;
}

.profile-tag-count {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted, #8c98a4);
  background: rgba(15, 23, 36, 0.07);
  border-radius: 99px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

/* Stats */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 255, 0.9));
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 18px;
  padding: 16px 14px 13px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-stat-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.07);
}

.profile-stat-value {
  font-size: 36px;
  font-weight: 800;
  color: #2563eb;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.profile-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(15, 23, 36, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Language breakdown */
.profile-lang-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-lang-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 249, 255, 0.88));
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  padding: 9px 14px;
  font-size: 13px;
}

/* History section */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 4px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

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

.profile-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

#profileSubmissionsMessage:empty {
  display: none;
}

.profile-submissions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-submission-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.9));
  transition: border-color 0.15s, background 0.15s;
  flex-wrap: wrap;
}

.profile-submission-row:hover {
  border-color: rgba(37, 99, 235, 0.15);
  background: inherit;
}

.profile-submission-task {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.profile-submission-task-link {
  font-weight: 700;
  font-size: 16px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.profile-submission-task-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

.profile-submission-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-submission-date {
  color: rgba(15, 23, 36, 0.4);
  font-size: 13px;
  white-space: nowrap;
}

.profile-result-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .profile-stat-value {
    font-size: 30px;
  }

  .profile-name {
    font-size: 24px;
  }

  .profile-submission-task-link {
    font-size: 15px;
    max-width: 100%;
  }
}

@media (max-width: 680px) {
  .profile-view {
    padding: 0 4px 22px;
    gap: 14px;
  }

  .profile-header,
  .profile-section {
    padding: 10px;
    border-radius: 14px;
  }

  .profile-identity {
    gap: 10px;
  }

  .profile-avatar {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .profile-name {
    font-size: 20px;
  }

  .profile-submission-meta {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

.profile-submission-row--accepted {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(16, 185, 129, 0.04));
  border-color: rgba(16, 185, 129, 0.22);
}

.profile-submission-row--accepted:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.06));
}

.profile-submission-row--wrong {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), rgba(245, 158, 11, 0.04));
  border-color: rgba(245, 158, 11, 0.22);
}

.profile-submission-row--wrong:hover {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.06));
}

.profile-submission-row--error {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.07), rgba(239, 68, 68, 0.04));
  border-color: rgba(239, 68, 68, 0.2);
}

.profile-submission-row--error:hover {
  border-color: rgba(239, 68, 68, 0.32);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.06));
}

.profile-result-accepted {
  background: rgba(16, 185, 129, 0.12);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.profile-result-wrong {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.profile-result-error {
  background: rgba(239, 68, 68, 0.09);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.profile-result-pending {
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Password modal */
.profile-password-modal {
  position: fixed;
  inset: 0;
  z-index: 81;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.profile-password-modal-inner {
  background: var(--color-surface, #fff);
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 20px;
  padding: 28px 32px 24px;
  width: min(440px, 100%);
  box-shadow: 0 8px 40px rgba(15, 23, 36, 0.16);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-password-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-password-modal-head h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.profile-password-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-password-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Module modals (.modal / .modal-box) ────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px 40px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(15, 23, 36, 0.44);
  backdrop-filter: blur(3px);
}

.modal-box {
  position: relative;
  background: var(--color-surface, #fff);
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-xl, 24px);
  padding: 28px;
  width: min(540px, 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 36, 0.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
  margin-bottom: auto;
}

.modal-box h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.modal-box-wide {
  width: min(780px, 100%);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft, #5d6b82);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* ── Утилитарные классы ──────────────────────────────────────────────────────── */
.mt-8 {
  margin-top: 8px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-6 {
  margin-bottom: 6px;
}

.load-more-wrap {
  text-align: center;
  margin-top: 12px;
}

/* Цвет кнопки «Удалить / Очистить» */
.btn-danger-text {
  color: var(--danger, #c2414b);
}

/* Inline-panel для форм создания (датасет, доступ) */
.inline-create-panel {
  background: var(--color-surface2, var(--surface-muted, #f7f9fc));
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border, rgba(15, 23, 36, 0.08));
}

/* Модификаторы выравнивания для .admin-task-row-actions */
.admin-task-row-actions--end {
  justify-content: flex-end;
}

.admin-task-row-actions--start {
  justify-content: flex-start;
}

/* Мин-ширины полей датасета в таблице модуля */
.dataset-select-w {
  min-width: 220px;
}

.dataset-alias-w {
  min-width: 160px;
}

/* ── Utility classes (replaces inline styles) ───────────────────────────────── */
.u-pixel-hide {
  position: absolute;
  left: -9999px;
}

.u-min-w-0 {
  min-width: 0;
}

.u-wrap-end {
  flex-wrap: wrap;
  align-items: flex-end;
}

.u-flex-row-center {
  display: flex;
  gap: 16px;
  align-items: center;
}

.u-mt-4 {
  margin-top: 4px;
}

.u-mt-6 {
  margin-top: 6px;
}

.u-mt-8 {
  margin-top: 8px;
}

.u-mt-10 {
  margin-top: 10px;
}

.u-mt-12 {
  margin-top: 12px;
}

.u-mb-4 {
  margin-bottom: 4px;
}

.u-text-sm {
  font-size: 13px;
}

.u-input-compact {
  font-size: 12px;
  padding: 4px 8px;
}

.u-pad-card {
  padding: 8px 12px;
}

.u-pad-card-sm {
  padding: 10px 12px;
}

.u-pad-text-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.u-overflow-x-auto {
  overflow-x: auto;
}

.u-overflow-auto {
  overflow: auto;
}

.u-table-full {
  display: table;
  width: 100%;
}

/* Account points badge in sidebar header (2026-04-20) */
.account-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.08);
  color: #1f4f84;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.account-points-icon {
  font-size: 12px;
  line-height: 1;
}

.account-points-badge.hidden {
  display: none !important;
}

/* Account points badge near nickname (2026-04-20) */
.account-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.account-points-badge-inline {
  margin-left: 0;
  margin-right: 0;
  flex-shrink: 0;
}

/* Compact points badge near nickname (2026-04-20) */
.account-points-badge.account-points-badge-inline {
  gap: 4px;
  padding: 3px 7px;
  font-size: 12px;
  transform: translateY(-1px);
}

.account-points-badge.account-points-badge-inline .account-points-icon {
  font-size: 10px;
}

.meta-pill-locked {
  color: #92400e;
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.34);
}

.meta-pill-points {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
  font-weight: 700;
}


/* Sidebar account icons: slightly lower alignment */
#authUserView .account-actions {
  margin-top: 28px;
}

/* Main catalog top split (2026-04-20) */
.main-catalog-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 18px rgba(15, 23, 36, 0.05);
}

.main-catalog-topbar-tabs {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(15, 23, 36, 0.07);
}

.main-catalog-topbar-tabs .catalog-nav-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
}

.main-catalog-topbar-counts {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

.main-task-filters {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 0;
  margin: 0;
  position: relative;
}

.task-active-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.task-active-filter-chip {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 140ms ease;
}

.task-active-filter-chip:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.task-filter-trigger,
.task-random-btn {
  height: 38px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.task-filter-trigger {
  min-width: 112px;
  padding: 0 13px;
  text-align: left;
  font-size: 14px;
}

.task-filter-trigger::after {
  content: "▾";
  margin-left: 10px;
  color: var(--text-faint);
  font-size: 12px;
}

.task-filter-trigger.has-active-filters {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
}

.task-random-btn {
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-random-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.task-filter-trigger:hover,
.task-random-btn:hover {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(255, 255, 255, 0.96);
}

.task-filters-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 90;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 36, 0.13);
}

.task-filters-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-filters-popover-head strong {
  font-size: 16px;
  line-height: 1.15;
}

.task-filters-popover-head .muted {
  max-width: 170px;
  text-align: right;
  font-size: 12px;
  line-height: 1.25;
}

.task-filter-group {
  display: grid;
  gap: 7px;
}

.task-filter-group-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.main-task-filters .catalog-tag-filter-menu.task-filter-options {
  position: static;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  min-width: 0;
  max-width: none;
  max-height: 126px;
  padding: 0;
  overflow-y: auto;
  overflow-x: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
}

.main-task-filters .catalog-tag-filter-menu.task-filter-options-tags {
  padding-right: 4px;
}

.main-task-filters .catalog-tag-filter-option {
  gap: 6px;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

.main-task-filters .catalog-tag-filter-option input {
  width: 13px;
  height: 13px;
}

.main-task-filters .catalog-tag-filter-option:hover {
  background: rgba(37, 99, 235, 0.06);
}

.task-filters-popover-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 36, 0.07);
}

.main-module-filters {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

.main-module-filters .module-picker-select {
  flex: 0 1 320px;
  min-width: 240px;
  max-width: 100%;
  height: 38px;
  border-radius: 12px;
  padding: 0 38px 0 13px;
  border-color: rgba(15, 23, 36, 0.1);
  background-color: rgba(255, 255, 255, 0.76);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  transition: 160ms ease;
}

.main-module-filters .module-picker-select:hover {
  border-color: rgba(37, 99, 235, 0.24);
  background-color: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.main-module-filters .module-picker-select:focus {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.main-module-filters #moduleCatalogMessage {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.main-module-filters #moduleCatalogMessage:empty {
  display: none;
}


/* ── Module progress bar ──────────────────────────────────────────────────── */
.module-progress-bar {
  height: 4px;
  background: rgba(15, 23, 36, 0.08);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.module-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.module-card-done .module-progress-bar {
  display: none;
}

.module-done-pill {
  font-weight: 700;
}

.ui-state {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.ui-state-loading,
.ui-state-empty {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(15, 23, 36, 0.08);
}

.ui-state-error {
  color: var(--danger);
  background: rgba(194, 65, 75, 0.08);
  border: 1px solid rgba(194, 65, 75, 0.18);
}

.result-message {
  margin-top: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.result-details {
  margin-top: 10px;
}

.result-details summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.admin-task-steps {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 0 10px;
  background: var(--surface-strong);
}

.admin-task-step-btn {
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-task-step-btn.active {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

/* Catalog card polish for large screens (2026-05-03) */
.main-catalog-view {
  margin: 0;
  padding: 0 4px 40px;
}

.main-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.main-task-card {
  position: relative;
  min-height: 78px;
  height: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 253, 0.94) 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.055);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.main-task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(246, 250, 255, 0.98) 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 36, 0.08);
}

.main-task-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  width: 68px;
  height: 2px;
  border-radius: 0 0 999px 0;
  background: rgba(34, 197, 94, 0.82);
}

.main-task-card-diff-medium::after {
  background: rgba(245, 158, 11, 0.86);
}

.main-task-card-diff-hard::after {
  background: rgba(239, 68, 68, 0.84);
}

.main-task-card-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
}

.main-task-card-lang-python .main-task-card-accent {
  background: linear-gradient(180deg, #facc15 0%, #3b82f6 100%);
}

.main-task-card-body {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 16px 8px 16px;
}

.main-task-card-head {
  display: block;
  min-width: 0;
}

.main-task-card-copy {
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main-task-card-title,
.task-item-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.main-task-card-title {
  min-height: 0;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
}

.main-task-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 5px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.main-task-card-meta span:nth-child(even) {
  color: rgba(93, 107, 130, 0.45);
  font-weight: 600;
}

.main-task-card-open {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: auto;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.main-task-card:hover .main-task-card-open {
  opacity: 1;
  transform: translateX(1px);
  color: var(--accent);
  background: transparent;
}

.main-task-card .task-type-pill {
  flex: 0 0 auto;
}

.main-task-card-tags {
  min-height: 0;
  margin-top: 0;
  padding-top: 2px;
}

.main-task-card-tags .task-tag-chip {
  padding: 2px 7px;
  border-color: rgba(15, 23, 36, 0.08);
  background: rgba(15, 23, 36, 0.035);
  color: var(--text-soft);
}

.main-task-card-status-completed {
  opacity: 0.72;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.84) 0%, rgba(244, 247, 251, 0.78) 100%);
}

.main-task-card-status-completed .main-task-card-open {
  opacity: 0;
}

.main-task-card-status-completed:hover .main-task-card-open {
  opacity: 0.72;
}

.task-completed-toggle {
  grid-column: 1 / -1;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 4px;
  padding: 0 14px;
  border: 0;
  border-top: 1px solid rgba(93, 107, 130, 0.18);
  border-bottom: 1px solid rgba(93, 107, 130, 0.12);
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.task-completed-toggle span:nth-child(2),
.task-completed-toggle span:nth-child(3) {
  letter-spacing: 0;
  text-transform: none;
}

.task-completed-toggle span:nth-child(2) {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(93, 107, 130, 0.1);
}

.task-completed-toggle:hover {
  color: var(--accent);
}

.task-item {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.task-item-title {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  line-height: 1.28;
  letter-spacing: 0;
}

.task-item-meta {
  margin-top: auto;
}

@media (min-width: 1600px) {
  .main-catalog-view {
    margin: 0;
  }
}

@media (min-width: 1900px) {
  .main-catalog-view {
    margin: 0;
  }

  .main-tasks-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* Large catalogs: bounded scroll + incremental rendering controls (2026-05-03) */
.task-list,
.admin-task-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(93, 107, 130, 0.42) transparent;
}

.task-list::-webkit-scrollbar,
.admin-task-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.task-list::-webkit-scrollbar-thumb,
.admin-task-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(93, 107, 130, 0.38);
}

.sidebar-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#tasksList,
#moduleTasksList {
  max-height: none;
  overflow: visible;
  padding: 0 4px 28px 0;
  overscroll-behavior: auto;
}

.main-catalog-view {
  max-height: none;
  overflow: visible;
  padding-right: 4px;
}

.admin-task-list {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  overscroll-behavior: contain;
}

.task-load-more-btn {
  min-width: 180px;
}

.catalog-panel .task-list {
  gap: 12px;
}

.catalog-panel .task-item {
  min-height: auto;
  height: auto;
  align-items: stretch;
  overflow: visible;
}

.catalog-panel .task-item-meta {
  margin-top: 2px;
}

.catalog-panel .task-item-tags {
  margin-top: 0;
  padding-top: 2px;
  min-height: 0;
}

.main-tasks-grid .load-more-wrap {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {

  #tasksList,
  #moduleTasksList,
  .main-catalog-view,
  .admin-task-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* Catalog fixed headers and completed task grouping (2026-05-03) */
.sidebar-scroll {
  overflow: hidden;
}

.catalog-panel {
  min-height: 0;
  flex: 1 1 auto;
}

.catalog-panel .section-heading,
.catalog-panel .catalog-filters,
.catalog-panel .module-catalog-filters,
.catalog-panel #moduleCatalogMessage {
  flex: 0 0 auto;
}

#tasksCatalogPage,
#modulesCatalogPage {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#tasksList,
#moduleTasksList {
  flex: 1 1 auto;
  min-height: 0;
  max-height: max(280px, calc(100vh - 400px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 38px 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(93, 107, 130, 0.32) transparent;
}

.main-catalog-topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.main-tasks-grid,
.modules-grid {
  padding-top: 2px;
}

.task-completed-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 2px 0;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.task-completed-divider::before,
.task-completed-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: rgba(93, 107, 130, 0.22);
}

.task-completed-divider-main {
  grid-column: 1 / -1;
  margin: 18px 0 0;
}

.task-completed-divider-main::before,
.task-completed-divider-main::after {
  background: rgba(93, 107, 130, 0.18);
}

@media (max-width: 1280px) {
  .main-catalog-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .main-module-filters {
    order: 3;
    flex: 1 1 100%;
  }
}

@media (max-width: 900px) {
  .sidebar-scroll {
    overflow: visible;
  }

  #tasksList,
  #moduleTasksList {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .main-catalog-topbar {
    top: 0;
  }

  .task-filters-popover {
    left: 0;
    transform: none;
    width: min(360px, calc(100vw - 28px));
  }

  .main-module-filters {
    flex-wrap: wrap;
  }

  .main-module-filters .module-picker-select,
  .main-module-filters #moduleCatalogMessage {
    flex-basis: 100%;
  }
}

/* ── Profile wide-screen layout ───────────────────────────────────────────── */
.profile-view {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 24px;
  gap: 10px;
  overflow: visible;
}

.profile-view .profile-header {
  min-height: 0;
  padding: 14px 18px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.94));
}

.profile-view .profile-header::before {
  display: none;
}

.profile-view .profile-level-card {
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 20px;
  gap: 12px;
}

.profile-view .profile-level-left {
  width: auto;
  padding-right: 12px;
  border-right: 1px solid rgba(93, 107, 130, 0.14);
  gap: 8px;
}

.profile-view .profile-level-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.profile-view .profile-level-title {
  font-size: 16px;
}

.profile-view .profile-level-sub {
  font-size: 11px;
  line-height: 1.25;
}

.profile-view .profile-mid-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 10px;
}

.profile-view .profile-mid-row:not(:has(.profile-progress-wrap:not(.hidden))) {
  grid-template-columns: 1fr;
}

.profile-view .profile-difficulty-wrap,
.profile-view .profile-progress-wrap,
.profile-view .profile-section-mini,
.profile-view .profile-cta {
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.9));
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.05);
}

.profile-view .profile-insights-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-view .profile-insights-row:not(:has(#profileTagStatsWrap:not(.hidden))) {
  grid-template-columns: 1fr;
}

.profile-view .profile-insights-row:not(:has(#profileLangStatsWrap:not(.hidden))) {
  grid-template-columns: 1fr;
}

.profile-view .profile-section-mini {
  min-height: 0;
}

.profile-view .profile-section-mini-label {
  margin-bottom: 8px;
}

.profile-view .profile-section {
  padding: 16px;
  border: 1px solid rgba(15, 23, 36, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.9));
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.05);
}

.profile-view .profile-section h3 {
  font-size: 16px;
  font-weight: 800;
}

.profile-view .profile-section-head {
  margin-bottom: 4px;
}

.profile-view .profile-submission-row {
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 12px;
}

.profile-view .profile-submission-task-link {
  max-width: 100%;
  font-size: 14px;
}

.profile-view .profile-submission-meta {
  width: auto;
  margin-left: auto;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
}

.profile-view .profile-result-badge {
  padding: 3px 8px;
  font-size: 11px;
}

/* ── Desktop grid (≥1400px) ─────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .profile-view {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(300px, 480px);
    grid-template-areas:
      "hero    history"
      "level   history"
      "stats   history"
      "insights history"
      "cta     history";
    column-gap: 18px;
    row-gap: 10px;
    align-items: start;
    padding: 0 0 28px;
  }

  .profile-view .profile-header { grid-area: hero; }
  .profile-view .profile-level-card { grid-area: level; }
  .profile-view .profile-mid-row { grid-area: stats; }
  .profile-view .profile-insights-row { grid-area: insights; }
  .profile-view .profile-cta { grid-area: cta; }

  .profile-view .profile-section {
    grid-area: history;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 52px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(93, 107, 130, 0.3) transparent;
  }

  .profile-view #profileSubmissionsLoadMore {
    grid-column: 2;
  }
}

/* ── Mobile adaptations ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .profile-view .profile-mid-row,
  .profile-view .profile-insights-row {
    grid-template-columns: 1fr;
  }

  .profile-view .profile-level-card {
    flex-direction: column;
  }

  .profile-view .profile-level-left {
    width: auto;
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(93, 107, 130, 0.14);
  }
}

/* ── AI Interview (AI-тренер) ─────────────────────────────────────────────── */

#mainInterviewPage {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 28px;
}

#mainInterviewPage.hidden {
  display: none !important;
}

.ai-interview-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 480px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

#mainInterviewPage .ai-interview-shell {
  border-radius: 28px !important;
  overflow: hidden;
  background-clip: padding-box;
}

body:not([data-theme="matrix"]):not([data-theme="nordic"]) #mainInterviewPage .ai-interview-shell {
  background: #ffffff;
  border-color: rgba(15, 23, 36, 0.12);
  box-shadow: 0 16px 38px rgba(15, 23, 36, 0.08);
}

body:not([data-theme="matrix"]):not([data-theme="nordic"]) #mainInterviewPage .ai-interview-head {
  background: #ffffff;
  border-color: rgba(15, 23, 36, 0.12);
}

.ai-interview-start-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 28px;
  flex-shrink: 0;
}

.ai-interview-start-btn {
  font-size: 16px;
  padding: 14px 48px;
  border-radius: var(--radius-lg);
  position: relative;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ai-interview-start-btn.is-loading {
  animation: aiStartPulse 1.4s ease-in-out infinite;
  cursor: wait;
}

.ai-interview-start-btn.is-loading::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    12px 0 0 rgba(255, 255, 255, 0.7),
    24px 0 0 rgba(255, 255, 255, 0.45);
  animation: aiDotsBounce 1.2s ease-in-out infinite;
}

@keyframes aiStartPulse {
  0%, 100% { box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24); }
  50% { box-shadow: 0 10px 32px rgba(37, 99, 235, 0.45), 0 0 0 8px rgba(37, 99, 235, 0.08); }
}

@keyframes aiDotsBounce {
  0%, 20% { opacity: 0.3; }
  50% { opacity: 1; }
  80%, 100% { opacity: 0.3; }
}

.ai-interview-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 28px 24px;
  background: var(--surface-strong);
  border-top: 1px solid var(--border-strong);
  flex-shrink: 0;
}

body:not([data-theme="matrix"]):not([data-theme="nordic"]) #mainInterviewPage .ai-interview-compose {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

body:not([data-theme="matrix"]):not([data-theme="nordic"]) #mainInterviewPage .ai-interview-messages {
  background: #f7f9fc;
  border-color: rgba(15, 23, 36, 0.12);
}

#mainInterviewPage .ai-interview-head {
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

.ai-interview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.ai-interview-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.ai-interview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-interview-filter-dropdown {
  position: relative;
}

.ai-interview-filter-dropdown summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color 0.14s, background 0.14s;
}

.ai-interview-filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.ai-interview-filter-dropdown summary:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.ai-interview-filter-dropdown summary::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-soft);
  margin-left: 4px;
  transition: transform 0.14s;
}

.ai-interview-filter-dropdown[open] summary::after {
  transform: rotate(180deg);
}

.ai-interview-filter-dropdown summary strong {
  font-weight: 700;
  color: var(--accent);
}

.ai-interview-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
}

.ai-interview-filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}

.ai-interview-filter-menu label:hover {
  background: var(--accent-soft);
}

.ai-interview-filter-menu input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.ai-interview-messages {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

#mainInterviewPage .ai-interview-messages {
  border-right: 0;
  border-left: 0;
  border-radius: 0 !important;
}

.ai-interview-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-interview-messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-strong);
}

.ai-interview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 180px;
  padding: 40px 20px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}

.ai-interview-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 75%;
  animation: aiMsgFadeIn 0.2s ease-out;
}

@keyframes aiMsgFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-interview-msg-student {
  align-self: flex-end;
}

.ai-interview-msg-interviewer {
  align-self: flex-start;
}

.ai-interview-msg-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 4px;
}

.ai-interview-msg-student .ai-interview-msg-role {
  text-align: right;
}

.ai-interview-msg-body {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-interview-msg-student .ai-interview-msg-body {
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ai-interview-msg-interviewer .ai-interview-msg-body {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.ai-interview-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 28px 24px;
  background: var(--surface-strong);
  border-top: 1px solid var(--border-strong);
  flex-shrink: 0;
}

#mainInterviewPage .ai-interview-compose {
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}

.ai-interview-answer {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 128px;
  max-height: 200px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  outline: none;
}

.ai-interview-answer::placeholder {
  color: var(--text-faint);
}

#mainInterviewPage .ai-interview-answer {
  border-radius: 0 !important;
}

body:not([data-theme="matrix"]):not([data-theme="nordic"]) #mainInterviewPage .ai-interview-answer {
  background: #ffffff !important;
  border: 2px solid rgba(85, 112, 150, 0.28) !important;
  color: #162031;
  box-shadow:
    0 12px 26px rgba(15, 23, 36, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body:not([data-theme="matrix"]):not([data-theme="nordic"]) #mainInterviewPage .ai-interview-answer:focus {
  border-color: rgba(37, 99, 235, 0.58) !important;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.1),
    0 14px 30px rgba(37, 99, 235, 0.1);
}

.ai-interview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-interview-actions .ghost-btn:first-child {
  margin-right: auto;
}

#aiInterviewStatus {
  font-size: 12px;
  line-height: 1.3;
}

.editor-action-btn.reference-locked,
.editor-action-btn.reference-locked:disabled {
  opacity: 0.42;
  filter: grayscale(0.35);
  cursor: help;
}

.editor-action-btn.reference-locked:hover,
.editor-action-btn.reference-locked:disabled:hover {
  transform: none;
}

.editor-actions .ai-tutor-action-btn {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.editor-actions .reference-action-btn {
  position: relative;
}

#showReferenceBtn {
  margin-right: 0;
}

#aiTutorBtn {
  order: 1;
  margin-right: auto;
}

#resetCodeBtn {
  order: 2;
}

#showSchemaBtn {
  order: 3;
}

#runPreviewBtn {
  order: 4;
}

#runBtn {
  order: 5;
}

.editor-actions .reference-action-btn::after,
.editor-actions .ai-tutor-action-btn.ai-tutor-limited::after,
.editor-actions .ai-tutor-action-btn.ai-tutor-used::after {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(74, 111, 165, 0.34);
  background: rgba(255, 255, 255, 0.96);
  color: #4a6fa5;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(15, 23, 36, 0.12);
}

.editor-actions .reference-action-btn::after {
  content: "?";
}

.editor-actions .ai-tutor-action-btn.ai-tutor-limited::after {
  content: "1";
}

.editor-actions .ai-tutor-action-btn.ai-tutor-used::after {
  content: "0";
}

.ai-tutor-panel {
  margin-top: 12px;
}

.ai-tutor-inline-answer {
  display: grid;
  gap: 8px;
  max-width: 940px;
  padding: 14px 16px 15px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.86), rgba(255, 255, 255, 0.72));
}

.ai-tutor-inline-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-tutor-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: #2f5d95;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.ai-tutor-inline-answer h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 750;
  color: var(--text);
}

.ai-tutor-inline-answer p {
  margin: 0;
  max-width: 820px;
  font-size: 16px;
  line-height: 1.58;
  color: var(--text);
}

.ai-tutor-inline-answer code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(15, 23, 36, 0.06);
  color: #1d4ed8;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
}