:root {
  --bg-deep-1: #07142b;
  --bg-deep-2: #0d2552;
  --bg-deep-3: #103b7a;
  --glass-bg: rgba(255, 255, 255, 0.11);
  --glass-bg-hover: rgba(255, 255, 255, 0.17);
  --glass-border: rgba(255, 255, 255, 0.24);
  --glass-border-strong: rgba(255, 255, 255, 0.38);
  --text-main: #f8fbff;
  --text-soft: rgba(232, 243, 255, 0.84);
  --text-muted: rgba(210, 229, 252, 0.68);
  --accent: #38bdf8;
  --accent-2: #60a5fa;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-glass: 0 18px 46px rgba(3, 12, 34, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --shadow-hover: 0 26px 56px rgba(2, 10, 30, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep-1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-deep-1) 0%, var(--bg-deep-2) 48%, var(--bg-deep-3) 100%);
  min-height: 100vh;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-text {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.02em;
}

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

a, button, input, select, label {
  -webkit-tap-highlight-color: transparent;
}

/* Deep airy gradient orbs */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.55;
}

.orb-1 {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, #38bdf8 0%, rgba(37, 99, 235, 0) 70%);
  top: -160px;
  left: -120px;
}

.orb-2 {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #3b82f6 0%, rgba(29, 78, 216, 0) 70%);
  bottom: -220px;
  right: -140px;
}

.orb-3 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #22d3ee 0%, rgba(14, 165, 233, 0) 72%);
  top: 38%;
  left: 52%;
  opacity: 0.34;
}

/* Core Glassmorphism surfaces */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.glass-soft {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Top Navigation */
.top-nav-wrap {
  position: sticky;
  top: 16px;
  z-index: 40;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 14px;
  row-gap: 0;
  padding: 11px 18px;
  border-radius: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
}

.brand-badge svg {
  width: 36px;
  height: 36px;
}

.brand-text {
  font-size: 1.08rem;
  font-weight: 800;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.nav-link {
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.nav-link:active {
  background: rgba(56, 189, 248, 0.24);
  color: #ffffff;
  border-radius: 12px;
}

.nav-link:focus,
.menu-toggle:focus,
.brand:focus {
  outline: none;
}

.nav-link:focus-visible,
.menu-toggle:focus-visible,
.brand:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 12px;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.menu-toggle:active {
  transform: scale(0.94);
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, width 0.25s ease;
}

.top-nav.open .menu-toggle {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(125, 211, 252, 0.65);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.32);
}

.top-nav.open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.top-nav.open .menu-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.top-nav.open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mob-ic {
  display: none;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(3, 10, 26, 0.56);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.hero-title-nowrap {
  white-space: nowrap;
}

.hero-mob-br {
  display: inline;
}

/* Main container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

/* Hero */
.hero {
  border-radius: var(--radius-xl);
  padding: 48px 46px;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 54px;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill-tag {
  display: inline-block;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.38);
  color: #e0f2fe;
  font-size: 0.88rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: #bae6fd;
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 1.08rem;
  color: var(--text-soft);
  max-width: 58ch;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Tactile 3D Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 16px;
  font-size: 1.03rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-glass {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(3, 12, 34, 0.24);
}

.btn-glass:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.21);
}

/* Hero Progress Box */
.hero-status {
  border-radius: var(--radius-lg);
  padding: 28px;
}

.status-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.status-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
}

.status-count {
  font-weight: 700;
  color: #7dd3fc;
  font-size: 1rem;
}

.progress-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.26);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.status-hint {
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* Roadmap section */
.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.section-head p {
  font-size: 1.05rem;
  color: var(--text-soft);
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.step-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.32s ease,
              border-color 0.32s ease,
              box-shadow 0.32s ease;
}

.step-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 48%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

.step-card:hover {
  transform: translateY(-10px) scale(1.01);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-hover);
}

