:root {
  --color-bg-app: #02050a;
  --color-bg-app-soft: #02050a;
  --color-surface-1: rgba(8, 20, 36, 0.94);
  --color-surface-2: rgba(13, 31, 54, 0.98);
  --color-surface-2-hover: rgba(18, 43, 74, 0.98);
  --color-surface-overlay: rgba(2, 5, 10, 0.76);
  --color-border-subtle: rgba(83, 215, 255, 0.28);
  --color-border-strong: rgba(83, 215, 255, 0.58);
  --color-focus-ring: #53d7ff;
  --color-text-primary: #f2f7ff;
  --color-text-secondary: #d7e9fb;
  --color-text-muted: #9eb7cf;
  --color-text-on-accent: #02050a;
  --color-accent-primary: #53d7ff;
  --color-accent-primary-hover: #7ee5ff;
  --color-accent-soft: rgba(83, 215, 255, 0.16);
  --color-accent-violet: #9f7bff;
  --color-accent-green: #5cffb1;
  --color-success: #5cffb1;
  --color-danger: #ff8ca8;
  --color-warning: #f7d17a;
  --shadow-panel: 0 24px 72px rgba(0, 0, 0, 0.34), 0 0 36px rgba(83, 215, 255, 0.08);
  --shadow-elevated: 0 18px 44px rgba(0, 0, 0, 0.28), 0 0 24px rgba(83, 215, 255, 0.06);
  --shadow-overlay: 0 18px 36px rgba(0, 0, 0, 0.24);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --container-max: 1180px;
  --control-height-sm: 40px;
  --control-height-md: 48px;
  --control-height-lg: 56px;
  --control-padding-x: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --font-ui: "Segoe UI", "Inter", "Noto Sans", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Inter", "Noto Sans", Arial, sans-serif;
  --font-data: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}

body[data-theme="day"] {
  --color-bg-app: #f4f7fb;
  --color-bg-app-soft: #e9eff6;
  --color-surface-1: rgba(255, 255, 255, 0.96);
  --color-surface-2: rgba(246, 250, 255, 0.99);
  --color-surface-2-hover: rgba(235, 242, 252, 0.99);
  --color-surface-overlay: rgba(244, 247, 251, 0.88);
  --color-border-subtle: rgba(109, 132, 167, 0.3);
  --color-border-strong: rgba(109, 132, 167, 0.92);
  --color-focus-ring: #78a9ff;
  --color-text-primary: #15253a;
  --color-text-secondary: #24364e;
  --color-text-muted: #607089;
  --color-text-on-accent: #ffffff;
  --color-accent-primary: #4f8cff;
  --color-accent-primary-hover: #3d79e8;
  --color-accent-soft: rgba(79, 140, 255, 0.12);
  --color-accent-violet: #7c5cff;
  --color-accent-green: #14b8a6;
  --color-success: #2f855a;
  --color-danger: #d64a73;
  --color-warning: #b7791f;
  --shadow-panel: 0 18px 44px rgba(30, 49, 86, 0.08);
  --shadow-elevated: 0 14px 32px rgba(30, 49, 86, 0.08);
  --shadow-overlay: 0 12px 26px rgba(30, 49, 86, 0.08);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--color-bg-app);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

body[data-theme="day"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(111, 144, 209, 0.12), transparent 30%),
    linear-gradient(180deg, #f6f8fc 0%, #edf2f8 48%, #e6ebf3 100%);
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

code,
pre,
.mono,
.chip,
.badge,
.theme-toggle,
.brand__mark {
  font-family: var(--font-mono);
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--color-bg-app) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border-subtle) 90%, transparent);
}

.site-footer {
  margin-top: var(--space-7);
  border-top: 1px solid color-mix(in srgb, var(--color-border-subtle) 90%, transparent);
  padding: 22px 0 34px;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text-muted);
  font-size: 14px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.site-footer__links a {
  color: var(--color-text-primary);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border-strong) 85%, transparent);
}

