/* Flashcards: scoped to the student panel so existing tools keep their styles. */
[data-panel="flashcards"] {
  --fc-line: #d5e2e8;
  --fc-muted: #536d7a;
  min-width: 0;
}

[data-panel="flashcards"] [hidden] { display: none !important; }
[data-panel="flashcards"] *,
[data-panel="flashcards"] *::before,
[data-panel="flashcards"] *::after { box-sizing: border-box; }
[data-panel="flashcards"] :where(article, aside, div, form, label, details) { min-width: 0; }
[data-panel="flashcards"] :where(p, h2, h3, h4, label, button, summary, a, span) { overflow-wrap: anywhere; }
[data-panel="flashcards"] :where(button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #087f88;
  outline-offset: 4px;
}
[data-panel="flashcards"] button {
  min-height: 44px;
  max-width: 100%;
  touch-action: manipulation;
  line-height: 1.4;
}
[data-panel="flashcards"] button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
[data-panel="flashcards"] .button { padding: 12px 17px; font-size: 14px; }
[data-panel="flashcards"] .button:hover { transform: none; }

.fc-notice {
  padding: 15px 18px;
  margin: 0 0 24px;
  border: 1px solid #c4dddd;
  border-left: 4px solid #087f88;
  border-radius: 8px;
  color: #345763;
  background: #edf7f7;
  font-size: 13px;
  line-height: 1.7;
}
.fc-notice p:last-child { margin-bottom: 0; }
.fc-notice strong { color: #164a54; }

.fc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 14px;
  margin: 0 0 24px;
}
.fc-stats > * {
  padding: 20px;
  border: 1px solid var(--fc-line);
  border-radius: 10px;
  background: #fff;
}
.fc-stats :where(span, dt, p) { display: block; color: var(--fc-muted); font-size: 13px; margin: 0; }
.fc-stats :where(strong, dd) { display: block; color: #087780; font-size: 30px; line-height: 1.2; margin: 8px 0 0; }

.fc-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--fc-line);
  border-radius: 10px;
  background: #fff;
}
.fc-filters label,
.fc-source-demo label,
.fc-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #34525f;
  font-size: 14px;
  font-weight: 600;
}
.fc-filters select,
.fc-source-demo select,
.fc-form :where(input, select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #b8ced8;
  border-radius: 6px;
  background: #fff;
  color: #193c4c;
  font: 400 16px/1.5 Arial, Helvetica, sans-serif;
}
.fc-form textarea { min-height: 118px; resize: vertical; }
.fc-form :where(input, textarea)::placeholder { color: #657c89; opacity: 1; }
.fc-filters select:disabled,
.fc-form :where(input, select, textarea):disabled { background: #edf2f4; color: #637883; }

.fc-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.fc-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fc-toolbar :where(p, span) { margin: 0; color: var(--fc-muted); font-size: 13px; }
.fc-toolbar button {
  border: 1px solid #bbd0d8;
  border-radius: 7px;
  padding: 10px 16px;
  background: #fff;
  color: #315765;
  font-size: 14px;
  font-weight: 600;
}
.fc-toolbar button:is([aria-pressed="true"], .active) { background: #113446; border-color: #113446; color: #fff; }
.fc-toolbar button:not(:disabled):hover { border-color: #087f88; }

.fc-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.fc-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid #bfd5dd;
  border-top: 4px solid #087f88;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px #183d4d08;
}
.fc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 24px; }
.fc-meta span {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 4px;
  background: #edf3f6;
  color: #456371;
  font-size: 11px;
  line-height: 1.5;
}
.fc-face { padding: 8px 0 20px; min-height: 210px; }
.fc-face :where(h2, h3) {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.45px;
  color: #143747;
  margin-bottom: 20px;
}
.fc-face > p { font-size: 17px; line-height: 1.8; color: #294653; white-space: pre-line; }
.fc-face .eyebrow { font-size: 11px; line-height: 1.5; letter-spacing: 1.4px; color: #087f88; }
.fc-face > :last-child { margin-bottom: 0; }
.fc-comment {
  padding: 18px;
  margin: 20px 0;
  border-left: 3px solid #087f88;
  border-radius: 0 6px 6px 0;
  background: #edf7f7;
  color: #315661;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
}
.fc-comment :where(h3, h4) { margin: 0 0 10px; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
.fc-comment p:last-child { margin-bottom: 0; }
.fc-comment a,
.fc-face a { color: #076d76; text-decoration: underline; text-underline-offset: 3px; }
.fc-card > .button { margin-top: 8px; }
.fc-rating { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.fc-rating button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 66px;
  padding: 10px 8px;
  border: 1px solid #bfd4da;
  border-radius: 7px;
  background: #f6fafb;
  color: #244e5c;
  font-size: 13px;
  font-weight: 600;
}
.fc-rating button :where(small, span) { font-size: 11px; font-weight: 400; }
.fc-rating button:first-child { background: #fff5ea; border-color: #e4c9a5; color: #77511e; }
.fc-rating button:last-child { background: #e8f7f5; border-color: #afd5ce; color: #16625b; }
.fc-rating button:not(:disabled):hover { border-color: #087f88; box-shadow: inset 0 0 0 1px #087f88; }
.fc-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 26px 0 8px; }
.fc-choices button { border: 2px solid #087f88; border-radius: 8px; padding: 14px; background: white; color: #076b74; font: 700 17px Arial,sans-serif; min-height: 54px; cursor: pointer; }
.fc-choices button:not(:disabled):hover { background: #e8f7f5; }
[data-panel="flashcards"] .fc-choices button:disabled { opacity: 1; cursor: default; color: #6a7e88; border-color: #d5e2e8; background: #f5f7f8; }
[data-panel="flashcards"] .fc-choices .fc-choice-correct:disabled { border-color: #087f88; background: #e8f7f5; color: #155b53; }
[data-panel="flashcards"] .fc-choices .fc-choice-wrong:disabled { border-color: #b34242; background: #fff0f0; color: #942f2f; }
#fc-result { margin: 28px 0 10px; font-size: 23px; line-height: 1.4; color: #155b53; }
#fc-result[data-correct="false"] { color: #942f2f; }
.fc-verdict { font-weight: 700; color: #244958; }
#fc-answer { font-size: 18px; line-height: 1.7; }
.fc-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--fc-line);
}
.fc-navigation :where(span, p) { color: var(--fc-muted); font-size: 13px; margin: 0; }

.fc-workspace > aside,
.fc-progress {
  padding: 24px;
  border: 1px solid var(--fc-line);
  border-radius: 10px;
  background: #fff;
  color: var(--fc-muted);
  font-size: 14px;
  line-height: 1.7;
}
.fc-workspace > aside :where(h2, h3),
.fc-progress :where(h2, h3) { color: #143747; font-size: 20px; line-height: 1.35; letter-spacing: -.3px; }
.fc-workspace > aside :last-child,
.fc-progress > :last-child { margin-bottom: 0; }
.fc-progress :where(ul, ol) { padding-left: 20px; }
.fc-progress li { margin: 9px 0; }
.fc-progress progress { display: block; width: 100%; height: 10px; margin: 12px 0; accent-color: #087f88; }
.fc-empty { padding: 32px 24px; border: 1px dashed #aec8d3; border-radius: 10px; background: #fff; text-align: center; }
.fc-empty :where(h2, h3) { font-size: 23px; line-height: 1.35; letter-spacing: -.4px; }
.fc-empty p { color: var(--fc-muted); font-size: 15px; }

.fc-editor { margin-top: 32px; padding: 0 22px; border: 1px solid #c7d7df; border-radius: 10px; background: #fff; }
.fc-editor > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  min-height: 64px;
  cursor: pointer;
  list-style: none;
  color: #274b5c;
  font-size: 16px;
  font-weight: 600;
}
.fc-editor > summary::after { content: "+"; margin-left: auto; flex-shrink: 0; color: #087f88; font-size: 25px; }
.fc-editor[open] > summary::after { content: "\2212"; }
.fc-editor > summary::-webkit-details-marker { display: none; }
.fc-editor > summary small { color: var(--fc-muted); font-size: 12px; font-weight: 400; }
.fc-editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; padding: 4px 0 24px; align-items: start; }
.fc-editor-grid :where(h2, h3) { font-size: 21px; line-height: 1.4; letter-spacing: -.3px; }
.fc-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.fc-form label :where(small, span) { color: var(--fc-muted); font-size: 12px; font-weight: 400; }
.fc-form .fc-full { grid-column: 1 / -1; }
.fc-editor-list { display: grid; gap: 12px; }
.fc-editor-item { padding: 17px; border: 1px solid var(--fc-line); border-radius: 8px; background: #f8fafb; }
.fc-editor-item :where(h3, h4) { margin: 8px 0; color: #244958; font-size: 16px; line-height: 1.6; letter-spacing: 0; }
.fc-editor-item p { color: var(--fc-muted); font-size: 13px; line-height: 1.7; margin: 8px 0; }
.fc-editor-item summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 13px; color: #087780; }
.fc-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fc-editor-actions .button { font-size: 13px; padding: 10px 12px; }
.fc-source-demo { padding: 18px; margin: 20px 0; border: 1px solid #ead7ad; border-radius: 8px; background: #fffbf1; color: #655537; font-size: 14px; line-height: 1.7; }
.fc-source-demo :where(h3, h4) { color: #695323; font-size: 16px; line-height: 1.5; letter-spacing: 0; margin-bottom: 10px; }
.fc-source-demo :last-child { margin-bottom: 0; }
.fc-status { color: #315e68; font-size: 13px; line-height: 1.65; margin: 12px 0; }
.fc-status:empty { margin: 0; }
.fc-status[data-state="error"] { color: #9b3434; }
.fc-status[data-state="success"] { color: #17665c; }
.fc-status[data-state="draft"],
.fc-status[data-state="pending"] { color: #806023; }

@media (max-width: 1100px) {
  .fc-workspace, .fc-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .fc-filters { grid-template-columns: minmax(0, 1fr); }
  .fc-rating { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-face { min-height: 180px; }
}

@media (max-width: 600px) {
  .fc-notice { padding: 13px 14px; }
  .fc-stats { gap: 9px; }
  .fc-stats > * { padding: 16px; }
  .fc-stats :where(strong, dd) { font-size: 27px; }
  .fc-filters { padding: 16px; gap: 14px; }
  .fc-toolbar { align-items: stretch; }
  .fc-toolbar > div { width: 100%; }
  .fc-toolbar button { flex: 1 1 120px; padding: 10px 12px; }
  .fc-workspace { gap: 16px; }
  .fc-card { padding: 20px 17px; }
  .fc-meta { margin-bottom: 16px; }
  .fc-face { min-height: 170px; padding-top: 4px; }
  .fc-face :where(h2, h3) { font-size: 22px; }
  .fc-face > p { font-size: 16px; }
  .fc-comment { padding: 14px; }
  .fc-card > .button { width: 100%; }
  .fc-navigation { gap: 8px; }
  .fc-navigation .button { flex: 1 1 auto; padding: 11px 12px; }
  .fc-workspace > aside, .fc-progress { padding: 20px; }
  .fc-editor { padding: 0 16px; }
  .fc-editor > summary { font-size: 15px; }
  .fc-editor > summary small { display: block; }
  .fc-editor-grid { gap: 22px; }
  .fc-editor-actions .button { flex: 1 1 105px; }
  .fc-empty { padding: 26px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-panel="flashcards"] * { scroll-behavior: auto; transition: none; animation: none; }
}

.fc-settings{margin-top:24px;background:#fff;border:1px solid var(--fc-line);border-radius:10px;padding:0 22px}.fc-settings>summary{min-height:58px;display:flex;align-items:center;cursor:pointer;color:#244b5b;font-weight:600;font-size:15px}.fc-settings>summary::after{content:"+";margin-left:auto;font-size:24px;color:#087f88}.fc-settings[open]>summary::after{content:"−"}.fc-settings>div{padding:0 0 24px;color:var(--fc-muted);font-size:14px;line-height:1.7}.fc-settings h2{font-size:20px;color:#173746}.fc-settings .eyebrow{margin-top:5px}.fc-settings #fc-reset-progress{margin-top:14px}.fc-workspace{max-width:1100px;margin-left:auto;margin-right:auto}
