/* ===========================================================
   tools.css — the two study tools (terms.html, scenarios.html)
   =========================================================== */
.tool-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-nav a { padding: 7px 14px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-weight: 600; text-decoration: none; }
.tool-nav a:hover { background: var(--yellow); }
.tool-lead { margin: 4px 0 12px; color: var(--ink); }
.hidden-box { display: none; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; }
.row-label { font-weight: 700; color: var(--purple); }
.chips, .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .seg button {
  font: inherit; font-weight: 600; cursor: pointer; border: 2px solid var(--purple); background: var(--white);
  color: var(--purple); border-radius: 999px; padding: 4px 14px;
}
.chip.on, .seg button.on { background: var(--purple); color: var(--white); }
.chip.all { border-style: dashed; }

/* flashcards */
.deck-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-weight: 600; color: var(--purple); margin-bottom: 10px; }
.flash {
  font: inherit; width: 100%; min-height: 240px; border: none; cursor: pointer; border-radius: 22px; padding: 24px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: linear-gradient(160deg, var(--purple-soft), var(--pink-soft)); color: var(--ink);
  box-shadow: inset 0 0 0 4px var(--white), 0 6px 0 rgba(61,44,92,.12); transition: transform .15s;
}
.flash:active { transform: scale(.99); }
.flash-ch { font-size: .85rem; color: var(--purple); font-weight: 600; }
.flash-front { font-size: 2rem; font-weight: 700; }
.flash-front.is-def, .flash-back.is-def { font-size: 1.3rem; font-weight: 600; max-width: 760px; }
.flash-back { display: none; font-size: 2rem; font-weight: 700; color: var(--purple); }
.flash.flipped .flash-back { display: block; }
.flash.flipped { background: linear-gradient(160deg, #fff6c7, var(--purple-soft)); }
.flash-hint { font-size: .85rem; opacity: .6; }
.deck-btns { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.deck-note { text-align: center; color: var(--purple); min-height: 1.4em; margin: 8px 0 0; }

/* quiz + scenarios */
.quiz-q { font-size: 1.3rem; font-weight: 600; margin: 4px 0 14px; }
.quiz-q small { display: block; font-size: .85rem; color: var(--purple); font-weight: 600; margin-bottom: 4px; }
.scenario { font-size: 1.35rem; line-height: 1.45; margin: 4px 0 6px; padding: 16px 18px; border-radius: 16px; background: var(--blue-soft); }
.sc-ask { font-weight: 700; color: var(--purple); margin: 10px 0; }
.quiz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.opt {
  font: inherit; font-weight: 600; text-align: left; cursor: pointer; padding: 12px 16px; border-radius: 14px;
  border: 3px solid var(--purple-soft); background: var(--white); color: var(--ink); transition: transform .12s, border-color .12s;
}
.opt:not(:disabled):hover { border-color: var(--purple); transform: translateY(-2px); }
.opt.right { border-color: #2e9e5b; background: #e6f8ec; }
.opt.wrong { border-color: var(--true-red); background: #fde8ea; }
.opt:disabled { cursor: default; }
.quiz-feedback { min-height: 1.5em; margin: 14px 0 0; font-size: 1.05rem; line-height: 1.45; }
.quiz-feedback.good { color: #1f7a45; }
.quiz-feedback.bad { color: var(--ink); }
.quiz-feedback .why, .quiz-feedback .book { display: block; margin-top: 8px; color: var(--ink); }
.quiz-feedback .book { padding: 8px 12px; border-left: 4px solid var(--purple); background: var(--purple-soft); border-radius: 8px; }

.miss-list { line-height: 1.5; }
.miss-list li { margin-bottom: 6px; }
.hist { width: 100%; border-collapse: collapse; }
.hist th, .hist td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--purple-soft); }
.hist th { color: var(--purple); }
.bar { display: inline-block; width: 120px; height: 10px; border-radius: 999px; background: var(--purple-soft); vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--purple)); }
.empty { color: var(--purple); font-style: italic; }
.source-line { text-align: center; font-size: .9rem; color: var(--purple); }