.container {
  width: min(100% - 32px, var(--container-max));
  margin: 0 auto;
  padding: 0;
}

.container-fluid {
  width: min(100% - 32px, 1480px);
  margin: 0 auto;
  padding: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 0;
}

.toolbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand:hover {
  color: inherit;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-surface-2) 82%, transparent);
  color: var(--color-accent-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.brand__text {
  display: grid;
  gap: 2px;
}

.brand__eyebrow {
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand__title {
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.brand__title--typewriter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.brand__title-text {
  min-width: 0;
}

.brand__cursor {
  display: none;
  width: 0.62em;
  height: 1.05em;
  background: var(--color-accent-primary);
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent-primary) 22%, transparent);
  animation: brand-cursor-blink 1s steps(1, end) infinite;
  flex: 0 0 auto;
}

.brand__title--typewriter.is-enhanced .brand__cursor {
  display: inline-block;
}

@keyframes brand-cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.theme-toggle {
  position: relative;
  width: 54px;
  height: var(--control-height-sm);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-surface-2) 82%, transparent);
  cursor: pointer;
  flex: 0 0 auto;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent-primary);
  transition: transform 0.18s ease;
}

body[data-theme="day"] .theme-toggle::after {
  transform: translateX(22px);
}

.theme-toggle:hover {
  border-color: var(--color-focus-ring);
  background: var(--color-surface-2-hover);
}

.messages {
  list-style: none;
  padding: var(--space-5) 0 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.messages li,
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-surface-2) 88%, transparent);
  color: var(--color-text-primary);
}

.messages .success {
  border-color: color-mix(in srgb, var(--color-success) 45%, var(--color-border-subtle));
}

.messages .error,
.alert-warning {
  border-color: color-mix(in srgb, var(--color-warning) 55%, var(--color-border-subtle));
  color: var(--color-text-primary);
}

.messages .info {
  border-color: color-mix(in srgb, var(--color-accent-primary) 55%, var(--color-border-subtle));
}

.section {
  padding: var(--space-7) 0 0;
}

.section-title {
  margin: 0 0 var(--space-4);
  font-size: clamp(24px, 3vw, 34px);
  font-family: var(--font-display);
  font-weight: 760;
  color: var(--color-text-primary);
  line-height: 1.12;
}

.lead {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--color-text-muted);
}

.muted,
.hint,
.price-note,
.assignments-group__hint,
.assignment-detail__hint,
.attempt-work__hint,
.attempt-task__hint {
  color: var(--color-text-muted);
}

.block,
.card,
.dashboard-panel,
.dashboard-content form,
.auth-form,
.task-card:not(.card) {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--color-accent-violet) 6%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface-1) 96%, transparent), var(--color-surface-1));
  border: 1px solid color-mix(in srgb, var(--color-accent-primary) 28%, var(--color-border-subtle));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}

.block,
.dashboard-panel,
.dashboard-content form,
.auth-form {
  padding: clamp(18px, 3vw, 28px);
}

.card {
  padding: clamp(16px, 3vw, 22px);
  display: grid;
  gap: var(--space-3);
}

.task-card.card {
  box-shadow: none;
}

.block--futuristic {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent-primary) 11%, var(--color-surface-1)), color-mix(in srgb, var(--color-accent-violet) 7%, var(--color-surface-1)));
  border-color: color-mix(in srgb, var(--color-accent-primary) 46%, var(--color-border-subtle));
  box-shadow: var(--shadow-panel);
}

.subjects,
.grid {
  display: grid;
  gap: var(--space-4);
}

.subjects {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tasks-grid,
.types-grid,
.courses-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

.history-dashboard__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-6);
}

.history-dashboard__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  color: var(--color-text-primary);
}

.history-dashboard__lead {
  margin: 0;
  max-width: 720px;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.history-dashboard__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: var(--space-3);
}

