/* === DeutschLernen Design System === */
/* Inspired by Figma marketing: monochrome core + pastel color blocks */

:root {
  --primary: #000000;
  --on-primary: #ffffff;
  --ink: #000000;
  --canvas: #ffffff;
  --inverse-canvas: #000000;
  --inverse-ink: #ffffff;
  --hairline: #e6e6e6;
  --hairline-soft: #f1f1f1;
  --surface-soft: #f7f7f5;
  --block-lime: #dceeb1;
  --block-lilac: #c5b0f4;
  --block-cream: #f4ecd6;
  --block-pink: #efd4d4;
  --block-mint: #c8e6cd;
  --block-coral: #f3c9b6;
  --block-navy: #1f1d3d;
  --accent-magenta: #ff3d8b;
  --semantic-success: #1ea64a;
  --rounded-pill: 50px;
  --rounded-lg: 24px;
  --rounded-md: 8px;
  --rounded-sm: 6px;
  --rounded-xs: 2px;
  --spacing-section: 96px;
  --spacing-xxl: 48px;
  --spacing-xl: 32px;
  --spacing-lg: 24px;
  --spacing-md: 16px;
  --spacing-sm: 12px;
  --spacing-xs: 8px;
  --spacing-xxs: 4px;
  --font-sans: 'Inter', 'SF Pro Display', system-ui, helvetica, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', menlo, monospace;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-weight: 320;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -0.26px;
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
}

a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 480;
}

a:hover {
  opacity: 0.7;
}

/* === Top Nav === */
.top-nav {
  position: sticky;
  top: 0;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  z-index: 100;
  height: 56px;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 16px;
}

.nav-user {
  color: var(--ink);
  font-weight: 330;
  opacity: 0.6;
}

/* === Buttons === */
.btn-primary, .btn-secondary, .btn-danger, .btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 480;
  line-height: 1.40;
  letter-spacing: -0.10px;
  border-radius: var(--rounded-pill);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn-danger {
  background: var(--accent-magenta);
  color: var(--on-primary);
}

.btn-success {
  background: var(--semantic-success);
  color: var(--on-primary);
}

.btn-sm {
  font-size: 16px;
  padding: 8px 18px;
  min-height: 36px;
}

.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-success:hover {
  opacity: 0.85;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  border: none;
  cursor: pointer;
  font-size: 18px;
}

.btn-block {
  width: 100%;
}

/* === Hero Section === */
.hero {
  padding: var(--spacing-section) var(--spacing-xl);
  text-align: center;
}

.hero-image {
  margin-bottom: var(--spacing-lg);
  opacity: 0.9;
}

.hero h1 {
  font-size: clamp(48px, 6vw, 86px);
  font-weight: 340;
  line-height: 1.00;
  letter-spacing: -1.72px;
  margin-bottom: var(--spacing-lg);
}

.hero p {
  font-size: 20px;
  font-weight: 330;
  line-height: 1.40;
  letter-spacing: -0.14px;
  max-width: 640px;
  margin: 0 auto var(--spacing-xl);
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* === Marquee Strip === */
.marquee-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  background: var(--inverse-canvas);
  color: var(--inverse-ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.60px;
  text-transform: uppercase;
  padding: 12px var(--spacing-lg);
  margin-bottom: var(--spacing-section);
  flex-wrap: wrap;
}

.marquee-strip span {
  white-space: nowrap;
}

/* === Steps === */
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-xl);
  max-width: 960px;
  margin: var(--spacing-lg) auto 0;
}

.step {
  text-align: left;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--rounded-full);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.step h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: var(--spacing-xs);
}

.step p {
  font-size: 16px;
  font-weight: 330;
  line-height: 1.45;
  opacity: 0.75;
}

/* === Feature Grid === */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.feature {
  background: var(--surface-soft);
  border-radius: var(--rounded-md);
  padding: var(--spacing-lg);
}

.feature img {
  margin-bottom: var(--spacing-sm);
  opacity: 0.9;
}

.feature h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: var(--spacing-xs);
}

.feature p {
  font-size: 16px;
  font-weight: 330;
  line-height: 1.45;
  opacity: 0.75;
}

/* === Photo Grid === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.photo-card {
  border-radius: var(--rounded-md);
  overflow: hidden;
  background: var(--surface-soft);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.photo-card figcaption {
  font-size: 14px;
  font-weight: 330;
  opacity: 0.7;
  padding: var(--spacing-sm) var(--spacing-md);
}

/* === Color Block Section === */
.color-block {
  border-radius: var(--rounded-lg);
  padding: var(--spacing-xxl) var(--spacing-xl);
  margin: 0 var(--spacing-lg) var(--spacing-section);
}

.color-block-lime { background: var(--block-lime); }
.color-block-lilac { background: var(--block-lilac); }
.color-block-cream { background: var(--block-cream); }
.color-block-pink { background: var(--block-pink); }
.color-block-mint { background: var(--block-mint); }
.color-block-coral { background: var(--block-coral); }
.color-block-navy { background: var(--block-navy); color: var(--inverse-ink); }

.color-block h2 {
  font-size: 26px;
  font-weight: 540;
  line-height: 1.35;
  letter-spacing: -0.26px;
  margin-bottom: var(--spacing-md);
}

.color-block p {
  font-size: 18px;
  font-weight: 320;
  line-height: 1.45;
  max-width: 640px;
}

/* === Section === */
.section {
  padding: 0 var(--spacing-xl);
  margin-bottom: var(--spacing-section);
}

