.brand {
  padding: 8px 14px;
  gap: 12px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  letter-spacing: -0.025em;
}
.brand-logo {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  filter: invert(1);
}
[data-page-theme="dark"] .brand-logo {
  filter: none;
}
.brand:hover {
  background: #244552;
  text-decoration: none;
}
.brand:focus-visible,
.navigation-toggle:focus-visible {
  outline: 3px solid #428e84;
  outline-offset: 3px;
}
.chapter-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 24px;
}
.chapter-card {
  display: flex;
  flex-direction: column;
  min-height: 410px;
  padding: 24px;
  max-width: none;
}
.chapter-card h3 {
  font-size: 23px;
  margin-top: 0;
  margin-bottom: 12px;
}
.laboratories {
  display: grid;
  gap: 32px;
}
.laboratory-section {
  padding: 26px;
  border-radius: 16px;
  background: #e8f0ed;
  border: 1px solid #dce7e2;
}
.laboratory-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.laboratory-heading h2 {
  margin: 0;
  font-size: 24px;
}
.laboratory-heading p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.theory-icon {
  font-size: 35px;
  line-height: 1;
  color: var(--accent);
}
.workspace .sidebar {
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.navigation-chapter {
  margin: 16px 9px 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.navigation-chapter summary {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.navigation-chapter summary span,
.laboratory-heading h2,
.chapter-card h3 {
  overflow-wrap: anywhere;
}
.navigation-chapter summary::-webkit-details-marker {
  display: none;
}
.navigation-chapter summary::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  color: var(--accent);
}
.navigation-chapter[open] summary::before {
  transform: rotate(45deg);
}
.navigation-chapter summary:hover {
  color: var(--accent);
}
.navigation-chapter summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 5px;
}
.chapter-empty-link {
  padding: 0 5px;
}
.chapter-card .card-top {
  min-height: 44px;
  align-items: center;
  margin-bottom: 28px;
}
.chapter-card p {
  font-size: 13px;
}
.chapter-card-progress {
  margin-top: auto;
  padding-top: 20px;
}
.chapter-card .chapter-score {
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 0;
}
.chapter-card .chapter-score span {
  font-size: 13px;
}
.chapter-card .card-bottom {
  gap: 8px;
}
.workspace:has(.workspace-heading) {
  position: relative;
  padding-top: 58px;
}
.workspace .sidebar[hidden] {
  display: none;
}
.workspace.navigation-hidden {
  grid-template-columns: minmax(0, 1fr);
}
.workspace-heading {
  margin-bottom: 20px;
}
.navigation-toggle {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
}
.heading-copy {
  text-align: left;
}
.auth-providers { display: grid; gap: 12px; }
.auth-providers form, .provider-button { width: 100%; }
.auth-providers .small { margin: 0; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.profile-signin { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.profile-signin form { display: grid; gap: 12px; margin-top: 18px; }
.profile-signin input { width: 100%; }
.profile-signin button { justify-self: start; }
.identity-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.identity-actions form { margin: 0; }
.task-block {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 7px;
}
.task-heading {
  max-width: none;
  margin: 0;
  font-size: clamp(23px, 2vw, 30px);
}
.pdf-reader {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
}
.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.pdf-page-controls,
.pdf-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdf-toolbar button {
  min-width: 32px;
  padding: 5px 9px;
  font-size: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 5px;
}
.pdf-toolbar button:disabled {
  opacity: 0.4;
  cursor: default;
}
.pdf-toolbar input {
  width: 54px;
  padding: 5px;
  font-size: 12px;
}
.pdf-toolbar #pdf-scale {
  min-width: 42px;
  text-align: center;
}
.pdf-status {
  margin: 0;
  padding: 9px 16px;
}
.pdf-scroller {
  overflow: auto;
  padding: 12px;
  background: #e9efed;
  max-height: 80vh;
  min-height: 180px;
}
.pdf-page {
  position: relative;
  margin: auto;
  background: var(--surface);
  box-shadow: 0 2px 10px #152d3a20;
}
.pdf-page canvas {
  display: block;
}
.theory-next {
  display: inline-block;
  margin-top: 20px;
  font-size: 14px;
}
.team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}
.team-heading h1 {
  margin: 0;
  overflow-wrap: anywhere;
}
.team-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.team-manage-grid .panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.team-edit-form {
  display: grid;
  gap: 20px;
  margin-top: auto;
  padding-top: 20px;
}
.team-edit-form label {
  display: block;
  margin-bottom: 8px;
}
.team-edit-form input:not([type="hidden"]),
.team-edit-form select {
  width: 100%;
}
.team-edit-form button {
  justify-self: start;
}
.team-current {
  overflow-wrap: anywhere;
}
.team-changelog summary {
  cursor: pointer;
  color: var(--accent);
}
.team-changelog li {
  margin: 14px 0;
  overflow-wrap: anywhere;
}
@media (max-width: 767px) {
  .workspace .sidebar {
    max-height: 60vh;
    max-height: 60dvh;
  }
  .team-manage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .laboratory-section {
    padding: 18px;
  }
  .laboratory-heading {
    flex-wrap: wrap;
  }
  .brand {
    padding: 8px 12px;
    gap: 10px;
    font-size: 17px;
  }
  .chapter-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 320px;
    margin: auto;
  }
  .chapter-card {
    min-height: 420px;
  }
  .task-block {
    font-size: 12px;
  }
  .pdf-toolbar {
    padding: 10px;
    gap: 10px;
  }
  .pdf-toolbar #pdf-fit {
    font-size: 12px;
  }
  .pdf-scroller {
    max-height: 70vh;
  }
}