.history-dashboard__summary-item {
  min-width: 96px;
  padding: var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}

.history-dashboard__summary-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-primary);
}

.history-dashboard__summary-label {
  display: block;
  margin-top: 6px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.history-dashboard__empty {
  padding: var(--space-5);
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface-2) 62%, transparent);
}

.history-dashboard__empty h3 {
  margin: 0 0 var(--space-2);
  color: var(--color-text-primary);
}

.history-dashboard__empty p {
  margin: 0;
  color: var(--color-text-muted);
}

.active-work-list {
  display: grid;
  gap: var(--space-3);
}

.active-work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "header actions"
    "progress actions"
    "body actions";
  gap: 10px var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-accent-primary) 42%, var(--color-border-subtle));
  border-radius: var(--radius-md);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-accent-primary) 8%, var(--color-surface-1)),
      color-mix(in srgb, var(--color-surface-1) 88%, transparent)
    );
}

.active-work-card--overdue {
  border-color: color-mix(in srgb, var(--color-danger) 55%, var(--color-border-subtle));
}

.active-work-card__header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.active-work-card__title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 10px;
  min-width: 0;
}

.active-work-card__eyebrow {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.active-work-card__title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 18px;
  line-height: 1.25;
}

.active-work-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-accent-primary) 18%, var(--color-surface-2));
  color: var(--color-text-primary);
  font-weight: 700;
}

.active-work-card__progress {
  grid-area: progress;
}

.active-work-card__body {
  grid-area: body;
  display: grid;
  gap: 8px;
}

.active-work-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.active-work-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-work-card__tag {
  padding: 3px 8px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-surface-2) 60%, transparent);
  color: var(--color-text-secondary);
  font-size: 12px;
}

.active-work-card__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: 260px;
}

.active-work-card__actions form {
  display: contents;
}

.history-list {
  display: grid;
  gap: var(--space-3);
}

.history-list__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-1);
}

.history-list__item--summary {
  cursor: pointer;
  list-style: none;
}

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

.history-list__title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  color: var(--color-text-primary);
}

.history-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.history-list__progress {
  display: grid;
  gap: 8px;
  color: var(--color-text-primary);
  font-weight: 600;
}

.history-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.history-session {
  display: grid;
  gap: 0;
}

.history-session[open] .history-list__item--summary {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.history-session__body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: color-mix(in srgb, var(--color-surface-2) 56%, transparent);
}

.history-session__stats,
.history-session__steps {
  display: grid;
  gap: var(--space-2);
}

.history-session__stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  color: var(--color-text-secondary);
  font-size: 14px;
}

.history-session__steps {
  margin: 0;
  padding-left: 1.25rem;
}

.history-session__step {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border-subtle);
}

.history-session__step:first-child {
  border-top: 0;
}

.history-session__step strong {
  color: var(--color-text-primary);
}

.history-session__answer,
.history-session__empty {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .history-dashboard__header,
  .active-work-card,
  .history-list__item {
    grid-template-columns: 1fr;
  }

  .active-work-card {
    grid-template-areas:
      "header"
      "progress"
      "body"
      "actions";
  }

  .history-dashboard__summary {
    width: 100%;
  }

  .active-work-card__actions,
  .history-list__actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

.btn,
.btn-primary,
.btn-secondary,
.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height-sm);
  padding: 0 var(--control-padding-x);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent-primary) 9%, var(--color-surface-2)), color-mix(in srgb, var(--color-accent-violet) 5%, var(--color-surface-2)));
  color: var(--color-text-primary);
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 8%, transparent);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-login:hover {
  background: var(--color-surface-2-hover);
  border-color: var(--color-focus-ring);
  color: var(--color-text-primary);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff 10%, transparent),
    0 10px 24px color-mix(in srgb, var(--color-accent-primary) 12%, transparent);
}

