:root {
  color-scheme: light;
  --ink: #101318;
  --muted: #67707c;
  --line: #e7e9ed;
  --surface: #ffffff;
  --soft: #f5f6f8;
  --accent: #2364d2;
  --accent-dark: #164eae;
  --danger: #b42318;
  --success: #146c43;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: #f8f9fb; color: var(--ink); }

body { margin: 0; min-height: 100vh; }

button, input { font: inherit; }

a { color: inherit; }

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

.student-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.student-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 760;
  letter-spacing: -.03em;
  text-decoration: none;
  font-size: 1.1rem;
}

.student-wordmark img { width: 32px; height: 32px; }

.student-preview-back {
  color: var(--accent);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.student-preview-banner {
  margin-bottom: 34px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #b8cae8;
  border-radius: 14px;
  background: #edf4ff;
  color: var(--accent-dark);
}

.student-preview-banner > div { display: grid; gap: 3px; }
.student-preview-banner span { color: var(--muted); font-size: .86rem; }
.preview-variant-switcher { display: flex; gap: 6px; }
.preview-variant-switcher a { padding: 8px 11px; border-radius: 9px; text-decoration: none; font-size: .86rem; font-weight: 700; }
.preview-variant-switcher a[aria-current="page"] { background: var(--accent); color: white; }

.student-logout button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 0 10px 16px;
}

.student-shell {
  width: min(940px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 120px;
}

.curriculum-context {
  margin: -6px 0 32px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #d6dfd2;
  border-radius: 14px;
  background: #f1f7ee;
}
.curriculum-context > div { display: grid; gap: 4px; }
.curriculum-context span { color: #3b6b41; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.curriculum-context strong { line-height: 1.35; }
.curriculum-context small { color: var(--muted); }
.curriculum-context p { margin: 0; max-width: 270px; color: #34523a; font-weight: 700; line-height: 1.5; text-align: right; }

.lesson-vocabulary { margin: 24px 0 4px; padding: 20px; border: 1px solid #d9e2ef; border-radius: 13px; background: #f7faff; }
.lesson-vocabulary .student-eyebrow { margin-bottom: 13px; color: var(--accent-dark); }
.vocabulary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px 22px; }
.vocabulary-grid > div { min-width: 0; padding: 9px 0; display: grid; grid-template-columns: minmax(115px,.85fr) minmax(0,1.15fr); gap: 11px; border-bottom: 1px solid #e7edf5; }
.vocabulary-grid strong { overflow-wrap: anywhere; }
.vocabulary-grid span { color: var(--muted); line-height: 1.45; }

.student-shell--idle,
.student-login-card {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  align-content: center;
}

.idle-state,
.student-login-card {
  text-align: center;
  max-width: 620px;
}

.student-eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.idle-state h1,
.student-login-card h1,
.student-lesson-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: .98;
  letter-spacing: -.06em;
}

.idle-state > p:last-child {
  color: var(--muted);
  margin: 22px auto 0;
  max-width: 440px;
  line-height: 1.65;
}

.active-class {
  margin: 18px 0 0;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 750;
}

.active-topic {
  margin: 10px auto 32px;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.55;
}

.student-login-card form,
.partner-panel form,
.upload-card form {
  display: flex;
  gap: 10px;
}

.student-login-card input,
.partner-panel input {
  min-width: 0;
  border: 1px solid #d7dae0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 15px 16px;
  outline: none;
}

.student-login-card input {
  width: 220px;
  font-size: 1.25rem;
  letter-spacing: .08em;
  text-align: center;
}

.student-login-card input:focus,
.partner-panel input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(35, 100, 210, .12); }

.student-login-card button,
.partner-panel button,
.upload-card button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  padding: 15px 22px;
  font-weight: 720;
  cursor: pointer;
}

.student-login-card button:hover,
.partner-panel button:hover,
.upload-card button:hover { background: var(--accent-dark); }

.student-notice {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: .95rem;
}

.student-login-card .student-notice { margin-bottom: 0; }
.student-notice--error { background: #fff0ef; color: var(--danger); }
.student-notice--success { background: #eaf7f0; color: var(--success); }

.student-lesson-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 42px;
}

.student-lesson-heading h1 { font-size: clamp(2.3rem, 5.6vw, 4.6rem); }

.variant-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 15px;
  background: #eaf1ff;
  color: var(--accent-dark);
  font-weight: 750;
}

.identity-card,
.task-card,
.student-resources,
.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 38px);
}