.step-card:hover::after {
  opacity: 1;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Juicy 3D-styled Icon Tiles */
.icon-3d {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(3, 12, 34, 0.35),
              inset 0 2px 2px rgba(255, 255, 255, 0.5),
              inset 0 -4px 8px rgba(0, 0, 0, 0.22);
}

.icon-3d svg {
  width: 38px;
  height: 38px;
}

.icon-sky    { background: linear-gradient(145deg, #38bdf8, #0284c7); }
.icon-blue   { background: linear-gradient(145deg, #60a5fa, #1d4ed8); }
.icon-cyan   { background: linear-gradient(145deg, #22d3ee, #0891b2); }
.icon-indigo { background: linear-gradient(145deg, #818cf8, #4338ca); }
.icon-teal   { background: linear-gradient(145deg, #2dd4bf, #0f766e); }
.icon-violet { background: linear-gradient(145deg, #a78bfa, #6d28d9); }

.step-badge {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.9rem;
  font-weight: 700;
  color: #e0f2fe;
}

.step-card h3 {
  font-size: 1.42rem;
  font-weight: 800;
}

.step-card p {
  font-size: 1rem;
  color: var(--text-soft);
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.card-go {
  font-weight: 700;
  font-size: 0.98rem;
  color: #7dd3fc;
}

.done-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Shared components for inner pages (lessons, quizzes, help, groups, templates, teacher) */
.page-hero {
  border-radius: var(--radius-xl);
  padding: 38px 42px;
  margin-bottom: 30px;
}

.page-hero h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 900;
  margin-bottom: 10px;
}

.page-hero p {
  font-size: 1.08rem;
  color: var(--text-soft);
  max-width: 66ch;
}

.content-stack {
  display: grid;
  gap: 24px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 32px 34px;
}

.panel h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 16px;
}

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

.memo-step {
  border-radius: var(--radius-md);
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.memo-num {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.98rem;
}

.memo-step strong {
  display: block;
  font-size: 1.03rem;
  margin-bottom: 4px;
}

.memo-step span {
  font-size: 0.96rem;
  color: var(--text-soft);
}

/* Interactive Quiz */
.quiz-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 18px;
}

.quiz-bar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.quiz-counter {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.96rem;
  color: #7dd3fc;
}

.quiz-passed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  font-size: 0.82rem;
  font-weight: 700;
}

.quiz-shuffle-note {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.quiz-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.3s ease;
}

.quiz-item {
  border-radius: var(--radius-md);
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid rgba(125, 211, 252, 0.35);
  border-right: 4px solid rgba(125, 211, 252, 0.35);
  margin-bottom: 18px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.quiz-item.answered {
  border-left-color: #38bdf8;
  border-right-color: #38bdf8;
  background: rgba(56, 189, 248, 0.09);
}

.quiz-item.quiz-unanswered {
  border-color: rgba(251, 191, 36, 0.65);
  border-left-color: #fbbf24;
  border-right-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.quiz-item.q-correct {
  border-color: rgba(52, 211, 153, 0.55);
  border-left-color: #34d399;
  border-right-color: #34d399;
  background: rgba(52, 211, 153, 0.09);
}

.quiz-item.q-wrong {
  border-color: rgba(251, 113, 133, 0.55);
  border-left-color: #fb7185;
  border-right-color: #fb7185;
  background: rgba(251, 113, 133, 0.09);
}

.quiz-q {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.opt-letter {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: #e0f2fe;
}

.quiz-opt:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(4px);
}

.quiz-opt:disabled {
  cursor: default;
}

.quiz-opt.selected {
  background: rgba(56, 189, 248, 0.26);
  border-color: #38bdf8;
}

.quiz-opt.selected .opt-letter {
  background: #38bdf8;
  color: #082f49;
}

.quiz-opt.correct {
  background: rgba(52, 211, 153, 0.26);
  border-color: var(--ok);
}

.quiz-opt.correct .opt-letter {
  background: var(--ok);
  color: #064e3b;
}

.quiz-opt.wrong {
  background: rgba(251, 113, 133, 0.26);
  border-color: var(--err);
}

.quiz-opt.wrong .opt-letter {
  background: var(--err);
  color: #4c0519;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.quiz-result {
  margin-top: 18px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.04rem;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.4);
}

.quiz-result-ok {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.55);
  color: #ecfdf5;
}

.quiz-result-warn {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.52);
  color: #fef3c7;
}

/* Search bar & cards for Help / Groups / Templates / Teacher */
.search-input {
  width: 100%;
  padding: 15px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.15);
}

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

.role-card, .dl-card {
  border-radius: var(--radius-lg);
  padding: 26px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.28s ease, background 0.28s ease, border-color 0.28s ease;
}

.role-card:hover, .dl-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
}

.role-card h3, .dl-card h3 {
  font-size: 1.24rem;
}

.role-card p, .dl-card p {
  color: var(--text-soft);
  font-size: 0.98rem;
  flex: 1;
}

.law-banner {
  border-radius: var(--radius-md);
  padding: 22px 26px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.36);
  border-left: 4px solid #fbbf24;
  border-right: 4px solid #fbbf24;
  color: #fef9c3;
}

@media (max-width: 820px) {
  .cards-2 {
    grid-template-columns: 1fr;
  }
}

/* Lesson bottom navigation */
.lesson-pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Interactive Demo / Before-After & Inner Components */
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(37, 99, 235, 0.45));
  border-color: rgba(125, 211, 252, 0.65);
  color: #ffffff;
}

.doc-preview {
  border-radius: var(--radius-md);
  padding: 24px 26px;
  background: rgba(248, 251, 255, 0.95);
  color: #0f172a;
  box-shadow: 0 14px 32px rgba(2, 10, 30, 0.35);
  font-size: 1rem;
  line-height: 1.65;
}

.doc-preview .pilcrow {
  color: #2563eb;
  font-weight: 700;
  opacity: 0.9;
}

.doc-preview .sp {
  color: #2563eb;
  font-weight: 700;
  opacity: 0.55;
  padding: 0 1px;
}

.doc-preview .bad-mark {
  background: rgba(251, 113, 133, 0.24);
  border-radius: 4px;
  padding: 0 3px;
  color: #be123c;
  font-weight: 700;
}

.doc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.blue { background: #38bdf8; }
.legend-dot.red  { background: #fb7185; }

.font-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.font-card {
  border-radius: var(--radius-md);
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  box-shadow: 0 12px 26px rgba(2, 10, 30, 0.28);
}

.font-card .font-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  margin-bottom: 10px;
  font-family: 'Inter', sans-serif;
}

.font-serif { font-family: 'Times New Roman', Georgia, serif; }
.font-sans  { font-family: 'Inter', Arial, sans-serif; }
.font-mono  { font-family: 'Courier New', Consolas, monospace; font-size: 0.94rem; }

.task-box {
  border-radius: var(--radius-md);
  padding: 24px 26px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-left: 4px solid #38bdf8;
  border-right: 4px solid #38bdf8;
}

.task-box h3 {
  font-size: 1.18rem;
  margin-bottom: 10px;
}

.task-box p {
  color: var(--text-soft);
  font-size: 1.01rem;
}

.task-steps {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.98rem;
  color: var(--text-main);
}

.task-row-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.32);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.86rem;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.tip-banner {
  border-radius: var(--radius-md);
  padding: 18px 22px;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.34);
  border-left: 4px solid #34d399;
  border-right: 4px solid #34d399;
  color: #ecfdf5;
  font-size: 0.98rem;
}

/* Accordion for Спасательный круг */
.accordion {
  display: grid;
  gap: 14px;
}

.acc-item {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.acc-btn {
  width: 100%;
  text-align: left;
  padding: 20px 24px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.acc-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.acc-item.open .acc-icon {
  transform: rotate(45deg);
}

.acc-body {
  display: none;
  padding: 0 24px 22px;
  color: var(--text-soft);
  font-size: 0.99rem;
  line-height: 2.05;
}

.acc-item.open .acc-body {
  display: block;
}

/* Interactive checklist for Для групп */
.check-grid {
  display: grid;
  gap: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.check-item:hover {
  background: rgba(255, 255, 255, 0.14);
}

.check-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #38bdf8;
  cursor: pointer;
  flex-shrink: 0;
}

.check-item.checked {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
}

/* Upgraded Vibrant Glass Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(7, 20, 43, 0.28);
  box-shadow: 0 12px 30px rgba(3, 12, 34, 0.26);
}

.glass-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.glass-table th,
.glass-table td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
}

.glass-table thead th {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(37, 99, 235, 0.28));
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #e0f2fe;
  border-bottom: 2px solid rgba(125, 211, 252, 0.35);
}

.glass-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.glass-table tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
}

.glass-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.13);
}

.glass-table tbody tr:last-child td {
  border-bottom: none;
}

.glass-table td {
  color: var(--text-soft);
}

.tbl-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: 1px solid rgba(186, 230, 253, 0.45);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.38);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.94rem;
  color: #ffffff;
}

.tbl-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.36);
  color: #e0f2fe;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.tbl-tag-ok {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.48);
  color: #a7f3d0;
}

.tbl-tag-info {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(125, 211, 252, 0.48);
  color: #bae6fd;
}

.tbl-tag-warn {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.48);
  color: #fde68a;
}

.tbl-tag-err {
  background: rgba(251, 113, 133, 0.2);
  border-color: rgba(251, 113, 133, 0.48);
  color: #fecdd3;
}

/* Footer */
.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px 38px;
}

.footer-bar {
  border-radius: 18px;
  padding: 18px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.45;
}

.footer-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.24);
}

.reset-progress-btn {
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.reset-progress-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

@media (max-width: 1080px) {
  .footer-sep {
    display: none;
  }
}

@media (max-width: 820px) {
  .font-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 34px 28px;
  }
  .roadmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .memo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .menu-toggle {
    display: flex;
  }
  .top-nav {
    flex-wrap: wrap;
    row-gap: 0;
    column-gap: 12px;
    padding: 10px 14px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  }
  .top-nav.open {
    background: rgba(11, 28, 62, 0.92);
    border-color: rgba(125, 211, 252, 0.42);
    box-shadow: 0 26px 60px rgba(2, 8, 24, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  }
  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    column-gap: 10px;
    row-gap: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border-top: 0 solid transparent;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.24s ease,
                transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                margin-top 0.28s ease,
                padding-top 0.28s ease,
                padding-bottom 0.28s ease,
                row-gap 0.28s ease,
                border-color 0.28s ease;
  }
  .top-nav.open .nav-links {
    display: grid;
    row-gap: 10px;
    max-height: 520px;
    opacity: 1;
    margin-top: 12px;
    padding-top: 14px;
    padding-bottom: 4px;
    border-top: 1px solid rgba(125, 211, 252, 0.22);
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-links .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.2s ease, box-shadow 0.22s ease;
  }
  .nav-links .nav-link:active {
    transform: scale(0.96);
    border-radius: 16px;
  }
  .nav-links .nav-link.active {
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.36));
    border-color: rgba(125, 211, 252, 0.62);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  }
  .nav-mob-ic {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #7dd3fc;
    flex-shrink: 0;
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  }
  .nav-links .nav-link.active .nav-mob-ic {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    border-color: rgba(224, 247, 255, 0.55);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.42);
  }
  .nav-mob-ic svg {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 680px) {
  .roadmap-grid {
    grid-template-columns: 1fr;
  }
  .panel, .page-hero {
    padding: 24px 20px;
  }
}


/* ==========================================================================
   V2 UPGRADES: Search UX, Time Badges, Auth Modal, 6-Type Quizzes,
   DOCX Checker, Locked Teacher Cabinet & Symmetric Callouts
   ========================================================================== */

/* Expressive High-Contrast Time Badges (replaces cramped 8м) */
.time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 7px 13px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #1d4ed8);
  border: 1px solid rgba(186, 230, 253, 0.55);
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.38);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Symmetric quote box inside white doc preview */
.doc-quote {
  padding: 12px 16px;
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border-right: 4px solid #2563eb;
  border-radius: 8px;
  font-size: 0.94rem;
}

