.spaced-review-container {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: slideUp 0.45s ease-out;
}

.spaced-review-title {
  font-size: 2.35rem;
}

.spaced-review-error {
  color: #ff9c96;
  text-align: left;
  background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.4);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}

.spaced-review-panel,
.spaced-review-session-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.spaced-review-state {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
}

.spaced-review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.spaced-review-filter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.spaced-review-filter input[type="checkbox"],
.spaced-review-library-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-accent);
}

.spaced-review-subjects {
  display: grid;
  gap: 1rem;
}

.spaced-review-subject {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  padding: 0.9rem;
}

.spaced-review-subject-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.spaced-review-subject-toggle,
.spaced-review-subsubject-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.spaced-review-subject-toggle input[type="checkbox"],
.spaced-review-subsubject-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}

.spaced-review-subject-header p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.spaced-review-subject-header small {
  display: block;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.79rem;
}

.spaced-review-subsubject-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.spaced-review-subsubject-block {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
}

.spaced-review-subsubject-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.6rem;
}

.spaced-review-subsubject-header strong {
  font-size: 0.93rem;
}

.spaced-review-subsubject-header span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.spaced-review-subsubject-header small {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.spaced-review-library-list {
  display: grid;
  gap: 0.55rem;
}

.spaced-review-library-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.spaced-review-library-item.selected {
  box-shadow: 0 0 0 1px rgba(var(--color-accent-rgb), 0.45);
}

.spaced-review-library-texts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.spaced-review-library-texts strong {
  font-size: 0.91rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spaced-review-library-texts span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
}

.spaced-review-library-texts small {
  font-size: 0.77rem;
  color: rgba(255, 255, 255, 0.62);
}

.rag-badge,
.rag-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.22rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.rag-icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
}

.rag-red {
  border-left-color: #ff5d5d;
}

.rag-red .rag-badge,
.rag-badge.rag-red,
.spaced-review-filter.rag-red {
  background: rgba(255, 93, 93, 0.15);
}

.rag-red .rag-icon,
.rag-badge.rag-red .rag-icon,
.rag-badge-inline.rag-red .rag-icon {
  background: rgba(255, 93, 93, 0.35);
}

.rag-amber {
  border-left-color: #ffbe55;
}

.rag-amber .rag-badge,
.rag-badge.rag-amber,
.spaced-review-filter.rag-amber {
  background: rgba(255, 190, 85, 0.16);
}

.rag-amber .rag-icon,
.rag-badge.rag-amber .rag-icon,
.rag-badge-inline.rag-amber .rag-icon {
  background: rgba(255, 190, 85, 0.36);
}

.rag-green {
  border-left-color: #46d18a;
}

.rag-green .rag-badge,
.rag-badge.rag-green,
.spaced-review-filter.rag-green {
  background: rgba(70, 209, 138, 0.16);
}

.rag-green .rag-icon,
.rag-badge.rag-green .rag-icon,
.rag-badge-inline.rag-green .rag-icon {
  background: rgba(70, 209, 138, 0.35);
}

.rag-grey {
  border-left-color: #9aa6b5;
}

.rag-grey .rag-badge,
.rag-badge.rag-grey,
.spaced-review-filter.rag-grey {
  background: rgba(154, 166, 181, 0.16);
}

.rag-grey .rag-icon,
.rag-badge.rag-grey .rag-icon,
.rag-badge-inline.rag-grey .rag-icon {
  background: rgba(154, 166, 181, 0.35);
}

.spaced-review-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.spaced-review-footer p {
  font-size: 0.93rem;
  color: rgba(255, 255, 255, 0.78);
}

.spaced-review-progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.spaced-review-progress span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  min-width: 60px;
}

.spaced-review-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.spaced-review-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(var(--color-accent-rgb), 0.8), rgba(var(--color-accent-rgb), 1));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.spaced-review-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  min-height: 260px;
}

.spaced-review-card header {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.spaced-review-card small {
  color: rgba(255, 255, 255, 0.62);
}

.spaced-review-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.9);
}

.spaced-review-card p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.55;
}

.spaced-review-card-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.84rem;
}

.spaced-review-session-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .spaced-review-library-item {
    flex-wrap: wrap;
  }

  .spaced-review-session-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