.section h2 {
  font-size: 26px;
  font-weight: 540;
  line-height: 1.35;
  letter-spacing: -0.26px;
  margin-bottom: var(--spacing-lg);
}

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.card {
  background: var(--surface-soft);
  border-radius: var(--rounded-md);
  padding: var(--spacing-md);
  text-decoration: none;
  color: var(--ink);
  transition: opacity 0.15s;
}

.card:hover {
  opacity: 0.85;
}

.card h3 {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: var(--spacing-xs);
}

.card p {
  font-size: 16px;
  font-weight: 330;
  line-height: 1.45;
  color: var(--ink);
  opacity: 0.7;
}

/* === Progress Bar === */
.progress-bar-bg {
  background: var(--hairline);
  border-radius: var(--rounded-pill);
  height: 8px;
  overflow: hidden;
  margin: var(--spacing-xs) 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--rounded-pill);
  background: var(--primary);
  transition: width 0.3s;
}

/* === Stats / Badge === */
.stat {
  font-size: 16px;
  font-weight: 330;
  color: var(--ink);
  opacity: 0.7;
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.60px;
  text-transform: uppercase;
  padding: var(--spacing-xxs) var(--spacing-xs);
  border-radius: var(--rounded-sm);
  background: var(--surface-soft);
}

.badge-success {
  background: var(--semantic-success);
  color: var(--on-primary);
}

.badge-lime {
  background: var(--block-lime);
}

.badge-lilac {
  background: var(--block-lilac);
}

.badge-mint {
  background: var(--block-mint);
}

/* === Messages === */
.messages-container {
  max-width: 1280px;
  margin: var(--spacing-md) auto 0;
  padding: 0 var(--spacing-lg);
}

.message {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--rounded-md);
  margin-bottom: var(--spacing-xs);
  font-size: 16px;
  font-weight: 330;
}

.message-success {
  background: var(--block-mint);
  color: var(--ink);
}

.message-warning, .message-error {
  background: var(--block-coral);
  color: var(--ink);
}

.message-info {
  background: var(--block-lilac);
  color: var(--ink);
}

/* === Forms === */
.form-container {
  max-width: 640px;
  margin: var(--spacing-section) auto;
  padding: 0 var(--spacing-xl);
}

.form-card {
  background: var(--surface-soft);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-xl);
}

.form-card h1 {
  font-size: 26px;
  font-weight: 540;
  line-height: 1.35;
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.form-card ol.steps {
  margin: var(--spacing-md) 0;
  padding-left: var(--spacing-lg);
}

.form-card ol.steps li {
  margin-bottom: var(--spacing-sm);
  line-height: 1.5;
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  font-size: 16px;
  font-weight: 480;
  margin-bottom: var(--spacing-xxs);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 320;
  line-height: 1.45;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  background: var(--canvas);
  color: var(--ink);
  min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ink);
}

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

.form-group .helptext {
  font-size: 14px;
  opacity: 0.6;
  margin-top: var(--spacing-xxs);
  display: block;
}

.form-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

.radio-group {
  display: flex;
  gap: var(--spacing-md);
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xxs);
  font-weight: 330;
  cursor: pointer;
}

/* === Tables === */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  font-weight: 330;
}

th {
  text-align: left;
  font-weight: 540;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--hairline);
}

td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--hairline-soft);
}

tr:hover td {
  background: var(--surface-soft);
}

/* === Dashboard Layout === */
.dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px - 120px);
}

.dashboard-sidebar {
  background: var(--surface-soft);
  padding: var(--spacing-lg);
  border-right: 1px solid var(--hairline);
}

.dashboard-sidebar h3 {
  font-size: 16px;
  font-weight: 540;
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.60px;
}

.dashboard-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.dashboard-sidebar nav a {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--rounded-sm);
  font-size: 16px;
  font-weight: 330;
}

.dashboard-sidebar nav a:hover,
.dashboard-sidebar nav a.active {
  background: var(--canvas);
  font-weight: 480;
}

.sidebar-mobile-extras {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.sidebar-extra-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--rounded-md);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-extra-link:hover {
  background: var(--canvas);
  font-weight: 480;
}

.dashboard-content {
  padding: var(--spacing-xl);
}

/* === Collapsible sidebar === */
.dashboard-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: var(--spacing-md);
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 420;
  color: var(--ink);
  cursor: pointer;
}

.dashboard-collapse-btn:hover {
  background: var(--canvas);
}

.dashboard-collapsed .dashboard-sidebar h3 {
  display: none;
}

.dashboard-sidebar nav a {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.dashboard-sidebar nav a .dash-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.dashboard-collapsed .top-nav .nav-links a .nav-label,
.dashboard-collapsed .dashboard-sidebar nav a .dash-label,
.dashboard-collapsed .sidebar-extra-link .dash-label {
  display: none;
}

.dashboard-collapsed .top-nav .nav-links a,
.dashboard-collapsed .dashboard-sidebar nav a,
.dashboard-collapsed .sidebar-extra-link {
  justify-content: center;
  padding: var(--spacing-sm);
  gap: 0;
}

body.sidebar-collapsed .nav-links .nav-label {
  display: none;
}

body.sidebar-collapsed .nav-links a {
  justify-content: center;
  padding: var(--spacing-xs);
}

.dashboard-collapsed .dashboard-sidebar {
  padding: var(--spacing-xs);
}

.dashboard-collapsed {
  grid-template-columns: 56px 1fr;
}

@media (max-width: 768px) {
  .dashboard-collapsed {
    grid-template-columns: 48px 1fr;
  }
}

.dashboard-content h1 {
  font-size: 26px;
  font-weight: 540;
  line-height: 1.35;
  letter-spacing: -0.26px;
  margin-bottom: var(--spacing-lg);
}

.dashboard-content h2 {
  font-size: 20px;
  font-weight: 480;
  line-height: 1.40;
  margin-bottom: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

/* === Stats Cards (teacher dashboard) === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--surface-soft);
  border-radius: var(--rounded-md);
  padding: var(--spacing-lg);
  text-align: center;
}

.stat-card h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.60px;
  text-transform: uppercase;
  margin-bottom: var(--spacing-xs);
  opacity: 0.6;
}

.stat-card .stat-value {
  font-size: 48px;
  font-weight: 340;
  line-height: 1.00;
  letter-spacing: -0.96px;
}

/* === Task Detail === */
.task-container {
  max-width: 900px;
  margin: var(--spacing-xl) auto;
  padding: 0 var(--spacing-xl);
}

.task-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.task-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.60px;
  text-transform: uppercase;
  opacity: 0.6;
}

.task-card {
  background: var(--surface-soft);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
}

.task-question {
  font-size: 20px;
  font-weight: 330;
  line-height: 1.40;
  margin-bottom: var(--spacing-lg);
}

.task-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.task-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  cursor: pointer;
  font-size: 18px;
  font-weight: 330;
  transition: border-color 0.15s;
}