.btn-primary,
.btn.accent,
.btn-large.btn-primary {
  background: linear-gradient(90deg, var(--color-accent-primary) 0%, var(--color-accent-green) 56%, var(--color-accent-violet) 100%);
  border-color: color-mix(in srgb, var(--color-accent-primary) 70%, var(--color-border-strong));
  color: var(--color-text-on-accent);
}

.btn-primary:hover,
.btn.accent:hover,
.btn-large.btn-primary:hover {
  background: linear-gradient(90deg, var(--color-accent-primary-hover) 0%, color-mix(in srgb, var(--color-accent-green) 86%, #ffffff) 56%, var(--color-accent-violet) 100%);
  border-color: var(--color-accent-primary-hover);
  color: var(--color-text-on-accent);
}

.btn-secondary {
  background: transparent;
}

.btn-large {
  min-height: var(--control-height-lg);
  padding: 0 20px;
}

.pill,
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--color-accent-primary) 26%, var(--color-border-subtle));
  background: color-mix(in srgb, var(--color-surface-2) 78%, transparent);
  color: var(--color-text-secondary);
  font-family: var(--font-data);
  font-size: 13px;
  line-height: 1.2;
}

.pill input,
.chip input {
  margin: 0;
}

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.pill-check {
  cursor: pointer;
}

.pill-check .tick {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--color-border-strong);
  background: color-mix(in srgb, var(--color-bg-app) 70%, var(--color-surface-2));
}

.pill-check:has(input:checked) {
  background: color-mix(in srgb, var(--color-accent-primary) 18%, var(--color-surface-2));
  border-color: color-mix(in srgb, var(--color-accent-primary) 55%, var(--color-border-strong));
  color: var(--color-text-primary);
}

.pill-check:has(input:checked) .tick {
  background: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

.pill-check:has(input:checked) .tick::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  margin: 2px 0 0 5px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea,
.module-detail__answer-input {
  width: 100%;
  min-height: var(--control-height-md);
  padding: 12px 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--color-focus-ring) 55%, var(--color-border-subtle));
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.module-detail__answer-input:focus {
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 1px var(--color-focus-ring);
  outline: none;
}

.progress-bar {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-bg-app) 70%, transparent), color-mix(in srgb, var(--color-surface-2) 84%, transparent));
  border: 1px solid color-mix(in srgb, var(--color-accent-primary) 30%, var(--color-border-subtle));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #000000 18%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--color-accent-primary) 9%, transparent);
}

.fill,
.course-card__progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-accent-primary) 0%, var(--color-accent-green) 56%, var(--color-accent-violet) 100%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff 34%, transparent),
    0 0 14px color-mix(in srgb, var(--color-accent-primary) 30%, transparent);
}

.dashboard-tabs {
  margin-top: var(--space-4);
}

.dashboard-tabs .tabs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
}

.dashboard-tabs .tabs li {
  flex: 0 0 auto;
}

.dashboard-tabs .tabs a {
  display: block;
  padding: 11px 16px;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--color-border-subtle);
  border-bottom: none;
  background: color-mix(in srgb, var(--color-surface-2) 72%, transparent);
  color: var(--color-text-muted);
}

.dashboard-tabs .tabs li.active a,
.dashboard-tabs .tabs a:hover {
  background: var(--color-surface-1);
  color: var(--color-text-primary);
}

.dashboard-panel {
  padding: 0;
  overflow: hidden;
}

.dashboard-content {
  padding: clamp(18px, 3vw, 28px);
}

.dashboard-content form + form {
  margin-top: var(--space-4);
}

.dashboard-content label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text-secondary);
}

.role-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.role-toggle input {
  display: none;
}

.role-toggle label {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  text-align: center;
  cursor: pointer;
}

.role-toggle input:checked + label {
  background: color-mix(in srgb, var(--color-accent-primary) 22%, var(--color-surface-2));
  border-color: color-mix(in srgb, var(--color-accent-primary) 55%, var(--color-border-strong));
  color: var(--color-text-primary);
}

