.pg-study-rail {
  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 80;
  width: 138px;
  padding: 12px;
  border: 1px solid rgba(121, 192, 255, 0.22);
  border-radius: 18px;
  background: rgba(13, 17, 23, 0.78);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), 0 0 30px rgba(51, 103, 145, 0.14);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
}

.pg-study-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #8b949e;
  font: 800 10px/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
}

.pg-study-rail__head strong {
  color: #79c0ff;
  letter-spacing: 0;
}

.pg-study-rail__bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  margin-bottom: 10px;
}

.pg-study-rail__bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #336791, #79c0ff, #3fb950);
  transition: width 0.22s ease;
}

.pg-study-rail__items {
  display: grid;
  gap: 6px;
}

.pg-study-rail button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #c9d1d9;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.pg-study-rail__items button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 7px;
  text-align: left;
}

.pg-study-rail__items span {
  color: #79c0ff;
  font: 900 10px/1 "JetBrains Mono", ui-monospace, monospace;
}

.pg-study-rail__items small {
  overflow: hidden;
  color: #8b949e;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pg-study-rail button:hover,
.pg-study-rail button:focus-visible,
.pg-study-rail button.is-active {
  border-color: rgba(121, 192, 255, 0.48);
  background: rgba(51, 103, 145, 0.18);
  transform: translateY(-1px);
}

.pg-study-rail button.is-done {
  border-color: rgba(63, 185, 80, 0.36);
  background: rgba(63, 185, 80, 0.1);
}

.pg-study-rail button.is-done span::after {
  content: ' ✓';
  color: #3fb950;
}

.pg-study-rail__actions {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.pg-study-rail__actions button {
  min-height: 31px;
  color: #e6edf3;
  font: 800 11px/1 "JetBrains Mono", ui-monospace, monospace;
}

.pg-hero-boost {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.pg-hero-boost button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(121, 192, 255, 0.28);
  border-radius: 999px;
  background: rgba(51, 103, 145, 0.12);
  color: #e6edf3;
  cursor: pointer;
  font: 800 13px/1 "JetBrains Mono", ui-monospace, monospace;
  box-shadow: 0 18px 50px rgba(51, 103, 145, 0.18);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.pg-hero-boost button:hover,
.pg-hero-boost button:focus-visible {
  border-color: #79c0ff;
  background: rgba(51, 103, 145, 0.24);
  transform: translateY(-2px);
}

.pg-section-boost {
  position: relative;
  z-index: 3;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto 22px;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid rgba(121, 192, 255, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(121, 192, 255, 0.11), transparent 42%),
    rgba(13, 17, 23, 0.74);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(12px);
}

.pg-section-boost.is-done {
  border-color: rgba(63, 185, 80, 0.34);
  background:
    radial-gradient(circle at 0 0, rgba(63, 185, 80, 0.10), transparent 42%),
    rgba(13, 17, 23, 0.74);
}

.pg-section-boost__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pg-section-boost__meta span {
  color: #79c0ff;
  font: 900 11px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.16em;
}

.pg-section-boost__meta button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(63, 185, 80, 0.28);
  border-radius: 999px;
  background: rgba(63, 185, 80, 0.08);
  color: #a7f3d0;
  cursor: pointer;
  font: 800 11px/1 "JetBrains Mono", ui-monospace, monospace;
}

.pg-section-boost__thesis {
  margin: 0 0 13px;
  color: #e6edf3;
  font-size: clamp(0.94rem, 1.2vw, 1.05rem);
  font-weight: 750;
  line-height: 1.65;
}

.pg-section-boost__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.82fr);
  gap: 12px;
}

.pg-section-boost__grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(22, 27, 34, 0.62);
}

.pg-section-boost strong {
  display: block;
  margin-bottom: 8px;
  color: #f78166;
  font: 900 11px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
}

.pg-section-boost ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.05rem;
  color: #8b949e;
  font-size: 13px;
  line-height: 1.5;
}

.pg-section-boost code {
  display: block;
  overflow-x: auto;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #a7f3d0;
  font: 750 12px/1.55 "JetBrains Mono", ui-monospace, monospace;
  white-space: pre-wrap;
}

.pg-quiz-drawer {
  position: fixed;
  right: 176px;
  bottom: 18px;
  z-index: 95;
  width: min(410px, calc(100vw - 32px));
  padding: 15px;
  border: 1px solid rgba(247, 129, 102, 0.28);
  border-radius: 18px;
  background: rgba(13, 17, 23, 0.9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 36px rgba(247, 129, 102, 0.12);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.pg-quiz-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.pg-quiz-drawer__top,
.pg-quiz-drawer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pg-quiz-drawer__top span {
  color: #f78166;
  font: 900 11px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.16em;
}

.pg-quiz-drawer button {
  border: 1px solid rgba(247, 129, 102, 0.24);
  border-radius: 999px;
  background: rgba(247, 129, 102, 0.08);
  color: #ffd8cc;
  cursor: pointer;
  font-weight: 800;
}

.pg-quiz-drawer__top button {
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
}

.pg-quiz-drawer__q {
  margin: 12px 0 10px;
  color: #e6edf3;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
}

.pg-quiz-drawer__a {
  margin: 0 0 12px;
  padding: 12px;
  border-left: 3px solid #f78166;
  border-radius: 10px;
  background: rgba(247, 129, 102, 0.08);
  color: #c9d1d9;
  font-size: 13px;
  line-height: 1.65;
}

.pg-quiz-drawer__actions button {
  min-height: 34px;
  padding: 0 13px;
}

.pg-zoomable-image {
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.pg-zoomable-image:hover,
.pg-zoomable-image:focus-visible {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(-2px);
}

.pg-image-zoom {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 4, 9, 0.86);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.pg-image-zoom.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pg-image-zoom img {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.pg-image-zoom button {
  position: absolute;
  right: 22px;
  top: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.76);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
}

pre {
  position: relative;
}

.pg-copy-code {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(121, 192, 255, 0.28);
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.74);
  color: #79c0ff;
  cursor: pointer;
  font: 900 10px/1 "JetBrains Mono", ui-monospace, monospace;
}

@media (max-width: 980px) {
  .pg-study-rail {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    transform: none;
  }

  .pg-study-rail__items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pg-study-rail__items button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 34px;
    padding: 5px 3px;
    text-align: center;
  }

  .pg-study-rail__items small {
    display: none;
  }

  .pg-study-rail__actions {
    grid-template-columns: 1fr 1fr;
  }

  .pg-quiz-drawer {
    left: 10px;
    right: 10px;
    bottom: 118px;
    width: auto;
  }
}

@media (max-width: 720px) {
  .pg-section-boost {
    width: min(100%, calc(100vw - 32px));
    margin-bottom: 16px;
  }

  .pg-section-boost__grid {
    grid-template-columns: 1fr;
  }

  .pg-hero-boost {
    width: min(100%, calc(100vw - 32px));
    margin-left: auto;
    margin-right: auto;
  }

  .pg-hero-boost button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg-study-rail *,
  .pg-hero-boost *,
  .pg-section-boost *,
  .pg-quiz-drawer,
  .pg-image-zoom {
    transition: none !important;
  }
}
