/* On-screen math symbol pad — tokens only, mobile-first. */
.qcard-mathpad { display: flex; flex-direction: column; gap: 0.5rem; }
.qcard-input-row { display: flex; align-items: center; gap: 0.5rem; }
.qcard-input-row .qcard-input { flex: 1 1 auto; }

/* Multi-line variant — the AI-tutor turn input is a textarea, so the toggle
   sits at the top of the field instead of centred against three rows, and the
   field's own `margin-bottom` (from .teaching-text-input) is dropped because
   .qcard-mathpad already spaces the row from the pad. `min-width: 0` is the
   flexbox belt-and-braces for a width:100% child; measured at 390px and 320px
   the row does not overflow either way. State class, not a second BEM block
   (Thymeleaf `__` trap). */
.qcard-input-row.is-multiline { align-items: flex-start; }
.qcard-input-row.is-multiline .qcard-input {
  width: auto;
  min-width: 0;
  margin-bottom: 0;
}

.qcard-mathpad-toggle {
  min-height: var(--touch-min, 44px);
  min-width: var(--touch-min, 44px);
  padding: 0 0.75rem;
  border: 1.5px solid var(--accent-primary);
  color: var(--accent-primary);
  background: transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}
.qcard-mathpad-toggle[aria-expanded="true"] {
  background: var(--accent-primary);
  color: var(--accent-primary-text);
}

.qcard-mathpad-pad {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* FEAT-018 — grouped scientific layout: each group is its own labelled
   6-column grid inside the pad's vertical stack. */
.qcard-mathpad-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.qcard-mathpad-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.375rem;
}
.qcard-mathpad-key {
  min-height: var(--touch-min, 44px);
  border: 1px solid var(--border-default);
  background: var(--surface-inset);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
}
.qcard-mathpad-key:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* FEAT-021 — escape hatch for context-aware group suppression: quiet, full
   width, always the last element of the pad while any group is hidden. */
.qcard-mathpad-show-all {
  min-height: var(--touch-min, 44px);
  border: 1px dashed var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.qcard-mathpad-show-all:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

.qcard-mathpad-preview {
  min-height: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