/* Upgraded Search Box (Help page) */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.search-box .search-input {
  margin-bottom: 0;
  padding: 16px 52px 16px 48px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 10px 26px rgba(3, 12, 34, 0.24);
}

.search-box .search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: #7dd3fc;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.search-clear[hidden] {
  display: none;
}

.search-clear:hover {
  background: rgba(251, 113, 133, 0.34);
  border-color: rgba(251, 113, 133, 0.72);
  transform: scale(1.06);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.36), rgba(37, 99, 235, 0.48));
  border-color: rgba(125, 211, 252, 0.7);
  color: #ffffff;
}

.search-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

mark.hl {
  background: rgba(56, 189, 248, 0.38);
  color: #ffffff;
  padding: 0 3px;
  border-radius: 4px;
}

/* Navbar Auth Pill & Modal */
.nav-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(37, 99, 235, 0.32));
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-auth-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.38), rgba(37, 99, 235, 0.48));
  transform: translateY(-1px);
}

.nav-auth-btn.logged-in {
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.52);
  color: #ecfdf5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 12, 28, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 470px;
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  background: linear-gradient(145deg, rgba(16, 40, 82, 0.96), rgba(9, 24, 54, 0.96));
  border: 1px solid rgba(125, 211, 252, 0.35);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: rgba(251, 113, 133, 0.3);
}