.task-option:hover {
  border-color: var(--ink);
}

.task-option input[type="radio"] {
  accent-color: var(--ink);
  width: 18px;
  height: 18px;
}

/* === Result === */
.result-box {
  padding: var(--spacing-md);
  border-radius: var(--rounded-md);
  margin-top: var(--spacing-lg);
}

.result-correct {
  background: var(--block-mint);
}

.result-incorrect {
  background: var(--block-coral);
}

.result-box .correct-answer {
  margin-top: var(--spacing-sm);
}

.result-box .explanation {
  margin-top: var(--spacing-sm);
  font-style: italic;
}

/* === Tabs === */
.tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.tab {
  padding: 8px 18px;
  border-radius: var(--rounded-pill);
  font-size: 16px;
  font-weight: 480;
  background: var(--surface-soft);
  color: var(--ink);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.tab:hover {
  opacity: 0.8;
}

.tab.active {
  background: var(--primary);
  color: var(--on-primary);
}

/* === Flashcards === */
.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}
.flashcard {
  perspective: 1000px;
  cursor: pointer;
  height: 140px;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}
.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-md);
  border-radius: var(--rounded-lg);
  font-weight: 580;
  font-size: 16px;
  box-sizing: border-box;
}
.flashcard-front {
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--hairline);
}
.flashcard-back {
  background: #000000;
  color: #ffffff;
  transform: rotateY(180deg);
}

/* === Flashcard Swiper === */
.
.fc-swiper-bg {
  position: absolute;
  inset: 0;
  border-radius: var(--rounded-lg);
  transition: background 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.fc-cards {
  position: absolute;
  inset: 0;
  perspective: 1000px;
  z-index: 1;
}

.fc-card {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.fc-card:active { cursor: grabbing; }

.fc-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
}

.fc-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-lg);
  border-radius: var(--rounded-lg);
  font-size: 22px;
  font-weight: 540;
  box-sizing: border-box;
  line-height: 1.35;
}

.fc-front {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.fc-back {
  background: var(--inverse-canvas);
  color: var(--inverse-ink);
  transform: rotateY(180deg);
}

.fc-actions {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.fc-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  background: var(--canvas);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fc-btn:hover { transform: scale(1.1); }
.fc-no  { color: #e53935; border-color: #e53935; }
.fc-no:hover  { box-shadow: 0 0 0 4px rgba(229,57,53,0.15); }
.fc-yes { color: var(--semantic-success); border-color: var(--semantic-success); }
.fc-yes:hover { box-shadow: 0 0 0 4px rgba(30,166,74,0.15); }

.fc-hint {
  text-align: center;
  font-size: 13px;
  opacity: 0.5;
}

.fc-complete {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl);
  box-sizing: border-box;
  z-index: 2;
}

.fc-swiper {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  margin: 0 auto var(--spacing-md);
  user-select: none;
  -webkit-user-select: none;
}
.footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  padding: var(--spacing-xl) var(--spacing-lg);
  margin-top: auto;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-weight: 700;
  font-size: 16px;
}

.footer-links {
  display: flex;
  gap: var(--spacing-md);
  font-size: 14px;
}

.footer-copy {
  opacity: 0.5;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .nav-inner {
    flex-wrap: wrap;
    row-gap: var(--spacing-xs);
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
  }

  .top-nav {
    height: auto;
  }

  .nav-links {
    flex-wrap: wrap;
    row-gap: var(--spacing-xs);
  }
}

@media (max-width: 768px) {
  .color-block {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .dashboard {
    grid-template-columns: 200px 1fr;
  }

  .dashboard-content {
    padding: var(--spacing-md);
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 48px);
  }

  .form-container {
    padding: 0 var(--spacing-sm);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
}

@media (max-width: 560px) {
  .nav-links .btn-primary,
  .nav-links .btn-secondary {
    font-size: 14px;
    padding: 6px 12px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .section {
    padding: 0 var(--spacing-md);
  }

  .hero-image img {
    height: 56px;
  }

  .step-grid,
  .photo-grid,
  .feature-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* matching pairs: stack columns on phones */
  .matching-grid {
    grid-template-columns: 1fr !important;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .task-nav {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }

  .task-container {
    padding: 0 var(--spacing-md);
  }

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

  .stat-card .stat-value {
    font-size: 36px;
  }

  .photo-card img {
    height: 180px;
  }

  .color-block {
    border-radius: var(--rounded-md);
  }

  .footer-links {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
}

/* sandbox on small screens */
@media (max-width: 768px) {
  .sb-page {
    height: 70vh;
    min-height: 380px;
  }

  .sb-toolbar {
    align-items: flex-start;
  }

  .sb-el.sb-video {
    height: 140px;
  }
}

/* === Utility === */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-md { margin-bottom: var(--spacing-md); }
.gap-sm { gap: var(--spacing-sm); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* hide number spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* === Sandbox Freeform canvas === */
.sb-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 275px);
  min-height: 440px;
}

.sb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-sm);
}

.sb-sep {
  width: 1px;
  height: 24px;
  background: var(--hairline);
  align-self: center;
}

.sb-hint {
  font-size: 13px;
  opacity: 0.6;
}

.sb-zoom-label {
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 46px;
  text-align: center;
}

.sb-format {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
}

.sb-format select,
.sb-format input,
.sb-format button {
  font-size: 13px;
  font-family: inherit;
}

.sb-fmt-tag {
  font-size: 12px;
  opacity: 0.6;
}

.sb-fmt-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: var(--rounded-sm);
}

.sb-fmt-btn.active {
  background: var(--accent-magenta);
  color: #fff;
  border-color: var(--accent-magenta);
}

.sb-fmt-color {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  background: transparent;
  cursor: pointer;
}

.sb-viewport {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  background: var(--surface-soft);
  touch-action: none;
}

.sb-canvas {
  position: relative;
  background-color: #ffffff;
}

.sb-bg-dots {
  background-image: radial-gradient(circle, #d9d9d9 1px, transparent 1px);
  background-size: 24px 24px;
}

.sb-bg-lines {
  background-image: linear-gradient(#e8e8e8 1px, transparent 1px), linear-gradient(90deg, #e8e8e8 1px, transparent 1px);
  background-size: 40px 40px;
}

.sb-bg-blank {
  background-image: none;
}

.sb-tool-label {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}

.sb-color-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sb-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--hairline);
  cursor: pointer;
  padding: 0;
}

.sb-dot.active {
  box-shadow: 0 0 0 2px var(--ink);
}

.sb-toolbar select {
  font-size: 13px;
  padding: 3px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  background: #fff;
  font-family: inherit;
  max-width: 150px;
}

#sb-pen-btn.active {
  outline: 2px solid var(--accent-magenta);
  outline-offset: 1px;
}

