/* Rycal Cram Sheet (2026-10-04) — calm, tappable review sheet. */

.cram-intro {
  color: var(--text-soft, #64748b);
  font-size: 14px;
  line-height: 1.55;
  max-width: 640px;
  margin: 0 0 20px;
}

.cram-section {
  margin-bottom: 28px;
  max-width: 720px;
}

.cram-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cram-section-head h2 {
  font-size: 18px;
  margin: 0;
}

.cram-count {
  font-size: 12px;
  color: var(--text-soft, #64748b);
  white-space: nowrap;
}

.cram-section-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cram-mini {
  padding: 6px 12px;
  font-size: 12px;
}

.cram-empty {
  color: var(--text-soft, #64748b);
  font-size: 14px;
  font-style: italic;
}

/* --- Hidden key terms (cloze) --- */
.cram-cloze-item {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.7;
}

.cram-cloze-item.is-revealed {
  border-color: var(--rycal-emerald-200, #a7f3d0);
  background: var(--rycal-emerald-50, #ecfdf5);
}

.cram-blank {
  display: inline-block;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px dashed var(--border-strong, #94a3b8);
  border-radius: 8px;
  padding: 2px 14px;
  margin: 0 2px;
  font: inherit;
  font-weight: 700;
  color: var(--text, #1e293b);
  cursor: pointer;
  vertical-align: baseline;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cram-blank:hover {
  background: var(--rycal-emerald-100, #d1fae5);
  border-color: var(--rycal-emerald-400, #34d399);
}

.cram-blank.is-revealed {
  background: var(--rycal-emerald-100, #d1fae5);
  border-style: solid;
  border-color: var(--rycal-emerald-400, #34d399);
  cursor: default;
}

.cram-blank-answer {
  color: var(--rycal-emerald-800, #065f46);
}

/* --- Confusing pairs --- */
.cram-pair {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.cram-pair-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}

.cram-pair-vs {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft, #64748b);
}

.cram-pair-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cram-pair-card.is-revealed {
  border-color: var(--rycal-emerald-200, #a7f3d0);
  background: var(--rycal-emerald-50, #ecfdf5);
}

.cram-pair-term {
  font-weight: 800;
  font-size: 14px;
}

.cram-pair-reveal {
  background: var(--bg-subtle, #f1f5f9);
  border: 1px dashed var(--border-strong, #94a3b8);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text-soft, #64748b);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.cram-pair-reveal:hover {
  border-color: var(--rycal-emerald-400, #34d399);
}

.cram-pair-card.is-revealed .cram-pair-reveal {
  cursor: default;
  border-style: solid;
  border-color: var(--rycal-emerald-200, #a7f3d0);
  background: transparent;
}

.cram-pair-def {
  color: var(--text, #1e293b);
  font-size: 13px;
  line-height: 1.5;
}

.cram-pair-diff {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft, #475569);
}

.cram-pair-diff strong {
  color: var(--text, #1e293b);
}

/* --- Quick definitions --- */
.cram-quick-item {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 12px;
  align-items: start;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.cram-quick-item.is-revealed {
  border-color: var(--rycal-emerald-200, #a7f3d0);
}

.cram-quick-term {
  font-weight: 700;
  font-size: 14px;
}

.cram-quick-reveal {
  background: var(--bg-subtle, #f1f5f9);
  border: 1px dashed var(--border-strong, #94a3b8);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text-soft, #64748b);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.cram-quick-reveal:hover {
  border-color: var(--rycal-emerald-400, #34d399);
}

.cram-quick-item.is-revealed .cram-quick-reveal {
  cursor: default;
  border-style: solid;
  background: transparent;
  border-color: var(--rycal-emerald-200, #a7f3d0);
}

.cram-quick-def {
  color: var(--text, #1e293b);
  font-size: 13px;
  line-height: 1.5;
}

/* --- Topic picker ("build your own") --- */
#cramTopicPicker {
  max-width: 720px;
}

.cram-picker-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cram-topic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.cram-topic-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
}

.cram-topic-row:hover {
  border-color: var(--rycal-emerald-400, #34d399);
}

.cram-topic-check {
  width: 18px;
  height: 18px;
  accent-color: var(--rycal-emerald-500, #10b981);
  cursor: pointer;
}

.cram-topic-name {
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.4;
}

.cram-topic-count {
  font-size: 12px;
  color: var(--text-soft, #64748b);
  white-space: nowrap;
}

.cram-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--bg, #0f172a);
  padding: 14px 0;
  border-top: 1px solid var(--border, #e2e8f0);
}

.cram-picker-summary {
  font-size: 13px;
  color: var(--text-soft, #64748b);
}

.cram-change-topics {
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--rycal-emerald-600, #059669);
  text-decoration: underline;
  cursor: pointer;
  display: inline;
}

.cram-change-topics:hover {
  color: var(--rycal-emerald-500, #10b981);
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .cram-pair-cards {
    grid-template-columns: 1fr;
  }
  .cram-pair-vs {
    justify-content: center;
    padding: 2px 0;
  }
  .cram-quick-item {
    grid-template-columns: 1fr;
  }
}
.cram-pair-diff.is-hidden{display:none;}

/* --- Knew it / Didn't ratings --- */
.cram-tally {
  font-size: 12px;
  color: var(--text-soft, #64748b);
}

.cram-rate {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cram-rate-prompt {
  font-size: 12px;
  color: var(--text-soft, #64748b);
}

.cram-rate-btn {
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg-subtle, #f1f5f9);
  border-radius: 8px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text, #1e293b);
}

.cram-rate-btn:hover {
  border-color: var(--rycal-emerald-400, #34d399);
}

.cram-rate-btn.is-on[data-cram-rate="knew"] {
  background: var(--rycal-emerald-100, #d1fae5);
  border-color: var(--rycal-emerald-500, #10b981);
  color: var(--rycal-emerald-800, #065f46);
}

.cram-rate-btn.is-on[data-cram-rate="didnt"] {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

/* Revealed but not yet rated: subtle amber outline as a nudge. */
.cram-cloze-item.is-unrated,
.cram-quick-item.is-unrated,
.cram-cell.is-unrated,
.cram-miss-item.is-unrated {
  outline: 2px dashed #d97706;
  outline-offset: 2px;
}

/* --- Confusing pairs: comparison table --- */
.cram-ptable {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.cram-ctable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}

.cram-ctable th,
.cram-ctable td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.cram-ctable thead th {
  font-size: 14px;
  font-weight: 800;
}

.cram-ctable thead th:first-child,
.cram-ctable tbody th[scope="row"] {
  width: 110px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft, #64748b);
  font-weight: 700;
}

.cram-ctable tbody tr:last-child th,
.cram-ctable tbody tr:last-child td {
  border-bottom: none;
}

.cram-diff-row td {
  background: var(--rycal-emerald-50, #ecfdf5);
}

.cram-diff-row.is-hidden {
  display: none;
}

.cram-cell {
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  min-height: 44px;
}

.cram-cell:not(.is-revealed):hover {
  background: var(--bg-subtle, #f1f5f9);
}

.cram-cell:focus-visible {
  outline: 2px solid var(--rycal-emerald-500, #10b981);
  outline-offset: 2px;
}

.cram-cell-hidden {
  display: block;
  text-align: center;
  color: var(--text-soft, #64748b);
  border: 1px dashed var(--border-strong, #94a3b8);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.cram-cell-answer {
  color: var(--text, #1e293b);
  padding: 4px 2px;
}

.cram-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Session bar --- */
#cramSessionBar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  background: var(--bg, #0f172a);
  padding: 12px 0;
  border-top: 1px solid var(--border, #e2e8f0);
  margin-top: 8px;
  max-width: 720px;
}

#cramSessionBar[hidden] {
  display: none;
}

#cramMissBtn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* --- Miss re-queue view --- */
#cramMissWrap {
  max-width: 720px;
}

.cram-miss-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.cram-miss-head h2 {
  font-size: 18px;
  margin: 0 0 2px;
}

.cram-miss-item {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.cram-miss-item.is-miss-done {
  opacity: 0.55;
}

.cram-miss-kind {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft, #64748b);
  font-weight: 700;
  margin-bottom: 6px;
}

.cram-miss-prompt {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.cram-miss-vs {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft, #64748b);
}

.cram-miss-reveal {
  border: 1px dashed var(--border-strong, #94a3b8);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft, #64748b);
  cursor: pointer;
  background: var(--bg-subtle, #f1f5f9);
}

.cram-miss-reveal:hover {
  border-color: var(--rycal-emerald-400, #34d399);
}

.cram-miss-answer {
  font-size: 14px;
  line-height: 1.6;
  color: var(--rycal-emerald-800, #065f46);
  font-weight: 600;
  padding: 4px 2px;
}

.cram-miss-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}

/* --- Recap --- */
#cramRecapWrap {
  max-width: 720px;
}

.cram-recap h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.cram-recap-stats {
  font-size: 14px;
  color: var(--text-soft, #64748b);
  margin-bottom: 20px;
}

.cram-recap-stats b {
  color: var(--text, #1e293b);
}

.cram-recap h3 {
  font-size: 15px;
  margin: 0 0 10px;
}

.cram-recap-item {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-left: 3px solid #d97706;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.cram-recap-term {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.cram-recap-def {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text, #1e293b);
}

.cram-recap-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.cram-recap-note {
  font-size: 12px;
  color: var(--text-soft, #64748b);
  margin-top: 12px;
}

/* --- Mobile: stack comparison tables --- */
@media (max-width: 640px) {
  .cram-ctable thead {
    display: none;
  }
  .cram-ctable,
  .cram-ctable tbody,
  .cram-ctable tr,
  .cram-ctable th,
  .cram-ctable td {
    display: block;
    width: 100%;
  }
  .cram-ctable tr {
    border-bottom: 1px solid var(--border, #e2e8f0);
    padding: 4px 0;
  }
  .cram-ctable tbody tr:last-child {
    border-bottom: none;
  }
  .cram-ctable th,
  .cram-ctable td {
    border-bottom: none;
    padding: 6px 8px;
  }
  .cram-ctable tbody th[scope="row"] {
    width: 100%;
    padding-bottom: 0;
  }
  .cram-ctable td[data-term]::before {
    content: attr(data-term);
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-soft, #64748b);
    margin-bottom: 6px;
  }
  #cramSessionBar {
    flex-wrap: wrap;
  }
}

/* --- Quick cram / full sheet mode toggle --- */
.cram-mode-toggle {
  display: inline-flex;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 16px;
  max-width: 100%;
}
.cram-mode-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft, #64748b);
  cursor: pointer;
  white-space: nowrap;
}
.cram-mode-btn.is-on {
  background: var(--bg-surface, #fff);
  color: var(--text, #0f172a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.cram-mode-est {
  font-weight: 400;
  opacity: 0.75;
}