.identity-card { margin-bottom: 18px; }
.identity-card--preview { border-style: dashed; }

.member-list { display: flex; flex-wrap: wrap; gap: 9px; }
.member-list strong { border-radius: 999px; background: var(--soft); padding: 10px 14px; }

.partner-panel { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.partner-panel summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.partner-panel form { margin-top: 15px; }
.partner-panel input { flex: 1; }

.student-task-stack { display: grid; gap: 18px; }
.task-card h2,
.student-resources h2,
.upload-card h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.task-card ol { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: tasks; display: grid; gap: 18px; }
.task-card li { counter-increment: tasks; position: relative; padding-left: 46px; line-height: 1.7; }
.task-card li::before { content: counter(tasks, decimal-leading-zero); position: absolute; left: 0; top: 0; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .06em; }

.student-guide {
  margin-top: 30px;
  border: 1px solid #b9cbea;
  border-radius: 16px;
  overflow: hidden;
  background: #f7faff;
}
.student-guide summary {
  min-height: 66px;
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--accent-dark);
  cursor: pointer;
  list-style: none;
  font-weight: 780;
}
.student-guide summary::-webkit-details-marker { display: none; }
.student-guide summary::before {
  content: "?";
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: .92rem;
  font-weight: 850;
}
.student-guide summary span { flex: 1; }
.student-guide summary small { color: var(--muted); font-size: .78rem; font-weight: 650; }
.student-guide summary small::after { content: "Відкрити інструкцію"; }
.student-guide[open] summary { border-bottom: 1px solid #cbd8ee; background: #edf4ff; }
.student-guide[open] summary small::after { content: "Згорнути"; }
.student-guide-body { padding: clamp(22px,4vw,34px); }
.student-guide-intro { max-width: 74ch; margin: 0; color: #41536a; line-height: 1.7; }
.student-guide-steps { margin: 28px 0 0 !important; display: grid !important; gap: 14px !important; counter-reset: guide-steps !important; }
.student-guide-steps > li {
  padding: 22px 20px 22px 66px !important;
  display: grid;
  gap: 14px;
  border: 1px solid #d9e2f1;
  border-radius: 14px;
  background: white;
  counter-increment: guide-steps !important;
}
.student-guide-steps > li::before {
  content: counter(guide-steps, decimal-leading-zero) !important;
  left: 20px !important;
  top: 23px !important;
  font-size: .76rem !important;
}
.student-guide-steps h3 { margin: 0; font-size: 1.06rem; line-height: 1.35; letter-spacing: -.012em; }
.student-guide-part,
.student-guide-check { display: grid; grid-template-columns: 108px minmax(0,1fr); gap: 13px; align-items: start; }
.student-guide-part strong,
.student-guide-check strong { padding-top: 2px; color: var(--muted); font-size: .72rem; line-height: 1.4; letter-spacing: .07em; text-transform: uppercase; }
.student-guide-part p,
.student-guide-check p { margin: 0; line-height: 1.68; }
.student-guide-check { margin-top: 2px; padding: 13px 14px; border-radius: 10px; background: #edf7f1; }
.student-guide-check strong { color: var(--success); }
.student-guide-actions { padding: 14px; display: grid; gap: 9px; border-radius: 10px; background: #f5f7fa; }
.student-guide-actions > strong { color: #46566b; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.student-guide-actions ol { margin: 0 !important; padding-left: 20px !important; display: grid !important; gap: 8px !important; list-style: decimal !important; }
.student-guide-actions li { position: static !important; padding: 0 0 0 3px !important; line-height: 1.58 !important; counter-increment: none !important; }
.student-guide-actions li::before { content: none !important; }
.student-guide-help,
.student-guide-final { margin-top: 18px; padding: 21px; border-radius: 13px; }
.student-guide-help { background: #fff7e9; }
.student-guide-final { background: #edf7f1; }
.student-guide-help h3,
.student-guide-final h3 { margin: 0 0 13px; font-size: 1.06rem; }
.student-guide-help ul,
.student-guide-final ul { margin: 0; padding-left: 20px; display: grid; gap: 9px; }
.student-guide-help li,
.student-guide-final li { position: static; padding-left: 4px; line-height: 1.58; counter-increment: none; }
.student-guide-help li::before,
.student-guide-final li::before { content: none; }

.student-resources,
.upload-card { margin-top: 18px; }
.onsite-check-note {
  margin: 18px 0 0;
  padding: 18px 20px;
  border: 1px solid #cfd5dd;
  border-radius: 14px;
  background: #f0f3f6;
  color: var(--muted);
  line-height: 1.6;
}
.onsite-check-note strong { color: var(--ink); }
.student-resource-list { margin-top: 24px; display: grid; gap: 9px; }
.student-resource-list a { display: flex; justify-content: space-between; gap: 18px; padding: 16px 18px; background: var(--soft); border-radius: 12px; text-decoration: none; }
.student-resource-list a:hover { background: #eaf1ff; }
.student-resource-list span { font-weight: 680; overflow-wrap: anywhere; }
.student-resource-list small { flex: 0 0 auto; color: var(--muted); }

.upload-card > p:not(.student-eyebrow) { color: var(--muted); line-height: 1.55; }
.upload-card form { margin-top: 24px; }
.file-picker { flex: 1; display: grid; place-items: center; min-height: 54px; border: 1px dashed #b9c0ca; border-radius: 12px; color: var(--muted); cursor: pointer; padding: 12px; text-align: center; }
.file-picker:hover { border-color: var(--accent); color: var(--accent); }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-card--preview button:disabled { cursor: not-allowed; opacity: .48; }
.upload-card--preview .file-picker { cursor: default; opacity: .72; }

@media (max-width: 680px) {
  .student-wordmark span { display: none; }
  .student-header,
  .student-shell { width: min(100% - 28px, 940px); }
  .student-shell { padding-top: 44px; }
  .student-login-card form,
  .partner-panel form,
  .upload-card form { flex-direction: column; }
  .student-login-card input { width: 100%; }
  .student-lesson-heading { align-items: flex-start; flex-direction: column; }
  .student-resource-list a { flex-direction: column; }
  .student-resource-list small { flex: auto; }
  .student-header { min-height: 64px; }
  .student-shell { padding-bottom: 72px; }
  .student-preview-banner { align-items: flex-start; flex-direction: column; }
  .student-lesson-heading h1 { font-size: clamp(2rem,10vw,3rem); overflow-wrap: anywhere; }
  .identity-card,
  .task-card,
  .student-resources,
  .upload-card { border-radius: 15px; padding: 22px 18px; }
  .task-card li { padding-left: 36px; }
  .student-guide { margin-top: 24px; border-radius: 13px; }
  .student-guide summary { min-height: 61px; padding: 15px; gap: 11px; }
  .student-guide summary::before { width: 28px; height: 28px; flex-basis: 28px; }
  .student-guide summary small { font-size: 0; }
  .student-guide summary small::after { font-size: .72rem; }
  .student-guide-body { padding: 18px 14px; }
  .student-guide-steps > li { padding: 19px 15px 19px 48px !important; }
  .student-guide-steps > li::before { left: 15px !important; top: 20px !important; }
  .student-guide-part,
  .student-guide-check { grid-template-columns: 1fr; gap: 5px; }
  .student-guide-check { padding: 12px; }
  .curriculum-context { align-items: start; flex-direction: column; }
  .curriculum-context p { text-align: left; }
  .vocabulary-grid { grid-template-columns: 1fr; }
  .vocabulary-grid > div { grid-template-columns: minmax(105px,.8fr) minmax(0,1.2fr); }
}

@media (max-width: 390px) {
  .student-header,
  .student-shell { width: calc(100% - 22px); }
  .idle-state h1,
  .student-login-card h1 { font-size: clamp(2.05rem,15vw,3.1rem); }
  .student-login-card form { width: 100%; }
  .member-list strong { width: 100%; border-radius: 10px; }
}