.sb-pen-tools {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
}

.sb-pen-tools.on {
  display: flex;
}

#sb-eraser-btn.active {
  outline: 2px solid var(--accent-magenta);
  outline-offset: 1px;
}

.sb-el {
  position: absolute;
  box-sizing: border-box;
  cursor: move;
  min-width: 60px;
  min-height: 40px;
}

.sb-el.sb-readonly {
  cursor: default;
}

.sb-el.sb-audio {
  height: 54px;
}

.sb-el.sb-video {
  height: 200px;
}

.sb-el.sb-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--rounded-md);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sb-el.selected {
  outline: 2px solid var(--accent-magenta);
  outline-offset: 2px;
}

.sb-el audio,
.sb-el video {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--rounded-md);
  background: #000;
}

.sb-text-box {
  width: 100%;
  height: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1.45;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  outline: none;
}

.sb-text-box.editing {
  border-color: rgba(0, 0, 0, 0.25);
}

.sb-note-box {
  background-color: #fff9c4;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border-radius: var(--rounded-md);
  padding: 10px 12px;
}

.sb-el svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.sb-shape-text {
  position: absolute;
  inset: 8%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  line-height: 1.25;
  color: #333;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow: hidden;
  pointer-events: none;
  outline: none;
}

.sb-shape-text.editing {
  pointer-events: auto;
  border: 1px dashed rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
}

.sb-band {
  position: absolute;
  pointer-events: none;
  background: rgba(199, 81, 250, 0.12);
  border: 1px dashed var(--accent-magenta);
  z-index: 1000;
  box-sizing: border-box;
}

.sb-media-print {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
  padding: 8px;
  overflow: hidden;
  border-radius: var(--rounded-md);
}

/* Markdown rendering styles */
.sb-text-box.sb-markdown {
  white-space: normal;
  padding: 8px 12px;
}
.sb-text-box.sb-markdown p {
  margin: 0 0 0.5em;
}
.sb-text-box.sb-markdown p:last-child {
  margin-bottom: 0;
}
.sb-text-box.sb-markdown strong,
.sb-text-box.sb-markdown b {
  font-weight: 700;
}
.sb-text-box.sb-markdown em,
.sb-text-box.sb-markdown i {
  font-style: italic;
}
.sb-text-box.sb-markdown u {
  text-decoration: underline;
}
.sb-text-box.sb-markdown code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-soft);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.sb-text-box.sb-markdown pre {
  margin: 0.5em 0;
  padding: 0.75em 1em;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: var(--rounded-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.5;
}
.sb-text-box.sb-markdown pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.sb-text-box.sb-markdown ul,
.sb-text-box.sb-markdown ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.sb-text-box.sb-markdown li {
  margin: 0.25em 0;
}
.sb-text-box.sb-markdown blockquote {
  margin: 0.5em 0;
  padding: 0.5em 1em;
  border-left: 3px solid var(--accent-magenta);
  background: var(--surface-soft);
  color: var(--ink-muted);
  font-style: italic;
}
.sb-text-box.sb-markdown h1,
.sb-text-box.sb-markdown h2,
.sb-text-box.sb-markdown h3,
.sb-text-box.sb-markdown h4,
.sb-text-box.sb-markdown h5,
.sb-text-box.sb-markdown h6 {
  margin: 0.75em 0 0.5em;
  font-weight: 600;
  line-height: 1.3;
}
.sb-text-box.sb-markdown h1 { font-size: 1.75em; }
.sb-text-box.sb-markdown h2 { font-size: 1.5em; }
.sb-text-box.sb-markdown h3 { font-size: 1.25em; }
.sb-text-box.sb-markdown h4 { font-size: 1.1em; }
.sb-text-box.sb-markdown h5 { font-size: 1em; }
.sb-text-box.sb-markdown h6 { font-size: 0.9em; }
.sb-text-box.sb-markdown a {
  color: var(--accent-magenta);
  text-decoration: underline;
}
.sb-text-box.sb-markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
  font-size: 0.9em;
}
.sb-text-box.sb-markdown th,
.sb-text-box.sb-markdown td {
  border: 1px solid var(--hairline);
  padding: 0.4em 0.6em;
  text-align: left;
}
.sb-text-box.sb-markdown th {
  background: var(--surface-soft);
  font-weight: 600;
}
.sb-text-box.sb-markdown hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 1em 0;
}
.sb-text-box.sb-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: var(--rounded-sm);
}