.form-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 18px;
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-input:focus {
  border-color: #38bdf8;
  background-color: rgba(255, 255, 255, 0.14);
}

.form-input option {
  background: #0d2552;
  color: #ffffff;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.45;
}

.form-error {
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(251, 113, 133, 0.2);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #ffe4e6;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.form-ok {
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #ecfdf5;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
}

/* Diverse Interactive Quiz Widgets */
.q-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.q-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.36);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.q-status-tag {
  font-size: 0.84rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.q-status-ok {
  background: rgba(52, 211, 153, 0.22);
  color: #a7f3d0;
}

.q-status-err {
  background: rgba(251, 113, 133, 0.22);
  color: #fecdd3;
}

.q-explain {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid #38bdf8;
  border-right: 3px solid #38bdf8;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* Multi-select checkbox mark */
.opt-check {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: transparent;
  transition: all 0.2s ease;
}

.quiz-opt.selected .opt-check {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #082f49;
}

/* Order / Sequence Widget */
.order-list {
  display: grid;
  gap: 10px;
}

.order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.order-pos {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.order-text {
  flex: 1;
  font-size: 0.96rem;
}

.order-controls {
  display: flex;
  gap: 6px;
}

.order-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.order-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.34);
  border-color: #38bdf8;
}

.order-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Match Pairs Widget */
.match-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.match-col {
  display: grid;
  gap: 10px;
  align-content: start;
}

.match-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.match-card:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.match-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.26);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.match-badge {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #e0f2fe;
}

