:root {
  --worksheet-accent: #0a5e8c;
  --worksheet-soft: rgba(10, 94, 140, 0.08);
  --worksheet-border: rgba(10, 94, 140, 0.18);
}

.worksheet-nav,
.worksheet-grade-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--worksheet-border);
  background: #fff;
  color: var(--worksheet-accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.pill.active {
  background: var(--worksheet-accent);
  color: #fff;
  border-color: var(--worksheet-accent);
}

.worksheet-filters {
  margin-bottom: 2rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.filter-grid .input {
  width: 100%;
}

.worksheet-grid {
  gap: 1.5rem;
}

.worksheet-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.worksheet-thumb {
  background: var(--worksheet-soft);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

.worksheet-thumb img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.worksheet-body {
  padding: 1.25rem;
}

.worksheet-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.worksheet-hero .lead {
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.7);
}

.worksheet-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.worksheet-detail {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.worksheet-preview {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  background: var(--worksheet-soft);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--worksheet-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.worksheet-preview img {
  width: 100%;
  border-radius: 12px;
}

.rich-text > * + * {
  margin-top: 1rem;
}

.faq {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border-radius: 14px;
  border: 1px solid var(--worksheet-border);
  padding: 0.75rem 1rem;
  background: #fff;
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
}

.faq-body {
  margin-top: 0.75rem;
  color: rgba(0, 0, 0, 0.7);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
}

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

  .worksheet-preview {
    position: static;
  }
}