.sb-handles {
  display: none;
  pointer-events: none;
}

.sb-el.selected .sb-handles {
  display: block;
}

.sb-handle {
  pointer-events: auto;
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--accent-magenta);
  border-radius: 50%;
  z-index: 5;
}

.sb-handle-n { top: -6px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.sb-handle-s { bottom: -6px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.sb-handle-e { right: -6px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.sb-handle-w { left: -6px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.sb-handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.sb-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.sb-handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.sb-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }

/* --- sandbox export / PDF --- */
.sb-export {
  padding: 16px;
}

.sb-export-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sb-export-sheet {
  overflow: hidden;
  border: 1px solid #ddd;
  background: #fff;
}

@media print {
  body {
    margin: 0;
    background: #fff;
  }

  .sb-export {
    padding: 0;
  }

  .sb-export-toolbar {
    display: none;
  }

  .sb-export-sheet {
    border: none;
  }

  .sb-canvas .sb-el {
    box-shadow: none;
  }

  @page {
    size: A4 landscape;
    margin: 0;
  }
}

/* --- Оценка ДЗ: цветные кнопки 2–5 --- */
.grade-picker {
  display: flex;
  gap: var(--spacing-sm);
}

.grade-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 540;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  user-select: none;
  line-height: 1;
}

.grade-btn input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.grade-btn span {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.grade-btn:hover {
  opacity: 0.85;
}

.grade-btn:has(input:checked) {
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--ink);
  transform: scale(1.08);
}

.grade-2 {
  background: #f4b4b4;
}

.grade-3 {
  background: #f3c9b6;
}

.grade-4 {
  background: #f4e0a8;
}

.grade-5 {
  background: var(--block-mint);
}

/* --- Кружок оценки в карточке ДЗ ученика --- */
.grade-badge {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 540;
  color: var(--ink);
  line-height: 1;
}

/* === Mobile (smartphones) === */
.mobile-menu-btn {
  display: none;
}

/* sidebar menu button injected by JS — hidden on desktop, shown only on mobile */
.sidebar-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-menu-btn {
    display: flex;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    margin-right: var(--spacing-xs);
  }

  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    flex-direction: column;
    align-items: stretch;
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a,
  .nav-links form {
    width: 100%;
  }

  .nav-links .btn-primary,
  .nav-links .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .nav-user {
    display: none;
  }

  .dashboard {
    display: block;
  }

  .dashboard-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    z-index: 98;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    border-right: 1px solid var(--hairline);
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
  }

  .dashboard.sidebar-open .dashboard-sidebar {
    transform: translateX(0);
  }

  .dashboard-content {
    padding: var(--spacing-md);
  }

  .dashboard-content h1 {
    font-size: 22px;
  }

  .dashboard-content h2 {
    font-size: 18px;
  }

  .dashboard-collapse-btn {
    display: none;
  }

  .form-card {
    padding: var(--spacing-md);
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-success {
    font-size: 16px;
    padding: 8px 16px;
    min-height: 40px;
  }

  .btn-sm {
    font-size: 14px;
    padding: 6px 14px;
    min-height: 34px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: var(--spacing-xs) var(--spacing-sm);
    white-space: nowrap;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
  }

  .stat-card {
    padding: var(--spacing-sm);
  }

  .stat-card .stat-value {
    font-size: 28px;
  }

  .stat-card h3 {
    font-size: 10px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .task-card {
    padding: var(--spacing-md);
  }

  .task-question {
    font-size: 17px;
  }

  .task-option {
    font-size: 16px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .grade-picker {
    gap: var(--spacing-xs);
  }

  .grade-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .fc-face {
    font-size: 18px;
    padding: var(--spacing-md);
  }

  .fc-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .footer {
    padding: var(--spacing-md);
  }
}

/* mobile sidebar overlay */
.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 97;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }
}

/* === UX/UI improvements: tasks page === */

/* Page header with back link */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 420;
  color: var(--ink);
  opacity: 0.65;
  margin-bottom: var(--spacing-xs);
}

.back-link:hover { opacity: 1; }

.page-header h1 { margin-bottom: 0; }

/* Unified icon buttons (table actions) */
.icon-btn,
.btn-text {
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-sans);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--rounded-md);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink);
  line-height: 0;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.icon-btn:hover {
  background: var(--surface-soft);
  opacity: 1;
}

.icon-btn-danger:hover {
  border-color: var(--accent-magenta);
  color: var(--accent-magenta);
}