.match-p0 { border-color: rgba(56, 189, 248, 0.72); background: rgba(56, 189, 248, 0.18); }
.match-p0 .match-badge { background: #38bdf8; color: #082f49; }
.match-p1 { border-color: rgba(52, 211, 153, 0.72); background: rgba(52, 211, 153, 0.18); }
.match-p1 .match-badge { background: #34d399; color: #064e3b; }
.match-p2 { border-color: rgba(251, 191, 36, 0.72); background: rgba(251, 191, 36, 0.18); }
.match-p2 .match-badge { background: #fbbf24; color: #451a03; }
.match-p3 { border-color: rgba(192, 132, 252, 0.72); background: rgba(192, 132, 252, 0.18); }
.match-p3 .match-badge { background: #c084fc; color: #3b0764; }

/* Spot-the-Error Pilcrow Clicker Widget */
.spot-box {
  background: rgba(248, 251, 255, 0.96);
  color: #0f172a;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 8px;
  font-size: 1.06rem;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(2, 10, 30, 0.25);
}

.spot-tok {
  border: 1px solid transparent;
  background: transparent;
  color: #0f172a;
  font-family: inherit;
  font-size: 1.04rem;
  padding: 4px 3px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.spot-tok.is-sp {
  color: #2563eb;
  font-weight: 800;
  padding: 4px 6px;
  background: rgba(37, 99, 235, 0.08);
  margin: 0 1px;
}

.spot-tok:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.26);
  border-color: #0284c7;
}

.spot-tok.selected {
  background: rgba(244, 63, 94, 0.22);
  border-color: #e11d48;
  color: #9f1239;
  font-weight: 800;
}

.spot-meta {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Classify Two-Group Widget */
.classify-list {
  display: grid;
  gap: 10px;
}

.classify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.classify-text {
  flex: 1 1 260px;
  font-size: 0.96rem;
}

.classify-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.classify-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.classify-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.classify-btn.selected {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: #7dd3fc;
  color: #ffffff;
}

/* DOCX Checker Dropzone & Report */
.dropzone {
  border: 2px dashed rgba(125, 211, 252, 0.5);
  border-radius: var(--radius-lg);
  padding: 40px 26px;
  text-align: center;
  background: rgba(56, 189, 248, 0.08);
  transition: all 0.22s ease;
  cursor: pointer;
}

.dropzone.dragover, .dropzone:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
}

.score-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-left: 4px solid #38bdf8;
  border-right: 4px solid #38bdf8;
  margin-bottom: 20px;
}

.score-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 3px solid rgba(186, 230, 253, 0.7);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.42);
}

