:root {
  --background: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3ff;
  --text: #172033;
  --text-muted: #5d687a;
  --border: #dfe5ef;
  --primary: #3157d5;
  --primary-dark: #2343ad;
  --primary-soft: #e7edff;
  --success: #1c7c54;
  --success-soft: #e5f6ed;
  --warning: #9a6410;
  --warning-soft: #fff3d6;
  --danger: #b24141;
  --danger-soft: #fdebec;
  --shadow: 0 18px 50px rgba(31, 48, 89, 0.10);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 12px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(49, 87, 213, 0.10), transparent 34rem),
    var(--background);
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-small);
  color: #fff;
  background: var(--text);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.site-header {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(140deg, var(--primary), #6b83e8);
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(49, 87, 213, 0.26);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  line-height: 1.25;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.stage-badge,
.availability,
.status-badge,
.question-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stage-badge {
  padding: 0.5rem 0.8rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 0.78rem;
}

.hero {
  padding: 4.2rem 0 3.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.75fr);
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 830px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

.hero-lead {
  max-width: 720px;
  margin-bottom: 1.7rem;
  color: var(--text-muted);
  font-size: 1.12rem;
}

.hero-actions,
.quiz-actions,
.result-actions,
.subject-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.button {
  min-height: 2.9rem;
  padding: 0.78rem 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

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

.button:focus-visible,
.card-link:focus-visible,
.option-label:focus-within,
.text-answer:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.25);
  outline-offset: 3px;
}

.button-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 12px 28px rgba(49, 87, 213, 0.22);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.78);
}

.button-quiet {
  min-height: auto;
  padding: 0.45rem 0.65rem;
  color: var(--text-muted);
  border-color: transparent;
  background: transparent;
}

.button-danger-quiet {
  color: var(--danger);
}

.button[disabled] {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hero-panel {
  padding: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-large);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel h2 {
  font-size: 1.25rem;
}

.steps-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  list-style: none;
}

.steps-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.8rem;
  align-items: center;
  font-weight: 650;
}

.steps-list span {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 0.88rem;
}

.privacy-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.section-block {
  padding: 3.2rem 0;
}

.section-heading {
  margin-bottom: 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
}

.section-heading > p {
  max-width: 560px;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.subject-card,
.track-card,
.test-card,
.question-card,
.result-card,
.empty-state,
.info-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(31, 48, 89, 0.065);
}

.subject-card {
  min-height: 420px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.subject-card::after {
  content: "";
  position: absolute;
  right: -4rem;
  top: -4rem;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: rgba(49, 87, 213, 0.07);
}

.subject-icon {
  width: 3.7rem;
  height: 3.7rem;
  margin-bottom: 1.3rem;
  display: grid;
  place-items: center;
  border-radius: 1.15rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 1.25rem;
  font-weight: 850;
}

.subject-card-it .subject-icon {
  color: #285965;
  background: #e3f4f5;
  font-size: 0.98rem;
}

.subject-card-english .subject-icon {
  color: #7b4a15;
  background: #fff0d8;
}

.subject-card-content {
  flex: 1;
}

.card-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.availability {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  color: var(--text-muted);
  background: #eef1f5;
  font-size: 0.7rem;
}

.availability-live {
  color: var(--success);
  background: var(--success-soft);
}

.subject-card p,
.test-card p,
.track-description,
.empty-state p,
.info-panel p {
  color: var(--text-muted);
}

.compact-list {
  margin: 1.2rem 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  list-style: none;
}

.compact-list li::before {
  content: "✓";
  margin-right: 0.55rem;
  color: var(--success);
  font-weight: 800;
}

.card-link {
  margin-top: 1rem;
  padding: 0.9rem 0.2rem 0.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--primary);
  border-top: 1px solid var(--border);
  font-weight: 750;
  text-decoration: none;
}

.architecture-note {
  margin-top: 2rem;
  margin-bottom: 4rem;
  padding: 2rem;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 2rem;
  align-items: center;
  border-radius: var(--radius-large);
  color: #fff;
  background: #172033;
}

.architecture-note .eyebrow {
  color: #9fb3ff;
}

.architecture-note p:last-child {
  margin-bottom: 0;
  color: #c8d0df;
}

.site-footer {
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
}

.footer-inner {
  padding: 1.2rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
}

.subject-main {
  padding: 2rem 0 5rem;
}

.subject-hero {
  margin-bottom: 2rem;
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(238,243,255,0.9));
  box-shadow: var(--shadow);
}

.subject-hero h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
}