.btn-text {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 480;
  color: var(--ink);
  opacity: 0.6;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover { opacity: 1; }

/* Bulk toolbar */
.bulk-toolbar {
  position: sticky;
  top: 64px;
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  background: var(--inverse-canvas);
  color: var(--inverse-ink);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.bulk-toolbar[hidden] { display: none; }

.bulk-toolbar-count { font-size: 15px; letter-spacing: -0.1px; }

.bulk-toolbar .btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--inverse-ink);
}

.bulk-toolbar .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

.bulk-toolbar .btn-danger { background: var(--accent-magenta); }

.bulk-toolbar .btn-text {
  color: var(--inverse-ink);
  margin-left: auto;
}

/* Task block section */
.task-block {
  padding: var(--spacing-lg) !important;
  margin-bottom: var(--spacing-lg) !important;
}

.task-block-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xxs);
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  opacity: 0.65;
  cursor: pointer;
  user-select: none;
}

/* Tasks table typography & spacing */
.tasks-table th {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.5;
  padding: var(--spacing-xs) var(--spacing-sm);
  text-align: left;
}

.tasks-table td {
  padding: var(--spacing-sm);
  vertical-align: middle;
}

.tasks-table tbody tr {
  border-top: 1px solid var(--hairline-soft);
  transition: background 0.15s;
}

.tasks-table tbody tr:hover { background: rgba(255, 255, 255, 0.55); }

.drag-handle-cell { white-space: nowrap; }

.drag-handle-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
  margin-right: 6px;
}

.drag-handle {
  display: inline-block;
  opacity: 0.35;
  font-size: 18px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.order-num {
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0.7;
}

/* Status indicators for task types */
.badge-type {
  min-width: 96px;
  text-align: center;
}

.badge-type-choice    { background: var(--block-lilac); }
.badge-type-text      { background: var(--block-cream); }
.badge-type-matching  { background: var(--block-mint); }
.badge-type-flashcards{ background: var(--block-lime); }

/* Inline editable question */
.question-cell { max-width: 480px; }

.inline-editable {
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: var(--rounded-sm);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: text;
}

.inline-editable:hover { background: rgba(255, 255, 255, 0.7); }

.inline-editable.editing {
  display: block;
  -webkit-line-clamp: unset;
  background: var(--canvas);
  box-shadow: 0 0 0 2px var(--primary);
}

.inline-editor {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  border: none;
  outline: none;
  background: transparent;
  resize: vertical;
}

.inline-editable.saved-ok   { box-shadow: 0 0 0 2px var(--semantic-success); }
.inline-editable.saved-fail { box-shadow: 0 0 0 2px var(--accent-magenta); }

/* Empty state */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  padding: var(--spacing-sm) var(--spacing-xs);
  opacity: 0.75;
}

/* Move dialog */
.modal-dialog {
  border: none;
  border-radius: var(--rounded-lg);
  padding: 0;
  max-width: 380px;
  width: calc(100% - 32px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.modal-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }

.modal-form {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.modal-form h3 {
  font-size: 20px;
  font-weight: 540;
  letter-spacing: -0.2px;
}

.modal-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--canvas);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

@media (max-width: 768px) {
  .bulk-toolbar { top: 56px; }
  .question-cell { max-width: none; }
  .icon-btn { width: 30px; height: 30px; }
}

/* === Fill indicators (наполнение заданий) === */
.task-type-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.fill-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: var(--rounded-sm);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  opacity: 0.85;
  white-space: nowrap;
}

.fill-choice    { background: rgba(197, 176, 244, 0.45); }
.fill-text      { background: rgba(244, 236, 214, 0.8); }
.fill-matching  { background: rgba(200, 230, 205, 0.55); }
.fill-flashcards{ background: rgba(220, 238, 177, 0.6); }

.fill-empty {
  background: transparent;
  border: 1px dashed var(--hairline);
  opacity: 0.6;
}

/* Сортируемая строка при перетаскивании между блоками */
.tasks-table tbody tr.sortable-ghost {
  opacity: 0.4;
  background: var(--block-cream);
}

/* === Toast notifications === */
.toast-host {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  min-width: 260px;
  max-width: 380px;
  background: var(--inverse-canvas);
  color: var(--inverse-ink);
  border-radius: var(--rounded-lg);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-visible { opacity: 1; transform: translateY(0); }
.toast-leaving { opacity: 0; transform: translateY(8px); }

.toast-success { box-shadow: inset 4px 0 0 var(--semantic-success), 0 12px 32px rgba(0, 0, 0, 0.22); }
.toast-error   { box-shadow: inset 4px 0 0 var(--accent-magenta), 0 12px 32px rgba(0, 0, 0, 0.22); }
.toast-info    { box-shadow: inset 4px 0 0 var(--block-lilac), 0 12px 32px rgba(0, 0, 0, 0.22); }

.toast-action {
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 480;
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}

.toast-close {
  -webkit-appearance: none;
  appearance: none;
  font-size: 18px;
  line-height: 1;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 2px 4px;
}

.toast-close:hover { opacity: 1; }

@media (max-width: 560px) {
  .toast-host { left: var(--spacing-md); right: var(--spacing-md); bottom: var(--spacing-md); }
  .toast { max-width: none; width: 100%; }
}

/* === Options editor (конструктор вариантов ответа) === */
#options-list { display: flex; flex-direction: column; gap: var(--spacing-xs); }

.option-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.option-index {
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0.5;
  min-width: 22px;
  text-align: right;
  user-select: none;
}

.option-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--canvas);
}

.option-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.option-remove {
  min-height: 36px;
  min-width: 36px;
  padding: 0 10px;
}

/* === UI/UX Pro Max: Vector Icons & Cohesion === */
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; vertical-align: -4px; }