.score-circle.level-ok   { background: linear-gradient(135deg, #059669, #10b981); border-color: #a7f3d0; }
.score-circle.level-warn { background: linear-gradient(135deg, #d97706, #f59e0b); border-color: #fde68a; }
.score-circle.level-err  { background: linear-gradient(135deg, #e11d48, #f43f5e); border-color: #fecdd3; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.kpi-val {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.55rem;
  color: #7dd3fc;
}

.kpi-lbl {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.diag-card {
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.diag-card.diag-err  { border-left: 4px solid #fb7185; border-right: 4px solid #fb7185; background: rgba(251, 113, 133, 0.12); }
.diag-card.diag-warn { border-left: 4px solid #fbbf24; border-right: 4px solid #fbbf24; background: rgba(251, 191, 36, 0.12); }
.diag-card.diag-ok   { border-left: 4px solid #34d399; border-right: 4px solid #34d399; background: rgba(52, 211, 153, 0.11); }

.diag-examples {
  margin-top: 8px;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* Teacher Gate & Tabs */
.gate-wrap {
  max-width: 500px;
  margin: 24px auto;
}

.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.answer-key-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid #38bdf8;
  border-right: 4px solid #38bdf8;
  margin-bottom: 14px;
}

.student-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-left: 4px solid #38bdf8;
  border-right: 4px solid #38bdf8;
  margin-bottom: 18px;
  font-size: 0.94rem;
}

@media (max-width: 820px) {
  .match-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ==========================================================================
   V3 POLISH: Editorial Brand Mark, Unified Tabs, Custom Select Arrow,
   Calm Match & Compact Classify, Help Keycaps, Clean FRP Table,
   Teacher Navbar Controls & Full Smartphone Responsiveness
   ========================================================================== */

/* 18. Refined Editorial Brand Mark in Header (cohesive with footer slash style) */
.brand {
  gap: 11px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-slash {
  color: rgba(125, 211, 252, 0.55);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand-num {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 55%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

/* 10. Teacher Navbar Logout Control */
.nav-teacher-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid rgba(251, 113, 133, 0.48);
  background: rgba(251, 113, 133, 0.16);
  color: #ffe4e6;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-logout-btn:hover {
  background: rgba(251, 113, 133, 0.3);
  border-color: rgba(251, 113, 133, 0.75);
  color: #ffffff;
}

/* 7. Unified Segmented Register / Login Toggle */
.segmented-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: 16px 0 18px;
  gap: 4px;
}

.segmented-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segmented-btn:hover {
  color: #ffffff;
}

.segmented-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* 9. Custom Select Arrow with Clean Right Padding (zero duplicate native arrow) */
select.form-input {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23bae6fd' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
}

select.form-input::-ms-expand {
  display: none;
}

/* Prevent CSS Grid children (tables/previews) from overflowing mobile viewports */
.content-stack > *,
.panel,
.table-wrap,
.doc-preview,
.memo-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* 4. Compact Segmented Switch for Classify Quiz */
.classify-btns {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 12px;
  background: rgba(7, 20, 43, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.18);
  gap: 3px;
  flex-shrink: 0;
}

.classify-btn {
  padding: 8px 14px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.classify-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.classify-btn.selected {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.38);
}

/* 5. Color-Coded Match Pairs with Fixed А/Б/В/Г Badges */
.match-card.left-fixed .match-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #e0f2fe;
}

.match-card.pair-0 {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(56, 189, 248, 0.16);
}
.match-card.pair-0 .match-badge {
  background: #38bdf8;
  border-color: #7dd3fc;
  color: #082f49;
}

.match-card.pair-1 {
  border-color: rgba(52, 211, 153, 0.72);
  background: rgba(52, 211, 153, 0.16);
}
.match-card.pair-1 .match-badge {
  background: #34d399;
  border-color: #6ee7b7;
  color: #064e3b;
}

.match-card.pair-2 {
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(251, 191, 36, 0.16);
}
.match-card.pair-2 .match-badge {
  background: #fbbf24;
  border-color: #fde68a;
  color: #451a03;
}

.match-card.pair-3 {
  border-color: rgba(192, 132, 252, 0.72);
  background: rgba(192, 132, 252, 0.16);
}
.match-card.pair-3 .match-badge {
  background: #c084fc;
  border-color: #e9d5ff;
  color: #3b0764;
}

.match-card.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.55);
}

.match-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Teacher Answer Keys: Numbered Clean List (no colliding bullet dots) */
.key-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.key-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.94rem;
}

.key-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(52, 211, 153, 0.24);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
}

.key-err-tok {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 6px;
  border-radius: 6px;
  background: rgba(251, 113, 133, 0.22);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #fecdd3;
  font-family: 'Montserrat', monospace;
  font-weight: 700;
  font-size: 0.85rem;
}

/* 15. Highlighted Hints, Keycaps & Commands in Спасательный круг */
kbd {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 2px;
  line-height: 1.25;
  vertical-align: baseline;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(186, 230, 253, 0.45);
  box-shadow: 0 2px 0 rgba(2, 10, 30, 0.45);
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.84em;
  color: #ffffff;
}

.help-cmd {
  display: inline-block;
  padding: 2px 9px;
  margin: 2px 2px;
  line-height: 1.25;
  vertical-align: baseline;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(125, 211, 252, 0.4);
  color: #e0f2fe;
  font-weight: 700;
  font-size: 0.9em;
}

.help-key-tip {
  margin-top: 14px;
  padding: 11px 15px;
  line-height: 1.55;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.13);
  border-left: 3px solid #34d399;
  border-right: 3px solid #34d399;
  color: #ecfdf5;
  font-size: 0.92rem;
}

/* 17. Clean Editorial FRP Table Columns (crisp typography, no box clutter) */
.frp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 11px;
  border-left: 3px solid rgba(56, 189, 248, 0.65);
}

.frp-cell.frp-ok {
  border-left-color: #34d399;
}

.frp-main {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.94rem;
  color: #f8fbff;
  letter-spacing: 0.01em;
}

.frp-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.34);
  color: #e0f2fe;
  font-family: 'Montserrat', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 12. Teacher Cabinet Advanced Filter Toolbar & Summary Strip */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 16px;
}

.filter-bar .form-field {
  margin-bottom: 0;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(56, 189, 248, 0.11);
  border-left: 3px solid #38bdf8;
  border-right: 3px solid #38bdf8;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* 13. Teacher-only Methodological Block Styling */
.teacher-only-panel {
  border-left: 4px solid #fbbf24 !important;
  border-right: 4px solid #fbbf24 !important;
  background: rgba(251, 191, 36, 0.08) !important;
}

.teacher-only-panel[hidden],
[data-teacher-only][hidden] {
  display: none !important;
}

/* Modal scrollable safety on small phones */
.modal-card {
  max-height: 92vh;
  overflow-y: auto;
}

/* 11. Full Smartphone & Small Tablet Responsiveness */
@media (max-width: 960px) {
  .nav-teacher-group {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    flex-direction: column;
  }
  .nav-links .nav-auth-btn,
  .nav-links .nav-logout-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.92rem;
  }
  .footer-bar {
    justify-content: center;
    text-align: center;
    padding: 16px 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .hero-mob-br {
    display: block;
    height: 0;
  }
  .hero h1 {
    font-size: 1.95rem;
    line-height: 1.18;
  }
  .container {
    padding: 20px 14px 44px;
  }
  .top-nav-wrap {
    top: 8px;
    padding: 0 12px;
  }
  .hero {
    padding: 26px 20px;
    gap: 22px;
    margin-bottom: 32px;
  }
  .hero h1 {
    font-size: 1.85rem;
  }
  .page-hero {
    padding: 24px 18px;
  }
  .page-hero h1 {
    font-size: 1.65rem;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .panel {
    padding: 20px 16px;
  }
  .quiz-item {
    padding: 16px 14px;
  }
  .quiz-opt {
    padding: 11px 12px;
    font-size: 0.92rem;
  }
  .classify-row {
    flex-direction: column;
    align-items: stretch;
  }
  .classify-text {
    flex: 0 0 auto;
    width: 100%;
  }
  .classify-btns {
    width: 100%;
  }
  .order-row {
    padding: 10px 12px;
    gap: 8px;
  }
  .order-text {
    font-size: 0.9rem;
  }
  .spot-box {
    padding: 14px 12px;
    font-size: 0.96rem;
  }
  .spot-tok {
    padding: 6px 4px;
    font-size: 0.96rem;
  }
  .score-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi-val {
    font-size: 1.3rem;
  }
  .glass-table th,
  .glass-table td {
    padding: 11px 12px;
    font-size: 0.88rem;
  }
  .memo-step {
    flex-direction: column;
    gap: 10px;
  }
  .modal-card {
    padding: 22px 18px;
  }
  .dash-tabs .tab-btn {
    flex: 1 1 46%;
    text-align: center;
    padding: 9px 10px;
    font-size: 0.86rem;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   V8 UPGRADES: Seamless Zero-Flash Cross-Document @view-transition,
   Glass Card Sheen, Reading Progress Bar & Ambient Motion
   ========================================================================== */

@view-transition {
  navigation: auto;
}

::view-transition {
  background-color: var(--bg-deep-1);
}

::view-transition-group(root) {
  animation-duration: 260ms;
}

::view-transition-old(root) {
  animation: 260ms linear both vtHoldOld;
  mix-blend-mode: normal;
  z-index: 1;
}

::view-transition-new(root) {
  animation: 260ms cubic-bezier(0.22, 1, 0.36, 1) both vtRevealNew;
  mix-blend-mode: normal;
  z-index: 2;
}

@keyframes vtHoldOld {
  from { opacity: 1; }
  to { opacity: 1; }
}

@keyframes vtRevealNew {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal.reveal-instant {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

main.container {
  transition: opacity 0.22s ease;
}

body.page-leaving main.container {
  opacity: 0;
}

.view-fade-in {
  animation: viewFadeIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-pane-enter {
  animation: tabPaneEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tabPaneEnter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.acc-item.open .acc-body,
[data-demo-pane]:not([hidden]) {
  animation: tabPaneEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Delayed unobtrusive loader for teacher session check (zero login flash) */
.teacher-boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--text-soft);
  font-size: 0.96rem;
  font-weight: 500;
  opacity: 0;
  animation: bootDelayShow 0.24s ease 0.16s forwards;
}

.teacher-boot[hidden] {
  display: none !important;
}

.boot-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(125, 211, 252, 0.22);
  border-top-color: #38bdf8;
  animation: spin360 0.75s linear infinite;
}

@keyframes bootDelayShow {
  to { opacity: 1; }
}

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

/* Top Neon Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 160;
  pointer-events: none;
  background: transparent;
}

.reading-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #22d3ee 0%, #38bdf8 55%, #3b82f6 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.85), 0 0 4px rgba(224, 247, 255, 0.7);
  transition: transform 0.08s linear;
}

/* Ambient living orbs */
.orb-1 {
  animation: orbDrift1 22s ease-in-out infinite alternate;
}

.orb-2 {
  animation: orbDrift2 26s ease-in-out infinite alternate;
}

.orb-3 {
  animation: orbDrift3 19s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(38px, 28px, 0) scale(1.08); }
}

@keyframes orbDrift2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-44px, -30px, 0) scale(1.07); }
}

@keyframes orbDrift3 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-26px, 34px, 0) scale(1.12); }
}

/* Brand badge neon hover polish */
.brand-badge {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}

.brand:hover .brand-badge {
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.55), 0 0 14px rgba(56, 189, 248, 0.35);
}

