/* Flashcards, quizzes and study notes in a subject notebook's Practice tab. */
:root {
  --sets-cards: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='14' height='11' rx='2'/%3E%3Cpath d='M7 4h12a2 2 0 0 1 2 2v9'/%3E%3C/svg%3E");
  --sets-quiz: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.6 9.4a2.5 2.5 0 1 1 3.5 2.3c-.7.4-1.1 1-1.1 1.8M12 17h.01'/%3E%3C/svg%3E");
  --sets-notes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l4 4v14H7z'/%3E%3Cpath d='M14 3v4h4M9.5 12h5M9.5 16h5'/%3E%3C/svg%3E");
}

/* Six practice choices instead of three: wrap them instead of squeezing them. */
.nb-practice-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.5rem), 1fr)); }
.nb-practice-options .nb-subject-card:nth-child(4) { --nb-option-icon: var(--sets-cards); --nb-option-ink: #9a4a0e; --nb-option-bg: #fdebd6; }
.nb-practice-options .nb-subject-card:nth-child(5) { --nb-option-icon: var(--sets-quiz); --nb-option-ink: #a8305c; --nb-option-bg: #fde6ee; }
.nb-practice-options .nb-subject-card:nth-child(6) { --nb-option-icon: var(--sets-notes); --nb-option-ink: #0f6b78; --nb-option-bg: #dbf2f5; }

#nb-study-sets { margin-block: 7px 17px; }
.sets-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.sets-info { display: grid; gap: 2px; min-width: 0; }
.sets-info strong { overflow-wrap: anywhere; }
.sets-info small { color: var(--muted); }
.sets-row .nb-actions { justify-content: flex-end; }

.sets-materials { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 6px; }
.sets-materials legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.sets-option {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; cursor: pointer;
}
.sets-option input { flex: none; margin-top: .25em; accent-color: var(--accent); }
.sets-option span:first-of-type { flex: 1 1 auto; min-width: 0; }
.sets-option small { display: block; color: var(--muted); }
.sets-option.right { border-color: var(--good); }
.sets-option.wrong { border-color: var(--bad); }
.sets-mark { flex: none; font-size: .85rem; font-weight: 600; color: var(--muted); }
.sets-option.right .sets-mark { color: var(--good); }
.sets-option.wrong .sets-mark { color: var(--bad); }

#nb-task .sets-count { margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.sets-face {
  display: grid; align-content: center; justify-items: start; gap: 8px; min-height: 12rem; padding: clamp(16px, 4vw, 32px);
  border: 1px solid var(--line-2, var(--line)); border-radius: 16px; background: var(--surface); overflow-wrap: anywhere;
}
.sets-face.back { background: var(--accent-wash, var(--surface)); border-color: var(--accent); }
.sets-side { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sets-text { margin: 0; font-size: clamp(1.15rem, 3.4vw, 1.5rem); line-height: 1.4; white-space: pre-wrap; }
.sets-tools { margin-top: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .sets-face.flip-in { animation: sets-flip .35s ease-out; }
}
@keyframes sets-flip { from { transform: rotateY(80deg); opacity: .2; } to { transform: none; opacity: 1; } }

.sets-question, .sets-body { min-width: 0; }
.sets-question fieldset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sets-question legend, .sets-prompt { margin: 0 0 8px; padding: 0; font-size: clamp(1.05rem, 3vw, 1.3rem); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.sets-feedback { margin-top: 14px; display: grid; justify-items: start; gap: 8px; }
.sets-feedback:empty { display: none; }
.sets-feedback p, .sets-feedback h3 { margin: 0; overflow-wrap: anywhere; }
.sets-hint { padding: 8px 12px; border-radius: 10px; background: var(--accent-wash, var(--side)); }
.sets-hint:empty { display: none; }
.sets-verdict.right, .sets-badge.right { color: var(--good); }
.sets-verdict.wrong, .sets-badge.wrong { color: var(--bad); }
#nb-task .sets-score { margin: 0 0 8px; font-size: clamp(1.4rem, 5vw, 2rem); }
.sets-review { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.sets-review li { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.sets-review p { margin: 0; color: var(--ink-2, var(--ink)); }
.sets-badge { font-size: .85rem; font-weight: 700; }
@media (max-width: 520px) {
  .sets-row { grid-template-columns: minmax(0, 1fr); }
  .sets-row .nb-actions { justify-content: flex-start; }
}

/* --- Study notes: guide, summary, FAQ, timeline and mind map --- */
.sets-notes { display: grid; gap: 22px; min-width: 0; margin-top: 12px; overflow-wrap: anywhere; }
.sets-notes [hidden] { display: none !important; }
.sets-part h3 { margin: 0 0 8px; font-size: 1.1rem; }
.sets-notes p { margin: 0; }
.sets-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 10px; }
.sets-source { display: block; width: fit-content; min-height: 32px; padding: 0 2px; font-size: .88rem; text-align: left; }
.sets-sources { display: flex; flex-wrap: wrap; gap: 0 14px; }
.sets-overview { font-size: 1.05rem; line-height: 1.6; }
.sets-terms { display: grid; gap: 2px; margin: 0; }
.sets-terms dt { margin-top: 12px; font-weight: 700; }
.sets-terms dt:first-child { margin-top: 0; }
.sets-terms dd { margin: 0; }
.sets-q { margin-bottom: 6px !important; font-weight: 600; }
.sets-reveal { min-height: 40px; }
.sets-answer { margin: 8px 0 4px; padding: 10px 14px; border-radius: 10px; background: var(--accent-wash, var(--side)); }
.sets-copied { margin: 0; align-self: center; }
.sets-copied:empty { display: none; }

.sets-timeline {
  position: relative; display: grid; gap: 16px; margin: 6px 0 0 7px; padding: 2px 0 2px 22px; list-style: none;
  border-left: 2px solid var(--line-2, var(--line));
}
.sets-timeline li { position: relative; display: grid; justify-items: start; gap: 2px; min-width: 0; }
.sets-timeline li::before {
  content: ""; position: absolute; left: -30px; top: .3em; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.sets-when { color: var(--accent); }

.sets-map { display: grid; justify-items: center; gap: 22px; min-width: 0; }
.sets-topic {
  position: relative; max-width: 100%; padding: 12px 24px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: clamp(1.05rem, 3vw, 1.3rem); font-weight: 700; text-align: center;
}
.sets-topic::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 22px; background: var(--line-2, var(--line)); }
.sets-branches, .sets-leaves { margin: 0; padding: 0; list-style: none; min-width: 0; }
.sets-branches { display: grid; align-items: start; gap: 14px; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.sets-branch { min-width: 0; padding: 8px 10px 12px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; background: var(--surface); }
.sets-branch:nth-child(3n + 2) { border-top-color: #a8305c; }
.sets-branch:nth-child(3n) { border-top-color: #147056; }
.sets-leaves { display: grid; gap: 2px; margin: 4px 0 0 20px; padding-left: 10px; border-left: 2px solid var(--line-2, var(--line)); }
.sets-node { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sets-label {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.sets-branch > .sets-node > .sets-label { font-weight: 700; }
.sets-label:hover { background: var(--accent-wash, var(--side)); }
.sets-label[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-wash, var(--side)); }
.sets-spacer { flex: none; width: 44px; }
.sets-toggle { position: relative; flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.sets-toggle::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-50%, -70%) rotate(45deg);
}
.sets-toggle[aria-expanded="false"]::before { transform: translate(-70%, -50%) rotate(-45deg); }
@media (prefers-reduced-motion: no-preference) {
  .sets-toggle::before { transition: transform .15s ease-out; }
}
.sets-detail { margin: 2px 0 6px 10px; padding: 2px 10px; border-radius: 10px; background: var(--accent-wash, var(--side)); }

@media (max-width: 640px) {
  .sets-map { justify-items: stretch; gap: 12px; }
  .sets-topic { border-radius: 14px; text-align: left; }
  .sets-topic::after { display: none; }
  .sets-branches { gap: 6px; margin-left: 6px; padding-left: 10px; border-left: 2px solid var(--line-2, var(--line)); }
  .sets-branch { padding: 0; border: 0; border-radius: 0; background: transparent; }
}