/* === UI/UX Pro Max: Accessible Focus States (WCAG 2.2) === */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
a.btn-primary:focus-visible,
a.btn-secondary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--canvas);
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
.fill-gap-input:focus-visible,
.option-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.dashboard-sidebar nav a:focus-visible,
.nav-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--rounded-sm);
}

.task-option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* === UI/UX Pro Max: Skeleton Loaders === */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-soft) 25%,
    var(--hairline) 50%,
    var(--surface-soft) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s infinite ease-in-out;
  border-radius: var(--rounded-xs);
  display: inline-block;
  pointer-events: none;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: var(--rounded-xs);
  display: block;
}

.skeleton-title {
  height: 22px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: var(--rounded-xs);
  display: block;
}

.skeleton-card {
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: var(--spacing-lg);
  background: var(--canvas);
}

.skeleton-circle {
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--surface-soft);
  }
}

/* === UI/UX Pro Max: Global Toast System === */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--on-primary);
  border-radius: var(--rounded-md);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 480;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-success {
  background: #15803d;
  color: #ffffff;
}

.toast-error {
  background: #b91c1c;
  color: #ffffff;
}

.toast-warning {
  background: #b45309;
  color: #ffffff;
}

.toast-info {
  background: var(--ink);
  color: var(--on-primary);
}

.toast-close {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  transition: opacity 0.15s;
}
.toast-close:hover {
  opacity: 1;
}

/* === UI/UX Pro Max: Smart Umlaut Bar === */
.umlaut-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-pill);
  padding: 4px 8px;
  margin-bottom: 8px;
  user-select: none;
  flex-wrap: wrap;
}

.umlaut-hint {
  font-size: 11px;
  font-weight: 540;
  opacity: 0.6;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.umlaut-btn {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 540;
  line-height: 1;
  padding: 5px 9px;
  border-radius: var(--rounded-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}

.umlaut-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.umlaut-divider {
  width: 1px;
  height: 16px;
  background: var(--hairline);
  margin: 0 2px;
}

/* === Students Master-Detail View === */
.students-master-detail {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: var(--spacing-lg);
  align-items: start;
  margin-top: var(--spacing-md);
}

@media (max-width: 991px) {
  .students-master-detail {
    grid-template-columns: 1fr;
  }
  .students-master-detail.mobile-detail-open .students-master-pane {
    display: none;
  }
  .students-master-detail:not(.mobile-detail-open) .students-detail-pane {
    display: none;
  }
  .students-master-detail.mobile-detail-open .mobile-back-btn {
    display: inline-flex !important;
  }
}

.token-quick-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--block-lilac);
  border: 1px solid var(--hairline);
  padding: 6px 14px;
  border-radius: var(--rounded-pill);
  font-size: 13px;
}
.token-quick-card code {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 7px;
  border-radius: 4px;
}
.token-quick-card button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
}

.students-master-pane {
  background: var(--surface-card, #fff);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.students-master-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.students-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.students-search-input {
  width: 100%;
  padding: 8px 30px 8px 32px;
  font-size: 13px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.students-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(46, 91, 255, 0.15);
}

.students-search-icon {
  position: absolute;
  left: 9px;
  opacity: 0.5;
  pointer-events: none;
}

.btn-clear-search {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  font-size: 13px;
  opacity: 0.5;
  cursor: pointer;
  padding: 2px 6px;
}
.btn-clear-search:hover { opacity: 0.9; }

.students-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--rounded-pill);
  border: 1px solid var(--hairline);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  transition: all 0.15s ease;
}
.filter-pill:hover {
  background: var(--surface-soft);
}
.filter-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.students-list-container {
  max-height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.student-item-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.student-item-card:hover {
  background: var(--surface-soft);
}
.student-item-card.is-active {
  background: var(--surface-soft);
  box-shadow: inset 4px 0 0 var(--primary);
}

.student-avatar-circle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  background: var(--block-cream);
  user-select: none;
}