/* Primary button light-sweep hover shimmer */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -75%;
  width: 52%;
  height: 140%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 130%;
}

/* Interactive Glass Spotlight Sheen on cards */
.step-card,
.dl-card,
.role-card,
.kpi-card,
.err404-card,
.memo-step {
  position: relative;
  overflow: hidden;
}

.step-card::before,
.dl-card::before,
.role-card::before,
.kpi-card::before,
.err404-card::before,
.memo-step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(125, 211, 252, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  z-index: 0;
}

.step-card:hover::before,
.dl-card:hover::before,
.role-card:hover::before,
.kpi-card:hover::before,
.err404-card:hover::before,
.memo-step:hover::before {
  opacity: 1;
}

.step-card > *,
.dl-card > *,
.role-card > *,
.kpi-card > *,
.err404-card > *,
.memo-step > * {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Clean High-Contrast Print & Save-to-PDF Mode for Teacher Cabinet */
@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10pt !important;
    line-height: 1.4 !important;
  }
  .bg-scene,
  .top-nav-wrap,
  .site-footer,
  .dash-tabs,
  .filter-bar,
  .filter-chips,
  .btn,
  .order-btn,
  .nav-logout-btn,
  .page-hero .meta-chips,
  #passChangeForm,
  .reading-progress,
  .mobile-nav-backdrop,
  .teacher-boot {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .page-hero,
  .panel,
  .glass,
  .glass-soft,
  .kpi-card,
  .answer-key-card,
  .memo-step,
  .diag-card,
  .summary-strip,
  .tip-banner,
  .law-banner {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
    break-inside: avoid;
  }
  .page-hero h1,
  .panel h2,
  .panel h3,
  strong,
  .frp-main,
  .kpi-val {
    color: #0f172a !important;
  }
  .page-hero p,
  .kpi-lbl,
  .frp-sub,
  .memo-step span,
  .summary-strip,
  .glass-table td,
  .key-row {
    color: #334155 !important;
  }
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    margin: 10px 0 14px !important;
  }
  .table-wrap {
    border: 1px solid #94a3b8 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    width: 100% !important;
  }
  .glass-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
  }
  .no-print {
    display: none !important;
  }
  .glass-table thead th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #64748b !important;
    padding: 8px 10px !important;
  }
  .glass-table td {
    padding: 8px 10px !important;
    border-bottom: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
  }
  .glass-table td span {
    color: #334155 !important;
  }
  .glass-table tr {
    break-inside: avoid;
  }
  .tbl-num,
  .glass-table td .tbl-num {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border: none !important;
    width: 26px !important;
    height: 26px !important;
    font-size: 9pt !important;
  }
  .time-badge {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 4px 10px !important;
    font-size: 9pt !important;
  }
  .tbl-tag,
  .code-chip,
  .q-type-tag,
  .key-num {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
  }
  .key-err-tok {
    background: #ffe4e6 !important;
    color: #9f1239 !important;
    border: 1px solid #fb7185 !important;
  }
  .frp-cell {
    border-left: 3px solid #1d4ed8 !important;
  }
  .frp-cell.frp-ok {
    border-left-color: #059669 !important;
  }
}