.subject-hero p {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.subject-symbol {
  width: 6rem;
  height: 6rem;
  display: grid;
  place-items: center;
  border-radius: 1.8rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 2.2rem;
  font-weight: 850;
}

.subject-toolbar {
  margin-bottom: 1.25rem;
  justify-content: space-between;
}

.back-link {
  color: var(--primary);
  font-weight: 750;
  text-decoration: none;
}

.track-list {
  display: grid;
  gap: 1.2rem;
}

.track-card {
  padding: 1.3rem;
}

.track-card-header {
  margin-bottom: 1rem;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.track-card-header h2 {
  margin-bottom: 0.3rem;
  font-size: 1.55rem;
}

.test-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.test-card {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
}

.test-card h3,
.test-card h4 {
  margin-bottom: 0.45rem;
}

.chapter-section-navigation {
  margin-top: 1.35rem;
  padding: 1.1rem;
  border: 1px solid #d7e4f4;
  border-radius: 18px;
  background: #f6f9fe;
}

.chapter-section-navigation-heading,
.chapter-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.chapter-section-navigation-heading h3,
.chapter-section-heading h3 {
  margin: .15rem 0 0;
}

.chapter-section-navigation-heading > p,
.chapter-section-heading > p {
  margin: 0;
  color: #63748b;
  font-size: .9rem;
}

.chapter-section-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

.chapter-section-link {
  display: flex;
  min-height: 4.5rem;
  flex-direction: column;
  justify-content: center;
  gap: .25rem;
  padding: .85rem .95rem;
  border: 1px solid #cfdef0;
  border-radius: 14px;
  background: #fff;
  color: #163f72;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.chapter-section-link:hover,
.chapter-section-link:focus-visible {
  border-color: #5f9de8;
  box-shadow: 0 10px 24px rgba(21, 87, 169, .12);
  transform: translateY(-1px);
}

.chapter-section-link-active {
  border-color: #2c79d8;
  background: #eaf3ff;
  box-shadow: inset 0 0 0 1px rgba(44, 121, 216, .16);
}

.chapter-section-link span {
  color: #68798f;
  font-size: .8rem;
  font-weight: 650;
}

.chapter-section-list {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.35rem;
}

.chapter-section {
  scroll-margin-top: 6.5rem;
}

.chapter-section-heading {
  margin-bottom: .8rem;
  padding: 0 .15rem;
}

.test-meta,
.progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.test-progress {
  margin: 1rem 0;
  padding: 0.8rem;
  border-radius: var(--radius-small);
  background: #f6f8fb;
}

.test-progress strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
}

.test-card .button {
  margin-top: auto;
}

.empty-state {
  padding: 1.3rem;
  border-style: dashed;
  box-shadow: none;
}

.empty-state h3 {
  margin-bottom: 0.35rem;
}

.quiz-container {
  width: min(calc(100% - 2rem), 840px);
  margin: 1rem auto 5rem;
}

.quiz-topbar {
  margin-bottom: 1.25rem;
}

.quiz-breadcrumb {
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.progress-row {
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 0.65rem;
  border-radius: 999px;
  background: #dfe5ef;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #7087e5);
  transition: width 220ms ease;
}

.question-card,
.result-card {
  padding: clamp(1.25rem, 4vw, 2.1rem);
}

.question-number {
  margin-bottom: 0.4rem;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-card h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.question-type-badge {
  margin-bottom: 1rem;
  padding: 0.35rem 0.65rem;
  color: var(--text-muted);
  background: #eef1f5;
  font-size: 0.7rem;
}

.code-block {
  margin: -0.4rem 0 1.3rem;
  padding: 1rem;
  overflow-x: auto;
  border-radius: var(--radius-small);
  color: #e5eaf4;
  background: #151a24;
  font: 0.92rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.answer-area {
  margin: 1.1rem 0 1.4rem;
}

.options-list {
  display: grid;
  gap: 0.7rem;
}

.option-label {
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: auto 2rem 1fr;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: #fff;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.option-label:hover {
  border-color: #aebbe4;
  transform: translateY(-1px);
}

.option-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option-label.option-correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.option-label.option-incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.option-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.option-key {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  color: var(--text-muted);
  background: #eef1f5;
  font-size: 0.78rem;
  font-weight: 800;
}

.text-answer {
  width: min(100%, 420px);
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text);
  background: #fff;
}

.text-answer:focus {
  border-color: var(--primary);
}

.feedback-box {
  margin: 1.1rem 0;
  padding: 1rem;
  border-radius: var(--radius-small);
}

.feedback-box strong {
  display: block;
  margin-bottom: 0.3rem;
}

.feedback-correct {
  color: #155d40;
  border: 1px solid #b6dfc9;
  background: var(--success-soft);
}

.feedback-incorrect {
  color: #873333;
  border: 1px solid #f2c5c8;
  background: var(--danger-soft);
}

.quiz-actions {
  justify-content: space-between;
}

.result-card {
  text-align: center;
}

.result-score {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 2rem;
  font-weight: 850;
}

.result-card h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.result-summary {
  margin-bottom: 1.4rem;
  color: var(--text-muted);
}

.status-badge {
  margin-bottom: 1.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.86rem;
}

.status-mastered {
  color: var(--success);
  background: var(--success-soft);
}

.status-practising {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-repeat {
  color: var(--danger);
  background: var(--danger-soft);
}

.weak-areas {
  margin: 1.3rem 0;
  padding: 1rem;
  text-align: left;
  border-radius: var(--radius-small);
  background: #f6f8fb;
}

.weak-areas h2 {
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.weak-areas ul {
  margin: 0;
  padding-left: 1.2rem;
}

.result-actions {
  margin-top: 1.5rem;
  justify-content: center;
}

.result-details {
  margin-top: 1.4rem;
  text-align: left;
}

.result-details summary {
  cursor: pointer;
  font-weight: 750;
}

.result-review-list {
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  list-style: none;
}

.result-review-list li {
  padding: 0.75rem;
  border-radius: var(--radius-small);
  background: #f6f8fb;
}

.review-correct {
  border-left: 4px solid var(--success);
}

.review-incorrect {
  border-left: 4px solid var(--danger);
}

.info-panel {
  margin-top: 1rem;
  padding: 1rem;
}

.noscript-message {
  width: min(calc(100% - 2rem), 760px);
  margin: 2rem auto;
  padding: 1rem;
  border: 1px solid #f2c5c8;
  border-radius: var(--radius-small);
  color: var(--danger);
  background: var(--danger-soft);
}

@media (max-width: 900px) {
  .hero,
  .subject-hero,
  .architecture-note {
    grid-template-columns: 1fr;
  }

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

  .subject-symbol {
    display: none;
  }

  .architecture-note {
    gap: 0.5rem;
  }
}

@media (max-width: 650px) {
  .site-header {
    padding-top: 0.9rem;
  }

  .brand small {
    display: none;
  }

  .hero {
    padding-top: 2.6rem;
    gap: 1.5rem;
  }

  .subject-grid,
  .test-list {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .track-card-header,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .subject-card {
    min-height: auto;
  }

  .subject-hero,
  .track-card,
  .question-card,
  .result-card {
    padding: 1.1rem;
  }

  .quiz-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-actions .button,
  .result-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Portal przedmiotowy — JSON, rozdziały i postęp */
.loading-card {
  min-height: 320px;
  padding: 2rem;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.loading-card h1 {
  margin: 1rem 0 0.45rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.loading-card p {
  color: var(--text-muted);
}

.loading-spinner {
  width: 2.8rem;
  height: 2.8rem;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: studypath-spin 800ms linear infinite;
}

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

.error-state {
  margin-top: 2rem;
  padding: 1.5rem;
}

.error-state h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.data-source-meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.data-badge {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 0.74rem;
  font-weight: 750;
}

.chapter-hero {
  margin-bottom: 1.25rem;
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.36fr);
  gap: 1.5rem;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(238,243,255,0.9));
  box-shadow: var(--shadow);
}

.chapter-hero h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
}

.chapter-lead {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 1.04rem;
}

.chapter-start-panel {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
  border: 1px solid rgba(49, 87, 213, 0.16);
  border-radius: var(--radius-medium);
  background: rgba(255,255,255,0.84);
}

.chapter-start-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.chapter-content-grid {
  margin: 1rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.chapter-content-grid .info-panel {
  margin-top: 0;
}

.chapter-content-grid h2 {
  font-size: 1.15rem;
}

.chapter-content-grid ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.chapter-tasks {
  padding: 1.4rem 0 3rem;
}

.compact-heading {
  margin-bottom: 1rem;
}

.task-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.task-link-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(31, 48, 89, 0.055);
}

.task-link-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.task-id {
  padding: 0.25rem 0.45rem;
  border-radius: 0.45rem;
  color: var(--text-muted);
  background: #eef1f5;
  font-size: 0.72rem;
}

.task-preview,
.task-preview-context {
  color: var(--text-muted);
}

.task-preview {
  flex: 1;
  margin: 0.7rem 0 1rem;
}

.task-preview-context {
  margin: 0.55rem 0 -0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.task-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.task-link-actions .button {
  flex: 1 1 150px;
}

.quiz-heading-row {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.quiz-heading-row .quiz-breadcrumb {
  margin-bottom: 0;
}

.button-small {
  min-height: 2.3rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
}

.task-passage {
  margin: 0 0 1.2rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  color: var(--text);
  background: #f6f8ff;
  font-style: normal;
}

@media (max-width: 900px) {
  .chapter-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .chapter-content-grid,
  .task-link-list {
    grid-template-columns: 1fr;
  }

  .quiz-heading-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Textbook-style lesson blocks */
.lesson-content {
  margin: 0 0 1rem;
  padding: 1.4rem 0 0;
}

.lesson-section-list {
  display: grid;
  gap: 1rem;
}

.lesson-section-card {
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(31, 48, 89, 0.06);
}

.lesson-section-heading {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.lesson-section-number {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.lesson-section-heading h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
}

.lesson-section-heading .eyebrow {
  margin-bottom: 0.2rem;
}

.lesson-paragraph {
  color: var(--text-muted);
  line-height: 1.75;
}

.lesson-rule,
.lesson-tip,
.lesson-mistake,
.lesson-summary {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-medium);
}

.lesson-rule {
  border-left: 4px solid var(--primary);
  background: #f3f6ff;
}

.lesson-rule p,
.lesson-tip p,
.lesson-mistake p {
  margin: 0.35rem 0 0;
}

.lesson-examples {
  margin-top: 1rem;
}

.lesson-examples h4 {
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.lesson-example {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: #fbfcff;
}

.lesson-example + .lesson-example {
  margin-top: 0.65rem;
}

.lesson-example p {
  margin: 0;
}

.lesson-example-english {
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 750;
}

.lesson-example-polish {
  margin-top: 0.2rem !important;
  color: var(--text-muted);
}

.lesson-example-note {
  margin-top: 0.45rem !important;
  color: var(--primary-dark, #2341a3);
  font-size: 0.86rem;
  font-weight: 700;
}

.lesson-mistake {
  border: 1px solid #efc5c5;
  background: #fff6f6;
}

.lesson-mistake-comparison {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.lesson-mistake-comparison span {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-small);
  font-weight: 750;
}

.mistake-wrong {
  color: #8f2929;
  background: #ffe6e6;
}

.mistake-correct {
  color: #17653a;
  background: #e9f8ef;
}

.lesson-tip {
  border: 1px solid #efd393;
  background: var(--warning-soft);
}

.lesson-summary {
  margin-top: 1rem;
  border: 1px solid rgba(49, 87, 213, 0.2);
  background: linear-gradient(135deg, #f5f7ff, #ffffff);
}

.lesson-summary h3 {
  margin-bottom: 0.65rem;
}

.lesson-summary ul,
.lesson-bullets {
  margin-bottom: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .lesson-mistake-comparison {
    grid-template-columns: 1fr;
  }
}

/* Etap 1.3 — izolowane sesje testów i status lekcji */
.lesson-track-progress {
  color: #24593b;
  background: #e4f5eb;
}

.active-session-summary,
.completed-attempt-summary {
  padding: 0.55rem 0;
}

.active-session-summary + .completed-attempt-summary,
.test-progress > * + .completed-attempt-summary {
  margin-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.active-session-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  color: var(--primary-dark);
}

.active-session-summary strong,
.completed-attempt-summary strong {
  margin-bottom: 0;
}

.active-session-summary span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.lesson-status-complete {
  color: #21633c;
}

.lesson-status-started {
  color: #8a5a12;
}

.chapter-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.lesson-completion-panel {
  margin-top: 1rem;
  padding: 1.15rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(37, 112, 70, 0.2);
  border-radius: var(--radius-medium);
  background: #f0f9f3;
}

.lesson-completion-panel h3,
.lesson-completion-panel p {
  margin: 0;
}

.lesson-completion-panel p {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.lesson-complete-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2c8a50;
  font-size: 1.2rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .lesson-completion-panel {
    grid-template-columns: 1fr;
  }

  .lesson-completion-panel .button,
  .chapter-start-actions .button {
    width: 100%;
  }
}

/* Etap 1.4 — ukryty katalog materiałów cyfrowych */
.download-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(49, 87, 213, 0.09), transparent 31rem),
    var(--background, #f7f8fc);
}

.download-main {
  padding-top: clamp(2rem, 5vw, 4.5rem);
  padding-bottom: 4rem;
}

.download-hero {
  max-width: 50rem;
}

.download-hero h1 {
  margin-bottom: 0.9rem;
}

.download-hero > p:last-child {
  max-width: 46rem;
  color: var(--text-muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.download-panel {
  margin-top: 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-soft);
}

.download-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.download-panel-heading h2 {
  margin: 0;
}

.download-list {
  display: grid;
  gap: 0.85rem;
}

.download-card {
  padding: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: #fbfcff;
}

.download-file-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.8rem;
  color: #fff;
  background: var(--primary);
  font-size: 1.3rem;
  font-weight: 900;
}

.download-file-content h3,
.download-file-content p {
  margin: 0;
}

.download-file-content > p:not(.download-file-meta) {
  margin-top: 0.3rem;
  color: var(--text-muted);
}

.download-file-meta {
  margin-top: 0.45rem !important;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.download-security-note {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #efd393;
  border-radius: var(--radius-medium);
  background: var(--warning-soft);
}

.download-security-note p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-medium);
  color: var(--text-muted);
  background: #fbfcff;
}

.empty-state strong {
  color: var(--text);
}

.empty-state p:last-child {
  margin-bottom: 0;
}

.empty-state-error {
  border-color: #efc5c5;
  background: #fff6f6;
}

@media (max-width: 720px) {
  .download-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .download-card .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .download-panel-heading {
    flex-direction: column;
  }
}


/* Etap 1.5 — zestawy ćwiczeń, stabilne linki i integracja książki */
.exercise-set-section {
  margin-top: 2rem;
}

.exercise-set-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.exercise-set-card {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.exercise-set-card h3,
.exercise-set-card p {
  margin-bottom: 0;
}

.exercise-set-selected {
  border-color: rgba(49, 87, 213, 0.55);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.09);
}

.exercise-set-progress {
  min-height: 3.2rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-radius: var(--radius-small);
  background: var(--surface-soft);
}

.exercise-set-progress span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.solution-steps {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid currentColor;
}

.solution-steps summary {
  font-weight: 750;
  cursor: pointer;
}

.solution-steps ol {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

@media (max-width: 900px) {
  .exercise-set-grid {
    grid-template-columns: 1fr;
  }
}

/* Materiały wideo osadzone w lekcjach */
.lesson-media-list {
  margin: 0 0 1rem;
  display: grid;
  gap: 1rem;
}

.lesson-media-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(17rem, 0.85fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(31, 48, 89, 0.08);
}

.lesson-video-frame {
  position: relative;
  min-height: 18rem;
  background: #10131c;
}

.lesson-video-frame::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.lesson-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-media-copy {
  padding: clamp(1rem, 2.2vw, 1.55rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.lesson-media-copy h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}

.lesson-media-description {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.lesson-media-meta {
  margin: 0.9rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

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

  .lesson-video-frame {
    min-height: 0;
  }

  .lesson-media-copy .button {
    width: 100%;
  }
}

/* Informatics task metadata loaded from JSON. */
.task-io-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
}
.task-io-box {
  padding: 0.9rem;
  border: 1px solid var(--border, #dce3ee);
  border-radius: 12px;
  background: #f8fafc;
}
.task-io-box strong { display: block; margin-bottom: 0.45rem; }
.task-io-box pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.92rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.return-to-book {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-left: 4px solid currentColor;
  background: rgba(255, 255, 255, 0.55);
}

/* Student-facing portal: keep implementation controls out of the learning flow. */
.subject-main .task-id,
.subject-main .qr-modal-backdrop {
  display: none !important;
}

/* Compatibility guard for a browser that still has an older renderer cached. */
.subject-main .task-link-card .task-link-actions > button.button-primary,
.subject-main .exercise-set-card .task-link-actions > button.button-quiet,
.subject-main .chapter-start-actions > button.button-secondary:last-child {
  display: none !important;
}

.exercise-set-actions .button {
  flex: 1 1 100%;
}

@media (min-width: 701px) {
  .exercise-set-actions .button.button-quiet {
    flex: 0 1 auto;
  }
}

/* ========================================================================== 
   StudyPath 2026 — portal theme aligned with the book-cover series
   ========================================================================== */
:root {
  --background: #f2f6fc;
  --surface: #ffffff;
  --surface-soft: #e8f0fb;
  --text: #071a35;
  --text-muted: #5b6980;
  --border: #d8e3f1;
  --primary: #1b69d4;
  --primary-dark: #0b499f;
  --primary-soft: #dceaff;
  --success: #207a62;
  --success-soft: #e1f4ed;
  --warning: #956518;
  --warning-soft: #fff2d4;
  --danger: #a53d49;
  --danger-soft: #fde9ed;
  --shadow: 0 20px 54px rgba(5, 31, 72, 0.11);
}

body {
  background:
    radial-gradient(circle at 88% 4%, rgba(51, 124, 223, .12), transparent 31rem),
    linear-gradient(180deg, #f7faff 0%, #eef4fb 100%);
}

.brand-mark {
  border: 1px solid rgba(115, 181, 255, .28);
  background:
    radial-gradient(circle at 72% 22%, rgba(83, 169, 255, .42), transparent 45%),
    linear-gradient(145deg, #0d3e85, #051a3b);
  color: #a5d9ff;
  box-shadow: 0 12px 28px rgba(4, 39, 93, .22);
}

.brand strong {
  background: linear-gradient(100deg, #09224b 0%, #135fbd 70%, #4c9aeb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -.035em;
}

.stage-badge {
  border: 1px solid rgba(32, 100, 189, .12);
  background: #dceaff;
  color: #0a4a9c;
}

.button-primary {
  background: linear-gradient(135deg, #2d84ee, #1765d0 58%, #0d4eaf);
  box-shadow: 0 12px 26px rgba(25, 101, 211, .22);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: linear-gradient(135deg, #4b99f5, #1d72df 58%, #1058bf);
}

.hero.container {
  position: relative;
  overflow: hidden;
  width: min(calc(100% - 2rem), var(--max-width));
  margin-top: 1rem;
  padding: clamp(2.5rem, 5vw, 4.6rem);
  border: 1px solid rgba(119, 185, 255, .23);
  border-radius: 32px;
  background:
    linear-gradient(rgba(75, 146, 236, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 146, 236, .055) 1px, transparent 1px),
    radial-gradient(circle at 85% 18%, rgba(66, 145, 244, .34), transparent 25rem),
    linear-gradient(135deg, #03142f 0%, #082b62 100%);
  background-size: 38px 38px, 38px 38px, auto, auto;
  box-shadow: 0 30px 74px rgba(2, 22, 55, .18);
}

.hero.container::after {
  position: absolute;
  right: -8%;
  bottom: -46%;
  width: 56%;
  aspect-ratio: 1;
  border: 1px solid rgba(120, 188, 255, .15);
  border-radius: 50%;
  content: "";
}

.hero.container .eyebrow,
.subject-hero .eyebrow,
.chapter-hero .eyebrow {
  color: #91ceff;
}

.hero.container h1,
.hero.container h2,
.hero.container strong {
  color: white;
}

.hero.container .hero-lead,
.hero.container p,
.hero.container li,
.hero.container .privacy-note {
  color: rgba(226, 238, 255, .78);
}

.hero-panel {
  border-color: rgba(150, 204, 255, .20);
  background: rgba(5, 29, 66, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
}

.steps-list span {
  background: rgba(95, 170, 255, .18);
  color: #a8d9ff;
}

.subject-card,
.track-card,
.test-card,
.task-link-card,
.lesson-section-card,
.download-panel,
.download-card {
  border-color: rgba(16, 73, 145, .12);
  box-shadow: 0 18px 46px rgba(5, 31, 72, .07);
}

.subject-card:hover,
.track-card:hover,
.test-card:hover {
  border-color: rgba(31, 103, 194, .27);
  box-shadow: 0 24px 56px rgba(5, 31, 72, .11);
}

.subject-icon {
  border: 1px solid rgba(26, 98, 189, .14);
  background: linear-gradient(145deg, #e9f2ff, #dceaff);
  color: #0f56ac;
}

.subject-card-it .subject-icon,
.subject-card-english .subject-icon {
  background: linear-gradient(145deg, #e9f2ff, #dceaff);
  color: #0f56ac;
}

.card-link,
.eyebrow {
  color: #125ab7;
}

.architecture-note {
  border-color: rgba(16, 73, 145, .14);
  background: linear-gradient(135deg, #eef5ff, #f9fbff);
}

.subject-hero,
.chapter-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(116, 181, 255, .22);
  background:
    linear-gradient(rgba(73, 144, 233, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 144, 233, .05) 1px, transparent 1px),
    radial-gradient(circle at 86% 16%, rgba(65, 145, 246, .31), transparent 24rem),
    linear-gradient(135deg, #03142f 0%, #092d66 100%);
  background-size: 36px 36px, 36px 36px, auto, auto;
  box-shadow: 0 26px 68px rgba(2, 22, 55, .16);
}

.subject-hero h1,
.subject-hero h2,
.subject-hero h3,
.chapter-hero h1,
.chapter-hero h2,
.chapter-hero h3 {
  color: #fff;
}

.subject-hero p,
.chapter-hero p,
.subject-hero .subject-description,
.chapter-hero .chapter-lead {
  color: rgba(226, 238, 255, .79);
}

.subject-symbol {
  border: 1px solid rgba(139, 199, 255, .24);
  background: rgba(74, 153, 245, .16);
  color: #a8d9ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.subject-toolbar .button-secondary,
.chapter-hero .button-secondary {
  border-color: rgba(150, 204, 255, .26);
  background: rgba(5, 31, 70, .52);
  color: #f0f7ff;
}

.availability,
.status-badge,
.question-type-badge,
.data-badge {
  background: #dceaff;
  color: #0d4e9f;
}

.track-card-header {
  border-bottom-color: rgba(14, 69, 139, .10);
}

.progress-bar > span,
.test-progress > span,
.exercise-set-progress > span {
  background: linear-gradient(90deg, #1d6bd3, #60b5ff);
}

.site-footer {
  border-top-color: rgba(18, 73, 142, .10);
  color: #6a7890;
}

.download-page {
  background:
    radial-gradient(circle at 88% 8%, rgba(51, 124, 223, .12), transparent 30rem),
    #f2f6fc;
}

.download-hero {
  padding: 2rem 0 1rem;
}

.download-security-note {
  border-color: rgba(16, 73, 145, .13);
  background: #eaf2fd;
}

@media (max-width: 760px) {
  .hero.container {
    margin-top: .4rem;
    padding: 2rem 1.25rem;
    border-radius: 24px;
  }

  .site-header {
    padding-top: 1rem;
  }
}

/* ========================================================================== 
   English books v2 — publication states, codes and open-response practice
   ========================================================================== */
.data-badge-soft {
  background: rgba(255, 255, 255, .12);
  color: rgba(238, 246, 255, .9);
  border: 1px solid rgba(173, 214, 255, .22);
}

.data-badge-audio {
  background: rgba(255, 210, 119, .14);
  color: #ffe5ad;
  border: 1px solid rgba(255, 211, 121, .24);
}

.track-card {
  scroll-margin-top: 6.5rem;
}

.track-card-selected {
  border-color: rgba(49, 128, 228, .46);
  box-shadow: 0 26px 70px rgba(13, 77, 166, .16);
}

.track-card-selected::before {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d69d4, #63baff);
  content: "";
}

.track-card-header {
  gap: 1.25rem;
  align-items: flex-start;
}

.track-counters {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
  max-width: 28rem;
}

.availability-live {
  background: #dff3ee;
  color: #17644f;
}

.availability-total {
  background: #e9f1fd;
  color: #234f88;
}

.availability-audio {
  background: #fff2d6;
  color: #825a13;
}

.test-card-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.test-card-heading-row > div {
  min-width: 0;
}

.chapter-module-label {
  margin: .25rem 0 0;
  color: #64738a;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chapter-availability {
  flex: 0 0 auto;
  padding: .36rem .64rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

.chapter-availability-live {
  background: #dff3ee;
  color: #17644f;
}

.chapter-availability-planned {
  background: #e7effa;
  color: #355a88;
}

.chapter-availability-audio {
  background: #fff0d0;
  color: #80560e;
}

.test-card-planned,
.test-card-audio-pending {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
}

.test-card-audio-pending {
  border-color: rgba(183, 125, 25, .20);
}

.chapter-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .9rem;
  padding: .7rem .8rem;
  border: 1px solid #d8e3f1;
  border-radius: 12px;
  background: #f2f6fc;
  color: #5d6b80;
  font-size: .84rem;
}

.chapter-code-row code,
.chapter-code-large {
  color: #0a4b9e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  letter-spacing: .04em;
}

.planned-chapter-note {
  margin: 1rem 0;
  padding: .9rem 1rem;
  border-left: 3px solid #7ba8df;
  border-radius: 0 12px 12px 0;
  background: #edf4fd;
}

.planned-chapter-note strong {
  color: #123f78;
}

.planned-chapter-note p {
  margin: .3rem 0 0;
  color: #56677f;
  font-size: .92rem;
}

.planned-start-panel {
  border-color: rgba(154, 207, 255, .24);
  background: rgba(4, 33, 75, .68);
}

.planned-chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.planned-detail-panel,
.planned-code-panel,
.planned-prerequisites {
  border: 1px solid rgba(18, 77, 151, .13);
  box-shadow: 0 16px 42px rgba(6, 37, 83, .07);
}

.chapter-code-large {
  display: inline-block;
  margin: .2rem 0 1rem;
  padding: .8rem 1rem;
  border: 1px solid #c6d9f0;
  border-radius: 12px;
  background: #eef5ff;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.planned-prerequisites {
  margin-bottom: 1.5rem;
}

.planned-prerequisites a {
  color: #125ab7;
  font-weight: 700;
}

.task-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: -.2rem 0 1rem;
}

.task-scenario {
  margin: 1.1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #cfe0f3;
  border-radius: 16px;
  background: linear-gradient(145deg, #eef5ff, #f8fbff);
}

.task-scenario h2 {
  margin: 0 0 .8rem;
  color: #123e76;
  font-size: 1rem;
}

.task-scenario-roles {
  display: grid;
  gap: .25rem;
  margin-bottom: .8rem;
}

.task-scenario-roles p,
.task-scenario-complication {
  margin: 0;
  color: #4d617d;
}

.task-scenario-points {
  margin: .5rem 0 .8rem;
  padding-left: 1.2rem;
}

.task-scenario-complication {
  padding-top: .7rem;
  border-top: 1px solid #d8e5f4;
}

.task-time-note {
  margin: -.2rem 0 1rem;
  color: #68778d;
  font-size: .9rem;
}

.self-assessment-input {
  width: 100%;
  min-height: 10rem;
  resize: vertical;
  line-height: 1.55;
}

.feedback-neutral {
  border-color: #b8d1ee;
  background: #edf5ff;
  color: #214a77;
}

.manual-rubric {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(59, 111, 171, .18);
}

.manual-rubric h3 {
  margin: 0 0 .45rem;
  color: #123f78;
  font-size: 1rem;
}

.manual-rubric-note {
  margin: 0 0 .7rem;
  color: #657891;
  font-size: .86rem;
}

.manual-rubric-list,
.manual-model-list {
  margin: .55rem 0 0;
  padding-left: 1.2rem;
}

.manual-rubric-list li,
.manual-model-list li {
  margin: .35rem 0;
}

.manual-model-answer {
  margin-top: 1rem;
  padding: .8rem .9rem;
  border: 1px solid #c9dcf1;
  border-radius: 12px;
  background: rgba(255,255,255,.62);
}

.manual-model-answer summary {
  color: #125ab7;
  font-weight: 800;
  cursor: pointer;
}

.status-completed {
  background: #dff3ee;
  color: #17644f;
}

.result-score-complete {
  display: grid;
  place-items: center;
  width: 5.6rem;
  height: 5.6rem;
  margin-inline: auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #e3f5ef, #ccece2);
  color: #17644f;
  font-size: 2.6rem;
}

.review-manual {
  color: #315b86;
}

@media (max-width: 760px) {
  .track-card-header,
  .test-card-heading-row,
  .chapter-section-navigation-heading,
  .chapter-section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .track-counters {
    justify-content: flex-start;
  }

  .planned-chapter-grid {
    grid-template-columns: 1fr;
  }

  .chapter-availability {
    white-space: normal;
  }
}

.track-access-codes,
.book-code-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-top: .7rem;
  color: #65758b;
  font-size: .82rem;
  font-weight: 700;
}

.track-access-codes code,
.book-code-badges code {
  padding: .3rem .52rem;
  border: 1px solid #c8daf0;
  border-radius: 8px;
  background: #eef5ff;
  color: #0d4f9f;
  font-size: .8rem;
  letter-spacing: .035em;
}

/* StudyPath contextual tutoring CTA + privacy page */
.support-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(75, 139, 226, .22);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 90% 20%, rgba(83, 157, 244, .20), transparent 15rem),
    linear-gradient(135deg, #071a3b, #0b397b);
  color: #fff;
  box-shadow: 0 18px 46px rgba(5, 31, 72, .15);
}

.support-strip > div {
  display: grid;
  gap: .2rem;
}

.support-strip strong {
  font-size: 1.05rem;
}

.support-strip span {
  color: rgba(226, 239, 255, .76);
  font-size: .88rem;
}

.support-strip .button {
  flex: 0 0 auto;
  text-decoration: none;
}

.support-strip-portal {
  margin-top: 0;
}

.policy-page {
  max-width: 860px;
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.policy-page h1 {
  max-width: 760px;
  margin: .4rem 0 1rem;
  font-size: clamp(2.35rem, 6vw, 4.7rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.policy-lead {
  max-width: 720px;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.policy-page section {
  margin: 1rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(31, 48, 89, .055);
}

.policy-page section h2 {
  margin: 0 0 .65rem;
  font-size: 1.28rem;
}

.policy-page section p {
  margin: 0;
  color: var(--text-muted);
}

.policy-page a {
  color: var(--primary-dark);
  font-weight: 700;
}

.policy-updated {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: .82rem;
}

@media (max-width: 720px) {
  .support-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .support-strip .button {
    width: 100%;
    text-align: center;
  }
}