.student-card-info {
  flex: 1;
  min-width: 0;
}
.student-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.student-card-sub {
  font-size: 12px;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.student-card-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.badge-mini {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--rounded-pill);
  font-weight: 500;
  line-height: 1.2;
}
.badge-mini.badge-success { background: #d4f7e2; color: #0b6b33; }
.badge-mini.badge-warning { background: #fff0d4; color: #8a4b08; }
.badge-mini.badge-danger  { background: #ffd8d8; color: #a31212; }
.badge-mini.badge-neutral { background: #fff; border: 1px solid var(--hairline); color: var(--ink); opacity: 0.8; }
.badge-mini.badge-pending { background: #ffe3e3; color: #c92a2a; font-weight: 600; }

.students-detail-pane {
  background: var(--surface-card, #fff);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.student-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--spacing-md);
}

.student-detail-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-large {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--block-lilac);
  color: var(--ink);
}

.contact-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: var(--rounded-pill);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.contact-pill:hover {
  background: var(--hairline);
}
.contact-pill.text-muted {
  opacity: 0.5;
}

.detail-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-control-card {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 16px;
  margin-bottom: var(--spacing-lg);
}

.quick-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.stats-quad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: var(--spacing-lg);
}
@media (max-width: 768px) {
  .stats-quad-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-quad-card {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 10px 12px;
}
.stat-quad-title {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 2px;
}
.stat-quad-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.section-block {
  margin-bottom: var(--spacing-lg);
}
.section-block-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hw-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hw-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  background: #fff;
  gap: 12px;
  flex-wrap: wrap;
}

.themes-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  background: #fff;
}
.theme-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

/* === Wort des Tages (Word of the Day) === */
.wort-des-tages-card {
  background: linear-gradient(135deg, var(--surface-card, #fff) 0%, rgba(246, 243, 238, 0.75) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 18px 22px;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.wdt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.wdt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.wdt-date {
  font-weight: 400;
  opacity: 0.6;
  font-size: 12px;
}

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

.wdt-word-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.wdt-article {
  font-size: 16px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--rounded-sm);
}
.wdt-article.wdt-masculine { background: #e0edff; color: #1557bf; }
.wdt-article.wdt-feminine  { background: #ffe4e6; color: #be123c; }
.wdt-article.wdt-neuter    { background: #dcfce7; color: #15803d; }
.wdt-article.wdt-verb      { background: #f3e8ff; color: #7e22ce; }

.wdt-word {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.wdt-ipa {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  opacity: 0.55;
  margin-left: 4px;
}

.wdt-meaning {
  font-size: 15px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.wdt-meaning strong {
  color: var(--ink);
}
.wdt-literal {
  opacity: 0.75;
  font-size: 14px;
  margin-left: 6px;
  font-style: italic;
}

.wdt-example-box {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--hairline-subtle);
  border-left: 3px solid var(--primary);
  border-radius: var(--rounded-md);
  padding: 10px 14px;
}
.wdt-example-de {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}
.wdt-example-ru {
  font-size: 13px;
  opacity: 0.65;
}

/* === Dropzone & Image Tools for Homework === */
.hw-dropzone {
  border: 2px dashed var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-soft);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hw-dropzone:hover, .hw-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(46, 91, 255, 0.04);
}
.hw-dropzone-icon {
  margin-bottom: 8px;
  color: var(--primary);
  display: inline-flex;
}
.hw-dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.hw-dropzone-hint {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 8px;
}
.hw-dropzone-tips {
  font-size: 12px;
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.03);
  padding: 4px 10px;
  border-radius: var(--rounded-pill);
  display: inline-block;
}

.hw-files-gallery {
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  padding: 14px;
  background: var(--surface-soft);
}
.hw-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}
.hw-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.hw-thumb-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.hw-thumb-img-wrap {
  width: 100%;
  height: 130px;
  position: relative;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hw-thumb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.hw-thumb-tools {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 2px 4px;
  border-radius: var(--rounded-sm);
  opacity: 0.9;
  transition: opacity 0.15s ease;
}
.hw-thumb-card:hover .hw-thumb-tools {
  opacity: 1;
}
.hw-thumb-card .hw-tool-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 3px;
}
.hw-thumb-card .hw-tool-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.hw-thumb-card .hw-tool-btn.hw-remove:hover {
  background: var(--accent-magenta);
}

.hw-thumb-pdf-wrap {
  width: 100%;
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: #ea580c;
  position: relative;
}
.hw-thumb-pdf-wrap .pdf-tag {
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}
.hw-thumb-pdf-wrap .hw-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.4);
}

.hw-thumb-meta {
  padding: 6px 8px;
  font-size: 11px;
}
.hw-thumb-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.hw-thumb-size {
  opacity: 0.55;
  font-size: 10px;
}

/* Modal lightbox for preview */
.hw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hw-modal-dialog {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #1e1e24;
  border-radius: var(--rounded-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.hw-modal-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  border-bottom: 1px solid #333;
}
.hw-modal-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hw-modal-body img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

/* === Lesson Countdown Chip & Widget === */
.lesson-countdown-card {
  background: var(--canvas);
  border: 1.5px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.lesson-countdown-card.is-live {
  border-color: var(--semantic-success);
  background: linear-gradient(135deg, rgba(30, 166, 74, 0.06) 0%, var(--canvas) 70%);
  box-shadow: 0 4px 18px rgba(30, 166, 74, 0.15);
}
.lesson-countdown-card.is-urgent {
  border-color: var(--accent-magenta);
  background: linear-gradient(135deg, rgba(255, 61, 139, 0.06) 0%, var(--canvas) 70%);
  box-shadow: 0 4px 18px rgba(255, 61, 139, 0.12);
}
.lesson-countdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.lesson-countdown-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
}
.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--semantic-success);
  box-shadow: 0 0 0 0 rgba(30, 166, 74, 0.7);
  animation: livePulse 2s infinite;
}
.pulse-indicator.urgent {
  background: var(--accent-magenta);
  box-shadow: 0 0 0 0 rgba(255, 61, 139, 0.7);
  animation: urgentPulse 1.5s infinite;
}
@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(30, 166, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(30, 166, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(30, 166, 74, 0); }
}
@keyframes urgentPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 61, 139, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 7px rgba(255, 61, 139, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 61, 139, 0); }
}
.lesson-countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--rounded-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
  white-space: nowrap;
}
.lesson-countdown-chip.chip-live {
  background: var(--semantic-success);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(30, 166, 74, 0.3);
}
.lesson-countdown-chip.chip-urgent {
  background: var(--accent-magenta);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(255, 61, 139, 0.3);
}
.lesson-countdown-chip.chip-today {
  background: var(--block-lilac);
  color: #2c2243;
  border: 1px solid rgba(44, 34, 67, 0.12);
}
.lesson-countdown-chip.chip-tomorrow {
  background: var(--block-cream);
  color: #4a3b1a;
  border: 1px solid rgba(74, 59, 26, 0.12);
}
.lesson-countdown-chip.chip-future {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.lesson-countdown-body {
  margin-bottom: 8px;
}
.lesson-countdown-theme {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 4px;
}
.lesson-countdown-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  opacity: 0.85;
}
.lesson-countdown-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline-soft);
}
.btn-countdown-join {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  text-decoration: none;
}