.tag-progress-chip,
.type-tag {
  position: relative;
  overflow: hidden;
}

.tag-progress-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-surface-2) 82%, transparent);
  border: 1px solid var(--color-border-subtle);
}

.tag-progress-chip::before,
.type-tag::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--tag-progress, 0%);
  background: color-mix(in srgb, var(--color-accent-primary) 40%, transparent);
  opacity: 0.35;
  pointer-events: none;
}

.tag-progress-chip__label,
.tag-progress-chip__percent,
.type-tag__label {
  position: relative;
  z-index: 1;
}

.variant-buttons,
.module-detail__action-buttons,
.module-detail__card-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.variant-basket-widget,
.variant-basket-widget * {
  font-family: var(--font-ui);
}

.auth-form,
.signup-form {
  display: grid;
  gap: var(--space-4);
}

.auth-entry {
  display: grid;
  gap: var(--space-5);
}

.auth-entry__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.auth-entry__panel {
  gap: var(--space-4);
}

.auth-entry__panel--active {
  border-color: color-mix(in srgb, var(--color-accent-primary) 52%, var(--color-border-strong));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent-primary) 18%, transparent), var(--shadow-elevated);
}

.auth-entry__panel-header {
  display: grid;
  gap: 2px;
}

.auth-entry__eyebrow {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-entry__title {
  color: var(--color-text-primary);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.auth-entry__form {
  display: grid;
  gap: var(--space-3);
}

.auth-entry__help {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface-2) 76%, transparent);
  padding: 10px 12px;
}

.auth-entry__help-trigger {
  cursor: pointer;
  color: var(--color-accent-primary);
  font-weight: 600;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-entry__help-trigger::-webkit-details-marker {
  display: none;
}

.auth-entry__help-trigger::after {
  content: "+";
  float: right;
  color: var(--color-text-muted);
}

.auth-entry__help[open] .auth-entry__help-trigger::after {
  content: "-";
}

.auth-entry__help-body {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-entry__help-body a {
  color: var(--color-text-primary);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border-strong) 85%, transparent);
}

.signup-form .grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.teacher-skillset {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-top: var(--space-5);
  background: color-mix(in srgb, var(--color-surface-2) 78%, transparent);
}

.teacher-skillset__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.teacher-skillset__row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px) auto;
  align-items: end;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface-1) 92%, transparent);
  border: 1px solid var(--color-border-subtle);
}

.teacher-skillset__row--hidden {
  display: none;
}

.teacher-skillset__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: flex-end;
}

.teacher-skillset__remove,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-border-subtle);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.teacher-skillset__remove:hover,
.btn-icon:hover {
  color: var(--color-accent-primary);
  border-color: color-mix(in srgb, var(--color-accent-primary) 65%, var(--color-border-subtle));
}

.teacher-skillset__delete {
  display: none;
}

.price-old {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.price-new {
  font-weight: 700;
}

.task-content img,
.task-content svg {
  display: block;
  margin: 0 auto;
}

.task-content code,
.task-card code {
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-border-subtle) 75%, transparent);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.sr,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: var(--space-2); }
.mb-12 { margin-bottom: var(--space-3); }
.mb-16 { margin-bottom: var(--space-4); }
.mt-8 { margin-top: var(--space-2); }
.mt-12 { margin-top: var(--space-3); }

@media (max-width: 900px) {
  .section {
    padding-top: var(--space-6);
  }

  .auth-entry__grid {
    grid-template-columns: 1fr;
  }

  .teacher-skillset__row {
    grid-template-columns: 1fr;
  }

  .teacher-skillset__controls {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .container,
  .container-fluid {
    width: min(100% - 20px, var(--container-max));
  }

  .row,
  .site-footer__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .dashboard-tabs .tabs a {
    padding: 10px 12px;
    font-size: 14px;
  }
}
